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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-25-2010, 07:04 AM
|
#1
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Rep:
|
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.
|
|
|
01-26-2010, 12:23 AM
|
#2
|
Member
Registered: Feb 2004
Location: Manorville, New York, USA
Distribution: siduction, openSUSE Tumbleweed
Posts: 379
Rep:
|
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.
|
|
|
01-26-2010, 01:35 AM
|
#3
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,685
|
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 )
|
|
|
01-26-2010, 02:57 AM
|
#4
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
01-26-2010, 04:13 AM
|
#5
|
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,696
|
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
|
|
|
01-26-2010, 06:19 AM
|
#6
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
01-26-2010, 06:19 AM
|
#7
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
Hi ,
Thanks for replying, but FC9 doesn't have any /etc/modprobe.preload,so I can't get through the problem.
|
|
|
01-26-2010, 10:11 PM
|
#8
|
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,696
|
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
Last edited by GlennsPref; 01-26-2010 at 10:22 PM.
|
|
|
01-27-2010, 07:33 AM
|
#9
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
01-27-2010, 07:34 AM
|
#10
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
Hi,
I have written a programme in gcc
Quote:
Originally Posted by Gourab Das
#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.
|
|
|
|
01-27-2010, 07:35 AM
|
#11
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
Hi,
I have written a programme in gcc
Quote:
Originally Posted by Gourab Das
#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.
|
|
|
01-27-2010, 04:39 PM
|
#12
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,685
|
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 05:10 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|