LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   recompile my module on boot time with kernel (https://www.linuxquestions.org/questions/linux-newbie-8/recompile-my-module-on-boot-time-with-kernel-784572/)

Gourab Das 01-25-2010 07:04 AM

recompile my module on boot time with kernel
 
Hi,

I am using FC9, I want to write a module that will always show current time after booting.But for that I need not only to load module using insmod/modprobe, but also to compile that module during boot time.How can I perform this 2 steps correctly.

GoinEasy9 01-26-2010 12:23 AM

Fedora's akmod's compile during the boot process, you might want to download the source code of one of them and see how it works. Since you want to write a module, that would be a good place to start. Finding the source code for Fedora 9 might be a problem though, since it reached its end of life over a year ago.

John VV 01-26-2010 01:35 AM

Fedora 9 is No longer supported and is past it's End Of Life

PLEASE !!!!!!!
install CentOS 5.4 ( if you need long life - 5 years )
or Fedora 12 if you want a life span of 13 MONTHS - (or 5 months until fedora 13 is out )

Gourab Das 01-26-2010 02:57 AM

loading a module in FC9 at the boot time
 
Hi,
I fail to load a modulein FC9 at the boot time. I have written in

1>/etc/rc.d/rc.local insmod <module name> but it didn't work.
2>I also edit /etc/modprobe.conf but it also didn't work.

So,I would have been grateful if someone solve my problem.

GlennsPref 01-26-2010 04:13 AM

Hi, I use Mandriva!

IN/with Mandrivs there is a file called

/etc/modprobe.preload
Code:

# /etc/modprobe.preload: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line.  Comments begin with
# a `#', and everything on the line after them are ignored.
# this file is for module-init-tools (kernel 2.5 and above) ONLY
# for old kernel use /etc/modules

evdev

I'm using evdev for my Joystick, but it also tracks mouse and keyboard movements.

If your edits to modprobe.conf did not work, look for a module that may be loading before, taking the place/blocking of the correct module

"lsmod" usually displays such facts.

Be careful of spelling, it will make a difference!

Mandriva is very similar, but not the same as Fedora.(imo)

Regards Glenn

Gourab Das 01-26-2010 06:19 AM

Hi ,
Thanks for replying, but FC9 doesn't have any /etc/modprobe.preload,so I can't get through the problem.

Gourab Das 01-26-2010 06:19 AM

Hi ,
Thanks for replying, but FC9 doesn't have any /etc/modprobe.preload,so I can't get through the problem.

GlennsPref 01-26-2010 10:11 PM

1 Attachment(s)
I'm not sure why you want to do this.

Do you want to see the time on the console after boot?

Why not configure bash or zsh (shell) to display it for you?

Or is this an excersize in making modules?

I use the z shell and have it configured to show the time and coloured text. In both gui and cli modes.
Quote:

# Put a clock on the right hand prompt
RPS1="$PR_CYAN(%D{%d-%m %H:%M})$PR_NO_COLOR"
Regards Glenn

Gourab Das 01-27-2010 07:33 AM

Hi,
I have written a programme in gcc
#include <time.h>
#include <stdio.h>
int main(void)
{
time_t timer;
struct tm *tblock;
timer = time(NULL);
tblock = localtime(&timer);
printf("%d",tblock->tm_mday);
return 0;
}
It has been compiled in gcc.But in kernel space it hasn't been solved. Please can anyone suggest the kernel space version of this code.

Gourab Das 01-27-2010 07:34 AM

Hi,
I have written a programme in gcc
Quote:

Originally Posted by Gourab Das (Post 3842148)
#include <time.h>
#include <stdio.h>
int main(void)
{
time_t timer;
struct tm *tblock;
timer = time(NULL);
tblock = localtime(&timer);
printf("%d",tblock->tm_mday);
return 0;
}


It has been compiled in gcc.But in kernel space it hasn't been solved. Please can anyone suggest the kernel space version of this code.


Gourab Das 01-27-2010 07:35 AM

Hi,
I have written a programme in gcc
Quote:

Originally Posted by Gourab Das (Post 3842148)
#include <time.h>
#include <stdio.h>
int main(void)
{
time_t timer;
struct tm *tblock;
timer = time(NULL);
tblock = localtime(&timer);
printf("%d",tblock->tm_mday);
return 0;
}

It has been compiled in gcc.But in kernel space it hasn't been solved. Please can anyone suggest the kernel space version of this code.

John VV 01-27-2010 04:39 PM

Gourab Das
Fedora 9 is unsupported - there are NO updates ti it and there have beed NO updates for a year now AND there WILL NEVER BE and updates to it
please do your self AND THE REST OF THE NET A VERY BIG SECURITY FAVOR and install a supported version

fedora 12

OR a long life distro like CentOS 5.4 or RHEL 5.4 !!!!


All times are GMT -5. The time now is 03:20 PM.