Execute different commands at startup
Hi everyone,
I'd like to know if it's possible to run different commands at startup, choosing them through GRUB. I mean, I'd like to have a GRUB entry like "Kubuntu - Normal Boot" and another one "Kubuntu - MythTV". I'd like "Kubuntu - MythTV" not to launch kdm but just mythtv and another command, which I need to enable bluetooth remote controlling. I thought I could set up a different runlevel to do so, but it seems a bit complicated. How can I do that? |
Check if Ubuntu supports scpm.
|
It dosn't seem to, as I can't find anything like scpm in the packets.
|
I found this howto posted on one the Ubuntu forum.
http://ubuntuforums.org/showthread.php?t=296808 Another option is to have a variable defined in the "kernel " line of the menu.lst stanza. I think I remember that options not recognized are defined in the environment of the INIT program. Scripts started subsequently may have that variable defined in their environment which could allow for conditional execution in scripts at boot time. I'm not 100% certain. I think there is a howto in the www.tldp.org website on grub or lilo that may verify this, but I wasn't able to find this info scanning the "kernel-parameters.txt" file in the kernel source. |
Quote:
Quote:
|
Maybe reading /proc/cmdline from a script and acting accordingly?
|
Great idea! Thank you!
I'm working on that. |
It worked!
I added a new OS in /boot/grub/menu.lst with the 'elisa' parameter, then I put this script in /etc/init.d/ and made a symlink in /etc/rc2.d/ (Ubuntu's default runlevel) Code:
#!/bin/bash Hope this helps someone. |
All times are GMT -5. The time now is 04:16 PM. |