Update of /cvsroot/devil-linux/build/scripts/scripts
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20087
Modified Files:
install-on-usb
Log Message:
- added squashfs image installation
Index: install-on-usb
===================================================================
RCS file: /cvsroot/devil-linux/build/scripts/scripts/install-on-usb,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- install-on-usb 7 Oct 2008 19:16:47 -0000 1.28
+++ install-on-usb 29 Jan 2009 01:11:31 -0000 1.29
@@ -47,7 +47,7 @@
nice cp $PRESERVE $1 $2 || return 1
return 0
else
- echo "$1 is not a valid source for the ISO"
+ echo "$1 is not a valid source for the DL image"
return 1
fi
}
@@ -242,7 +242,7 @@
mkdir -p $TMPDIR/etc-for-mods || return 1
echo
- read -p "Enter DL ISO source (disk file or CD device) -> " DLISO
+ read -p "Enter DL source (DL image file or CD device) -> " DLISO
if [ -L "$DLISO" ]; then
DLISO=$(readlink -fns $DLISO)
@@ -256,11 +256,22 @@
if [ -b "$DLISO" ]; then
mount -t iso9660 -o ro $DLISO $TMPDIR/iso-mnt || return 1
else
- mount -o loop,ro -t iso9660 $DLISO $TMPDIR/iso-mnt || return 1
+ mount -o loop,ro -t auto $DLISO $TMPDIR/iso-mnt || return 1
+
+ IMAGEFS="$(cat /proc/mounts | grep 'install2usb/iso-mnt' | cut -f3 -d' ')"
+ if [ "x$IMAGEFS" = "xsquashfs" ]; then
+ IMAGE="bootcd.squash"
+ elif [ "x$IMAGEFS" = "xiso9660" ]; then
+ IMAGE="bootcd.iso"
+ else
+ echo "Unsupported image format: $IMAGEFS"
+ return 1
+ fi
fi
+
if [ -f "$TMPDIR/iso-mnt/DEVIL-LINUX" ]; then
dl_version=`cat $TMPDIR/iso-mnt/DEVIL-LINUX`
- echo " Devil Linux $dl_version found in ISO"
+ echo " Devil Linux $dl_version found in Image"
else
echo
echo "$DLISO does not seem to contain Devil-Linux!"
@@ -287,7 +298,7 @@
ask_yes_no && $FDISK $DEVICE
echo
- read -p "Enter PARTITION name of disk device to put ISO file (i.e. /dev/sda1) -> " PARTITION
+ read -p "Enter PARTITION name of disk device to put Image file (i.e. /dev/sda1) -> " PARTITION
if [ -L "$PARTITION" ]; then
PARTITION=$(readlink -fns $PARTITION)
@@ -379,7 +390,7 @@
cp $TMPDIR/iso-mnt/{DEVIL-LINUX,LICENSE} $TMPDIR/disk-mnt/ &> /dev/null || return 1
cat $TMPDIR/iso-mnt/isolinux.cfg | sed -e s%"/boot/"%""% > $TMPDIR/disk-mnt/syslinux.cfg || return 1
cat $TMPDIR/iso-mnt/boot/message | sed -e s%"/boot/"%""% > $TMPDIR/disk-mnt/message || return 1
- copy_iso_file $DLISO $TMPDIR/disk-mnt/bootcd.iso not_save_permissions || return 1
+ copy_iso_file $DLISO $TMPDIR/disk-mnt/$IMAGE not_save_permissions || return 1
if [ "$SERIAL_CONSOLE" = "true" ]; then
cp -a $TMPDIR/disk-mnt/syslinux.cfg $TMPDIR/syslinux.cfg && (echo "serial 0 $SERIALSPEED" > $TMPDIR/disk-mnt/syslinux.cfg && cat $TMPDIR/syslinux.cfg | sed -e s/"append"/"append console=tty0 console=ttyS0,$SERIALSPEED"/g >> $TMPDIR/disk-mnt/syslinux.cfg ) || ( echo "Unable to modify syslinux.cfg file"; return 1 )
@@ -399,7 +410,7 @@
echo "copying files"
cp -a $TMPDIR/iso-mnt/boot/ $TMPDIR/disk-mnt/ > /dev/null || return 1
cp -p $TMPDIR/iso-mnt/{DEVIL-LINUX,LICENSE} $TMPDIR/disk-mnt/ > /dev/null || return 1
- copy_iso_file $DLISO $TMPDIR/disk-mnt/bootcd.iso || return 1
+ copy_iso_file $DLISO $TMPDIR/disk-mnt/$IMAGE || return 1
if [ -f "/DEVIL-LINUX" ]; then
echo;echo -n "Would you like to modify initrd image (it's mandatory if you have chosen not ext2 fs)?"
|