Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
After USB boot, detect which device the ramfs was loaded from. Bash or Python
I have a RIPLinux/Tinycore live USB disk that automatically needs to run a script that is stored on the same USB drive but not part of the RIPLinux/Tinycore image. (Please note that I do not want to put this script into the RIPLinux image.) I therefore would like to remix the RIPLinux/Tinycore ISO to automatically run this script once it has started up. After RIP linux has booted I would like to automatically mount the USB drive that RIPLinux/Tinycore was booted from. I need help detecting which device this is.
Thanks in advance
Last edited by RobertF; 09-22-2010 at 08:31 AM.
So far my best solution is mounting each existing device and looking for the install script. If not found, then move on to the next device.
Any better suggestions?
Ok... Disk labels might work. Duh (hopefully)
Right on gentoo, to create a labeled fat32 USB disk use sys-fs/mtools (install: #emerge mtools)
To label the partition on the USB disk use command:
#mlabel -i /dev/partition ::my_label
Where partition is the partition name ie. sda1, hda1 etc that you want to label and my_label is the label you want to use for the partition.
Now to mount the partition using the label instead of the device name use the following command:
#mount /dev/disk/by-label/my_label /mnt/my_mountpoint
Sorted, Problem solved. Please let me know if there is a better way of doing this.