Pass an option to LILO in order to have a script/command executed at/after boot ?
Hi !
I have one distro installed, LILO as the boot loader, and i wonder if it's possible to duplicate the lilo entries with an option which executes some script or command during, or after the boot. Actually, i installed a Slackware + autolaunching virtual machine, but i have two VM, so i need to autolaunch one of them. May i choose it from the very beginning ? |
Not sure about other members, but I can't really understand what exactly the situation is here, nor quite what you're asking.
I see you have lots of posts, so I am guessing you're not *new* to Slackware and may already know what I'm going to post here: I will try to answer at least *one* question for you. To execute a command or script after boot (kinda during very late boot really) you could use the rc.local script in /etc/rc.d. Again, sorry if you already know this, but again, I really don't understand the question. Could you re-phrase it to better explain the relationships between the OSs and the VM's ? Cheers! Sasha |
I also thought the same, rc.local should do what you are looking for, if we are not misinterpreting.
|
Oops ! Should have been clearer !
I wanna know if lilo can lead to the execution of a command, like rc.local does. |
No.
But you can tell lilo which runlevel to boot at. So you could have three similar entries, but tell the first one to boot at runlevel 3 (console usually), the other at runlevel 5 (usually X), and the other at runlevel 4, for example, and use the 4th runlevel to launch the vm. It's a matter of adding the service or application to the given runlevel, that varies depending on your init system, and it can be more or less complicated depending on the app you want to run. You will need to find a way to ensure that everything that's needed to run the vm is already up, like X for example if needed. |
I just checked on the lilo.conf man pages to see if there might be somekind of optins but nope.
I dunno if I would go with the runlevel to chosse between the two vm's. I'd rather would go with rc.local. Idea. Copy the kernel twice and append -vm1 and -vm2 to the file name. Make two lilo entries and check in rc.local with uname -a which one is loaded and start vm according to it. There might be a chance that you could use init do do something like this..... |
Quote:
All you need to boot from one or another runlevel is to add the runlevel number to the kernel command line, a simple number. Then just add whatever command you use to run the vm to the right runlevel rc file instead of rc.local. Quote:
|
Quote:
You can use the -z option with an argument with init. Taken from the man pages the argument is ignored but ps will show it. So you can skim through ps or /proc/1/cmdline to make the decision. |
Quote:
|
Quote:
I like tricks like this. |
All times are GMT -5. The time now is 07:04 PM. |