From: <smi...@us...> - 2004-01-08 01:09:51
|
Update of /cvsroot/devil-linux/build/config/etc/initrd In directory sc8-pr-cvs1:/tmp/cvs-serv7932/config/etc/initrd Modified Files: linuxrc Log Message: init system now first searches all devices for configuration and then for empty medias (Heiko + Tim Tait) Index: linuxrc =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/initrd/linuxrc,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- linuxrc 23 Dec 2003 16:05:33 -0000 1.52 +++ linuxrc 8 Jan 2004 01:09:48 -0000 1.53 @@ -76,7 +76,7 @@ PARTITIONS_IDE=`find /dev/ide/ -name "part*" 2> /dev/null` PARTITIONS_SCSI=`find /dev/scsi/ -name "part*" 2> /dev/null` FLOPPIES=`find /dev/floppy/ -name "?" 2> /dev/null` -CONFIG_SRC_LIST="$CDROM_IDE $CDROM_SCSI $PARTITIONS_SCSI $PARTITIONS_IDE $FLOPPIES" +CONFIG_SRC_LIST="$PARTITIONS_SCSI $PARTITIONS_IDE $CDROM_IDE $CDROM_SCSI $FLOPPIES" DL_CONFIG_SOURCE="" echo -e "Loading loop-AES module"; @@ -89,7 +89,7 @@ until [ -e /floppy/etc.tar.bz2 ] ; do for CFG_SRC in $CONFIG_SRC_LIST do - echo -e "Checking $CFG_SRC" + echo -e "Checking for configuration on $CFG_SRC" if mount -n -t auto $CFG_SRC /floppy >/dev/null 2>&1 ; then if [ -e /floppy/etc.tar.bz2 ] ; then @@ -100,43 +100,44 @@ continue 2 else umount /floppy # in case user swaps floppy when we are accepting input - # offer to copy the configuration file if device is not a CD - if [ ! "${CFG_SRC##/*/}" = "cd" ];then - beep; - $YELLOW - echo -e "\n*** Found empty configuration media. ***" - $NORMAL - echo -n "Should I copy default configuration to it?" + fi + fi + done + + # first pass looks for existing configuration, 2nd pass will create if none found + for CFG_SRC in $CONFIG_SRC_LIST + do + echo -e "Looking for empty configuation media on $CFG_SRC" + if mount -n -t auto $CFG_SRC /floppy >/dev/null 2>&1 ; then + # offer to copy the configuration file if device is not a CD + if [ ! "${CFG_SRC##/*/}" = "cd" ];then + umount /floppy # in case user swaps floppy when we are accepting input + beep; + $YELLOW + echo -e "\n*** Found empty configuration media. ***" + $NORMAL + echo -n "Should I copy default configuration to it?" + if ask_yes_no ; then + echo -n "Would you like to probe for SCSI controllers now?" if ask_yes_no ; then - echo -n "Would you like to probe for SCSI controllers now?" - if ask_yes_no ; then - /probe_all_scsi_modules - fi - if ! /mount_cdrom /cdrom noreboot ; then - $RED - echo -e "Cannot find CD drive - try probing for SCSI controllers" - $NORMAL - continue - fi - mount -n -t auto $CFG_SRC /floppy >/dev/null 2>&1 || continue - cp -i /cdrom/config/etc.tar.bz2 /floppy/ || continue - DL_CONFIG_SOURCE=$CFG_SRC - continue 2 + /probe_all_scsi_modules + fi + if ! /mount_cdrom /cdrom noreboot ; then + $RED + echo -e "Cannot find CD drive - try probing for SCSI controllers" + $NORMAL + continue fi + mount -n -t auto $CFG_SRC /floppy >/dev/null 2>&1 || continue + cp -i /cdrom/config/etc.tar.bz2 /floppy/ || continue + umount /cdrom + DL_CONFIG_SOURCE=$CFG_SRC + continue 2 fi fi fi done - if /mount_cdrom /floppy noreboot silent ; then - if [ -f /floppy/etc.tar.bz2 ]; then - $YELLOW - echo "Using custom configuration on CDROM." - $NORMAL - break - fi - umount /floppy - fi - #[ -n "$DL_CONFIG_SOURCE" ] && continue + beep; sleep 1; beep; sleep 1; beep; $RED echo -e "Please insert Configuration Media and press 'ENTER'" @@ -208,3 +209,4 @@ echo 'Please mail a bug report to bu...@de...' echo exit + |