Hi all.... I've got 3 kernels on my system, "A B C". I want to start different programs running according to which kernel I boot. What I whould like to happen is in boot.local (or where-ever) it say "if kernal A run X, if kernel B run Y". Is there anyway to do this? BTW I'm running SuSE 7.1...... TIA! -- Jim Hatridge Proud Linux User #88484 Owner -- beowulf-newbie list I didn't vote for his daddy either! Libertarian Party www.lp.org "If someone has a gun and is trying to kill you, it would be reasonable to shoot back with your own gun." ~~ The Dalai Lama, May 15, 2001 ------------------------------------------------------- BayerWulf Jim's Beowulf Project Looking for giveaway computers and parts Email Jim for details on how you can help build a poor man's super computer.
You could grep on the output of uname -a uname -a Linux caliban 2.4.4 #7 Fri Jun 8 15:26:26 CEST 2001 i686 unknown for example: if echo `uname -a` |grep "#7" >/dev/null then\ run X elif echo `uname a` |grep "#8" >/dev/null then\ run Y else run Z fi (hope there are no syntax errors in here) But this is kinda ugly. If you rcompile a kernel, the number changes and you have to change the script. There might be a better way. hth,
From James Jim Hatridge to SuSE Mailing List about [SLE] Kernel & boot...:
Hi all....
I've got 3 kernels on my system, "A B C". I want to start different programs running according to which kernel I boot. What I whould like to happen is in boot.local (or where-ever) it say "if kernal A run X, if kernel B run Y". Is there anyway to do this?
BTW I'm running SuSE 7.1......
TIA!
-- dieter
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday 09 June 2001 08:41, James "Jim" Hatridge babbled:
Hi all....
I've got 3 kernels on my system, "A B C". I want to start different programs running according to which kernel I boot. What I whould like to happen is in boot.local (or where-ever) it say "if kernal A run X, if kernel B run Y". Is there anyway to do this?
BTW I'm running SuSE 7.1......
TIA!
use 'uname -v' and not 'uname -a' . it will return 2.2.19 or 2.4.5 or whatever. a lot easier to parse. For example, in my rc.local: if [ "`uname -v|cut -d\. -f2`" -gt 2 ] # do 2.4.x stuff else # do 2.2.x stuff fi - -- Douglas J. Hunley (Linux User #174778) http://hunley.homeip.net/ http://linux.nf/ HELO my name is sendmail.cf. You SIGKILLed my shell. Prepare to vi. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjsiWT8ACgkQOPP+k4ZeTm17VACgpBdgPiERByBRdPCUtgO5jtQT pI0An34MZBJySYgNEr6LOc00FEKk3w50 =szKJ -----END PGP SIGNATURE-----
"Douglas J. Hunley" wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Saturday 09 June 2001 08:41, James "Jim" Hatridge babbled:
Hi all....
I've got 3 kernels on my system, "A B C". I want to start different programs running according to which kernel I boot. What I whould like to happen is in boot.local (or where-ever) it say "if kernal A run X, if kernel B run Y". Is there anyway to do this?
BTW I'm running SuSE 7.1......
TIA!
use 'uname -v' and not 'uname -a' . it will return 2.2.19 or 2.4.5 or whatever. a lot easier to parse. For example, in my rc.local: if [ "`uname -v|cut -d\. -f2`" -gt 2 ] # do 2.4.x stuff else # do 2.2.x stuff fi
- --
What if all the kernels are 2.4.4 just different?? Don't know if thats the case but if it is then the first suggestion might work but again the # would change after any rebuild of it. There are extra version stuff in the TOP makefile of the kernel you could then use that to differenciate between the kernels. Just a thought because I've had to do something simalar. -- Mark Hounschell dmarkh@cfl.rr.com
participants (4)
-
dieter
-
Douglas J. Hunley
-
James Jim Hatridge
-
Mark Hounschell