[LC++]Appending to a file from Makefile

Jack Lloyd lloyd at acm.jhu.edu
Wed Jul 21 21:31:01 UTC 2004

Append: echo your_line_here >> path_to_rc_local

To remove the line, use something like sed or grep. But consider what happens
if someone does 'make install' 10 times in a row.

Generally I'd say this is not something you want to do. If a sysadmin is
installing a kernel mod and they're not capable of setting it up to install
automatically (assuming, of course, that's what they want in the first place),
they probably shouldn't be installing kernel mods from external sources.

Also, some distros have specific places to do kernel loading (Gentoo has a file
in /etc/modules.autoload.d/ that lists all modules that should be loaded at
boot time). Anything you do in rc.local is not going to be the normal way the
module is loaded on the system.


On Tue, Jul 20, 2004 at 01:50:55PM -0700, Krishna Monian wrote:
> Hi, 
> I have a makefile for a kernel module. I have added an
> install option that basically installs the kernel
> module. However I want to append something to the
> rc.local file through the Makefile so that the entire
> process is automated.
> How do I append a few lines to a file? Also is it
> possible to remove a few lines from the file so that I
> can do this in the uninstall option.
> Thanks
> Krishna Monian
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> _______________________________________________
> This is the Linux C++ Programming List
> : http://lists.linux.org.au/listinfo/tuxcpprogramming List

More information about the tuxCPProgramming mailing list