LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 07: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, 12:23 AM   #2
GoinEasy9
Member
 
Registered: Feb 2004
Location: Manorville, New York, USA
Distribution: siduction, openSUSE Tumbleweed
Posts: 379
Blog Entries: 1

Rep: Reputation: 47
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, 01:35 AM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,685

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
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, 02: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, 04:13 AM   #5
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,696
Blog Entries: 33

Rep: Reputation: 290Reputation: 290Reputation: 290
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, 06: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 06:21 AM.
 
Old 01-26-2010, 06: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, 10:11 PM   #8
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,696
Blog Entries: 33

Rep: Reputation: 290Reputation: 290Reputation: 290
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 Thumbnails
Click image for larger version

Name:	snapshot2.png
Views:	14
Size:	126.4 KB
ID:	2577  

Last edited by GlennsPref; 01-26-2010 at 10:22 PM.
 
Old 01-27-2010, 07: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, 07: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, 07: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, 04:39 PM   #12
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,685

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
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 05:04 AM
how to load a kernel module at boot time yugandhar Linux - Kernel 1 09-08-2006 02:33 AM
how to load a kernel module at boot time yugandhar Linux - Kernel 1 08-19-2006 07:48 AM
not recompile kernel, but 1 module -possible? deNiro Debian 4 01-31-2005 03:48 PM
How to deactivate a Kernel module at boot time? the who Slackware 3 04-25-2004 09:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:10 PM.

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
Open Source Consulting | Domain Registration