diff --git a/target/bootdisk/build_stage1.sh b/target/bootdisk/build_stage1.sh index 3efbe1fa4..3b4cb959b 100644 --- a/target/bootdisk/build_stage1.sh +++ b/target/bootdisk/build_stage1.sh @@ -31,7 +31,7 @@ sed -i -e "s,^STAGE_2_BIG_IMAGE=\"2nd_stage.tar.gz\"$,STAGE_2_BIG_IMAGE=\"${ROCK linuxrc echo_status "Copy various helper applications." -for file in ../2nd_stage/bin/{tar,gzip,bash2,bash,sh,mount,umount,ls,cat,uname,rm,ln,mkdir,rmdir,gawk,awk,grep} \ +for file in ../2nd_stage/bin/{tar,gzip,bash2,bash,sh,mount,umount,ls,cat,uname,rm,ln,mkdir,rmdir,gawk,awk,grep,sleep} \ ../2nd_stage/sbin/{ip,hwscan,pivot_root,swapon,swapoff,udevstart} \ ../2nd_stage/usr/bin/{wget,find,expand,readlink} \ ../2nd_stage/usr/sbin/lspci ; do diff --git a/target/bootdisk/linuxrc.sh b/target/bootdisk/linuxrc.sh index 5d1753b9f..8e920488c 100644 --- a/target/bootdisk/linuxrc.sh +++ b/target/bootdisk/linuxrc.sh @@ -177,6 +177,19 @@ EOF return } # }}} getdevice () { # {{{ + while : ; do + echo -en "\nDevice file to use (q to return) : "; + read device; + [ "${device}" == "q" ] && return -1; + if [ ! -e "${device}" ] ; then + echo -e "\nNot a valid device!" + else + devicefile=${device} + return 0; + fi + done +} # }}} +getcdromdevice () { # {{{ cdroms="${1}" floppies="${2}" autoboot="${3}" @@ -243,11 +256,16 @@ getdevice () { # {{{ return 1; } # }}} load_ramdisk_file() { # {{{ - autoboot=${1} + devicetype=${1} + autoboot=${2} echo -en "Select a device for loading the 2nd stage system from: \n\n" - getdevice 1 1 ${autoboot} || return + if [ "${devicetype}" == "cdroms" ] ; then + getcdromdevice 1 1 ${autoboot} || return + else + getdevice || return + fi cat << EOF Select a stage 2 image file: @@ -369,7 +387,7 @@ exec_sh() { # {{{ checkisomd5() { # {{{ echo "Select a device for checking: " - getdevice 1 0 0 || return + getcdromdevice 1 0 0 || return echo "Running check..." /bin/checkisomd5 ${devicefile} @@ -386,6 +404,7 @@ mount -t ramfs none /dev || echo "Can't mount a ramfs on /dev" mount -t sysfs none /sys || echo "Can't mount sysfs on /sys" mount -t proc none /proc || echo "Can't mount /proc" mount -t tmpfs -o ${TMPFS_OPTIONS} none /tmp || echo "Can't mount /tmpfs" + udevstart cd /dev rm -rf fd @@ -394,6 +413,12 @@ cd - mod_load_info autoload_modules + +# some devices (scsi...) need time to settle... +echo "Waiting for devices to settle..." +sleep 5 +udevstart + if [ ${autoboot} -eq 1 ] ; then load_ramdisk_file 1 fi @@ -411,14 +436,15 @@ drivers (if needed) and configure the installation source so the EOF while [ ${exit_linuxrc} -eq 0 ] ; do cat <