From: Friedrich L. <fr...@us...> - 2006-05-16 03:07:13
|
Update of /cvsroot/devil-linux/build/config/etc/initrd In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17187 Modified Files: Tag: rel-1-2-patches linuxrc mount_cdrom Log Message: cleanups and generalize interface of mount_cdrom to prepare for further extensions Index: linuxrc =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/initrd/linuxrc,v retrieving revision 1.70.2.10 retrieving revision 1.70.2.11 diff -u -d -r1.70.2.10 -r1.70.2.11 --- linuxrc 4 May 2006 12:18:21 -0000 1.70.2.10 +++ linuxrc 16 May 2006 03:07:01 -0000 1.70.2.11 @@ -250,7 +250,7 @@ if ask_yes_no ; then /probe_all_scsi_modules fi - if ! /mount_cdrom /cdrom noreboot ; then + if ! /mount_cdrom /cdrom -noreboot ; then $RED echo -e "Cannot find CD drive - try probing for SCSI controllers" $NORMAL @@ -293,17 +293,6 @@ mkdir -p /shm/root -# check if the DL ISO got upgraded -if [ -e /shm/dl_iso_replaced ]; then - cd /cdrom - #change to new root - pivot_root . initrd - $RED - echo "Rebooting..." - $NORMAL - exec /usr/sbin/chroot . /sbin/reboot -f -fi - echo "loading configuration" if [ "$REALLY_LIVE" = "1" ] ; then # check to see if cdrom has already been mounted Index: mount_cdrom =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/initrd/mount_cdrom,v retrieving revision 1.25.2.12 retrieving revision 1.25.2.13 diff -u -d -r1.25.2.12 -r1.25.2.13 --- mount_cdrom 3 May 2006 18:15:43 -0000 1.25.2.12 +++ mount_cdrom 16 May 2006 03:07:01 -0000 1.25.2.13 @@ -7,11 +7,30 @@ # # http://www.devil-linux.org # +#------------------------------------ +# usage: mount_cdrom [-silent] [-noreboot] mountpoint +# -silent reduce output to minimum +# -noreboot return error instead of halting on error +# # include our color definitions . colordefs -if [ "$3" != "silent" ]; then +# parse command line options +mountpoint="" # where the cdrom/iso gets mounted +silent="" # empty = notsilent +noreboot="" # empty = reboot on error +while [ $# -gt 0 ]; do + case "$1" in + -silent ) silent=1;; + -noreboot ) noreboot=1;; + * ) [ -z "$mountpoint" ] && mountpoint="$1";; + esac + shift +done + + +if [ ! $silent ]; then $GREEN echo "Searching for Devil-Linux CD-ROM" $NORMAL @@ -33,7 +52,7 @@ fi -if [ "$3" != "silent" ]; then +if [ ! $silent ]; then $GREEN echo "Search list: $CDROMS" $NORMAL @@ -41,12 +60,12 @@ for disk in $CDROMS do - echo -n "checking $disk " - if mount -n -t iso9660 -o ro $disk $1 2> /dev/null; then - if [ -e $1/DEVIL-LINUX ] ; then - if [ "$3" != "silent" ]; then + echo -n "checking $disk..." + if mount -n -t iso9660 -o ro $disk ${mountpoint} 2> /dev/null; then + if [ -e ${mountpoint}/DEVIL-LINUX ] ; then + if [ ! $silent ]; then $YELLOW - echo -e "Found on $disk" + echo "found" $NORMAL fi echo $disk > /shm/DL_DEVICE @@ -55,7 +74,7 @@ $YELLOW echo "wrong media" $NORMAL - umount $1 + umount ${mountpoint} fi else $RED @@ -98,8 +117,6 @@ $RED rm -f /mnt/bootcd.iso &> /dev/null if mv /mnt/bootcd.iso.new /mnt/bootcd.iso ; then - # create flag file, so the other scripts know about it - touch /shm/dl_iso_replaced $BLUE echo "Upgrading System Boot Files" $NORMAL @@ -115,8 +132,7 @@ #$GREEN #echo "Mounting old version" #$NORMAL - mount -o loop -t iso9660 /mnt/bootcd.iso.old $1 || return 1 - # check if the DL ISO got upgraded + mount -o loop -t iso9660 /mnt/bootcd.iso.old ${mountpoint} || return 1 cd /cdrom #change to new root pivot_root . initrd @@ -138,10 +154,10 @@ # because bootcd.iso is still mounted inside it. # RO will make it less painfull. mount -o remount,ro,noatime $disk 2> /dev/null - mount -o loop -t iso9660 /mnt/bootcd.iso $1 || return 1 + mount -o loop -t iso9660 /mnt/bootcd.iso ${mountpoint} || return 1 echo $disk > /shm/DL_DEVICE dl_version=`cat /mnt/DEVIL-LINUX 2> /dev/null` - if [ "$3" != "silent" ]; then + if [ ! $silent ]; then $YELLOW echo -e "\nFound ISO ($dl_version) on $disk" $NORMAL @@ -162,13 +178,13 @@ done -if [ "$3" != "silent" ]; then +if [ ! $silent ]; then $RED echo "!!! Devil-Linux CD-ROM not found !!!" $NORMAL fi -[ "$2" = "noreboot" ] && exit 1 +[ $noreboot ] && exit 1 $RED echo |