LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   Run shell script direct from isolinux boot menu (https://www.linuxquestions.org/questions/linux-distributions-5/run-shell-script-direct-from-isolinux-boot-menu-4175486566/)

ThreeNine 12-02-2013 11:18 AM

Run shell script direct from isolinux boot menu
 
Hi all, I got my script working (many thanks to druuna) and now I need a little help to implement it.

I've been reading through this article:
https://www.phenix.bnl.gov/~purschke/RescueCD/
And I think what I want to do is add an option in the boot menu (isolinux.cfg) to run my script, rather than startup a new kernel. Here is the functions I need for my script to run successfully:
Code:

trap
clear
echo
eject
reboot
sleep
cp
fdisk
df
cd

Also I will need to mount all the accessible hard drives. Either automount, or some custom mount script that runs when called.

Let me know what you think. Thank you!

zhjim 12-03-2013 05:27 AM

You would use the kernel boot option init= for this. Normally set to /sbin/init its the first command thats run when the sytem booted and the initramfs was mounted. So you would need a working kernel, a working ramfs and a script that does what you want.

How to automount every device is an art of it self. Due to various different options for device usage. You could have two disks with say 3 partitions. But this could also be a raid setup. So do you mount them as single drivers or as the raid device. Also the lvm stuff is there. Not speaking of fake raid cards with dmraid. So this is something to tinker. Might be that someone has some decent stuff for this allready going. I'd say your best shoot for this would be some install cds and see how they do it. Also the trinity rescue cd has an mount all command. Might want to check it out as well.


All times are GMT -5. The time now is 02:22 PM.