diff --git a/package/base/rockinitrd/init b/package/base/rockinitrd/init index 541c8aa2c..4ced518cb 100644 --- a/package/base/rockinitrd/init +++ b/package/base/rockinitrd/init @@ -58,10 +58,12 @@ echo "" > /proc/sys/kernel/hotplug if [ -n "${real_root}" ] ; then rootfs=${real_root} else - while read dev mntpoint fstype options fsck1 fsck2 ; do - [ "${mntpoint}" == "/" ] && rootfs=${dev} - [ -n "${rootfs}" ] && break - done < /etc/fstab + if [ -f /etc/fstab ] ; then + while read dev mntpoint fstype options fsck1 fsck2 ; do + [ "${mntpoint}" == "/" ] && rootfs=${dev} + [ -n "${rootfs}" ] && break + done < /etc/fstab + fi fi echo "loading kernel modules" diff --git a/target/bootdisk/build_stage1.sh b/target/bootdisk/build_stage1.sh index 265a03185..f90876b52 100644 --- a/target/bootdisk/build_stage1.sh +++ b/target/bootdisk/build_stage1.sh @@ -5,6 +5,9 @@ rm -rf $disksdir/initrd mkdir -p $disksdir/initrd/{dev,proc,sys,tmp,scsi,net,bin,etc,lib} cd $disksdir/initrd; ln -s bin sbin; ln -s . usr +# make mount not complain +touch etc/fstab + rock_targetdir="$base/target/$target/" rock_target="$target" diff --git a/target/bootdisk/linuxrc.sh b/target/bootdisk/linuxrc.sh index 96bde8d78..6535d5503 100644 --- a/target/bootdisk/linuxrc.sh +++ b/target/bootdisk/linuxrc.sh @@ -258,11 +258,13 @@ getcdromdevice () { # {{{ load_ramdisk_file() { # {{{ devicetype=${1} autoboot=${2} + mountopts="" echo -en "Select a device for loading the 2nd stage system from: \n\n" if [ "${devicetype}" == "cdroms" ] ; then getcdromdevice 1 1 ${autoboot} || return + mountopts="-o ro" else getdevice || return fi @@ -300,7 +302,7 @@ EOF exit_linuxrc=0 fi - if ! mount ${devicefile} "/mnt_source" ; then + if ! mount ${mountopts} ${devicefile} "/mnt_source" ; then echo "Can't mount /mnt_source" exit_linuxrc=0 fi