LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-25-2010, 08:04 AM   #1
Gourab Das
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Rep: Reputation: 0
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.
 
Old 01-26-2010, 01:23 AM   #2
GoinEasy9
Member
 
Registered: Feb 2004
Location: Manorville, New York, USA
Distribution: siduction, Fedora 19, openSUSE Tumbleweed
Posts: 379
Blog Entries: 1

Rep: Reputation: 46
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.
 
Old 01-26-2010, 02:35 AM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 13,477

Rep: Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802
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 )
 
Old 01-26-2010, 03:57 AM   #4
Gourab Das
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 01-26-2010, 05:13 AM   #5
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
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
 
Old 01-26-2010, 07:19 AM   #6
Gourab Das
LQ Newbie
 
Registered: Jan 2010
Posts: 10

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

Last edited by Gourab Das; 01-26-2010 at 07:21 AM.
 
Old 01-26-2010, 07:19 AM   #7
Gourab Das
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Hi ,
Thanks for replying, but FC9 doesn't have any /etc/modprobe.preload,so I can't get through the problem.
 
Old 01-26-2010, 11:11 PM   #8
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
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
Attached Images
File Type: png snapshot2.png (126.4 KB, 6 views)

Last edited by GlennsPref; 01-26-2010 at 11:22 PM.
 
Old 01-27-2010, 08:33 AM   #9
Gourab Das
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 01-27-2010, 08:34 AM   #10
Gourab Das
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,
I have written a programme in gcc
Quote:
Originally Posted by Gourab Das View Post
#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.
 
Old 01-27-2010, 08:35 AM   #11
Gourab Das
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,
I have written a programme in gcc
Quote:
Originally Posted by Gourab Das View Post
#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.
 
Old 01-27-2010, 05:39 PM   #12
John VV
Guru
 
Registered: Aug 2005
Posts: 13,477

Rep: Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802
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 !!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No prompt after kernel/module messages at boot time m4mach Linux From Scratch 4 08-14-2007 06:04 AM
how to load a kernel module at boot time yugandhar Linux - Kernel 1 09-08-2006 03:33 AM
how to load a kernel module at boot time yugandhar Linux - Kernel 1 08-19-2006 08:48 AM
not recompile kernel, but 1 module -possible? deNiro Debian 4 01-31-2005 04:48 PM
How to deactivate a Kernel module at boot time? the who Slackware 3 04-25-2004 10:57 AM


All times are GMT -5. The time now is 12:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration