I had previously done something like this for myself to put multiple distros on a USB drive.
As this script supports more distros than mine, I thought it best just to write a script to convert the generated multicd.iso onto my usb drive. Details are here
http://chris.picton.nom.za/?q=node/2
I have also patched the sysrcd and ubcd modules to keep all their files in their own subdirectories of the /boot subdirectory (to keep the USB drive clean), to put the System Rescue CD menu in a submenu by itself, and to add the version string of these to the menu
Finally, I have changed multicd.sh to accept .ima files (like the eb_on_hd.ima file), and Allow spaces in the names of image files: Etherboot Disk.ima to keep the menu looking nice
Let me know what you think of these patches...
Disk Image patch:
Code:
diff -uNr -x /images/ -x cd2usb.sh multicd.orig/multicd.sh multicd/multicd.sh
--- multicd.orig/multicd.sh 2010-03-07 06:07:43.000000000 +0200
+++ multicd/multicd.sh 2010-03-10 13:07:22.000000000 +0200
@@ -89,11 +89,11 @@
done
#END SCAN
-for i in $( ls -1 *.im[g,z] 2> /dev/null); do
- echo $(echo $i|sed 's/\.im.//')
+for i in *.im[agz]; do
+ echo "$i"|sed 's/\.im.//'
done
GAMES=0 #Will be changed if there are games
-for i in $( ls -1 games/*.im[g,z] 2> /dev/null ); do
+for i in games/*.im[agz]; do
echo Game: $(echo $i|sed 's/\.im.//'|sed 's/games\///')
GAMES=1
done
@@ -146,9 +146,9 @@
#The below chunk copies floppy images.
j="0"
-for i in $( ls -1 *.im[g,z] 2> /dev/null); do
+for i in *.im[agz]; do
echo -n Copying $(echo $i|sed 's/\.im.//')"... "
- cp $i multicd-working/boot/$j.img
+ cp "$i" multicd-working/boot/$j.img
if [ $VERBOSE = 1 ];then
echo "Saved as "$j".img."
else
@@ -161,7 +161,7 @@
if [ $GAMES = 1 ];then
k="0"
mkdir -p multicd-working/boot/games
- for i in $( ls -1 games/*.im[g,z] 2> /dev/null ); do
+ for i in games/*.im[agz]; do
echo -n Copying $(echo $i|sed 's/\.im.//'|sed 's/games\///')"... "
cp $i multicd-working/boot/games/$k.img
if [ $VERBOSE = 1 ];then
@@ -249,9 +249,9 @@
#BEGIN DISK IMAGE ENTRY#
j="0"
-for i in $( ls -1 *.im[g,z] 2> /dev/null); do
+for i in *.im[agz]; do
BASICNAME=$(echo $i|sed 's/\.im.//')
- echo label $BASICNAME >> multicd-working/boot/isolinux/isolinux.cfg
+ echo label "$BASICNAME" >> multicd-working/boot/isolinux/isolinux.cfg
echo kernel memdisk >> multicd-working/boot/isolinux/isolinux.cfg
echo append initrd=/boot/$j.img >> multicd-working/boot/isolinux/isolinux.cfg
j=$( expr $j + 1 )
System Rescue CD patch:
Code:
diff -uNr -x /images/ -x cd2usb.sh multicd.orig/plugins/sysrcd.sh multicd/plugins/sysrcd.sh
--- multicd.orig/plugins/sysrcd.sh 2010-01-03 23:00:02.000000000 +0200
+++ multicd/plugins/sysrcd.sh 2010-03-10 11:05:37.000000000 +0200
@@ -34,37 +34,58 @@
umount sysrcd
fi
mount -o loop sysrcd.iso sysrcd/
- cp sysrcd/sysrcd.* multicd-working/ #Compressed filesystem
mkdir multicd-working/boot/sysrcd
+ cp sysrcd/sysrcd.* multicd-working/boot/sysrcd/ #Compressed filesystem
cp sysrcd/isolinux/altker* multicd-working/boot/sysrcd/ #Kernels
cp sysrcd/isolinux/rescue* multicd-working/boot/sysrcd/ #Kernels
cp sysrcd/isolinux/initram.igz multicd-working/boot/sysrcd/initram.igz #Initrd
+ cp sysrcd/version multicd-working/boot/sysrcd/version
umount sysrcd
rmdir sysrcd
fi
elif [ $1 = writecfg ];then
if [ -f sysrcd.iso ];then
-cat >> multicd-working/boot/isolinux/isolinux.cfg << "EOF"
+VERSION=$(cat multicd-working/boot/sysrcd/version)
+cat >> multicd-working/boot/isolinux/isolinux.cfg << EOF
+label sysrcd
+menu label ---> ^System Rescue Cd ($VERSION)
+com32 menu.c32
+append sysrcd.cfg
+
+EOF
+
+cat > multicd-working/boot/isolinux/sysrcd.cfg << EOF
+menu title System Rescue CD
+
label rescuecd0
menu label ^SystemRescueCd 32-bit
kernel /boot/sysrcd/rescuecd
-append initrd=/boot/sysrcd/initram.igz
+append initrd=/boot/sysrcd/initram.igz subdir=/boot/sysrcd
+
label rescuecd1
menu label SystemRescueCd 64-bit
kernel /boot/sysrcd/rescue64
-append initrd=/boot/sysrcd/initram.igz
+append initrd=/boot/sysrcd/initram.igz subdir=/boot/sysrcd
+
label rescuecd2
menu label SystemRescueCd 32-bit (alternate kernel)
kernel /boot/sysrcd/altker32
-append initrd=/boot/sysrcd/initram.igz video=ofonly
+append initrd=/boot/sysrcd/initram.igz video=ofonly subdir=/boot/sysrcd
+
label rescuecd3
menu label SystemRescueCd 64-bit (alternate kernel)
kernel /boot/sysrcd/altker64
-append initrd=/boot/sysrcd/initram.igz video=ofonly
+append initrd=/boot/sysrcd/initram.igz video=ofonly subdir=/boot/sysrcd
+
label rescuecd-rootauto
menu label SysRCD: rescue installed Linux (root=auto; 32-bit)
kernel /boot/sysrcd/rescuecd
-append initrd=/boot/sysrcd/initram.igz root=auto
+append initrd=/boot/sysrcd/initram.igz root=auto subdir=/boot/sysrcd
+
+label back
+menu label Back to main menu
+com32 menu.c32
+append isolinux.cfg
EOF
fi
else
Ultimate Boot CD Patch
Code:
diff -uNr -x /images/ -x cd2usb.sh multicd.orig/plugins/ubcd.sh multicd/plugins/ubcd.sh
--- multicd.orig/plugins/ubcd.sh 2009-11-29 00:03:14.000000000 +0200
+++ multicd/plugins/ubcd.sh 2010-03-10 11:55:44.000000000 +0200
@@ -46,21 +46,28 @@
umount ubcd
fi
mount -o loop ubcd.iso ubcd/
- cp -r ubcd/dosapps multicd-working/
- cp -r ubcd/images multicd-working/
- cp -r ubcd/menus multicd-working/
- cp -r ubcd/boot/* multicd-working/boot/ #Some boot files needed for UBCD
+ mkdir -p multicd-working/boot/ubcd/
+ cp -r ubcd/dosapps multicd-working/boot/ubcd/
+ cp -r ubcd/images multicd-working/boot/ubcd/
+ cp -r ubcd/menus multicd-working/boot/ubcd/
+ sed -i 's^/boot/^/boot/ubcd/boot/^g' multicd-working/boot/ubcd/menus/*
+ sed -i 's^/menus/^/boot/ubcd/menus/^g' multicd-working/boot/ubcd/menus/*
+ sed -i 's^/images/^/boot/ubcd/images/^g' multicd-working/boot/ubcd/menus/*
+ cp -r ubcd/boot multicd-working/boot/ubcd/ #Some boot files needed for UBCD
cp ubcd/isolinux/sbm.cbt multicd-working/boot/isolinux/sbm.cbt #Smart Boot Manager
+ VERSION=$(head -n 1 ubcd/menus/defaults.cfg | awk '{ print $6 }')
+ echo "$VERSION" > multicd-working/boot/ubcd/version
umount ubcd
rmdir ubcd
fi
elif [ $1 = writecfg ];then
if [ -f ubcd.iso ];then
-cat >> multicd-working/boot/isolinux/isolinux.cfg << "EOF"
+VERSION=$(cat multicd-working/boot/ubcd/version)
+cat >> multicd-working/boot/isolinux/isolinux.cfg << EOF
label ubcd
-menu label ^Ultimate Boot CD - Main menu
+menu label ---> ^Ultimate Boot CD ($VERSION) - Main menu
com32 menu.c32
-append /menus/main.cfg
+append /boot/ubcd/menus/main.cfg
EOF
fi
else
Bookmarks