From 8f6f01e8c4c30a248dbdf3ed3f53a7190d3af7a5 Mon Sep 17 00:00:00 2001 From: fake Date: Wed, 26 Jul 2006 15:42:05 +0000 Subject: [PATCH] fake: fix bootdisk wrt. complaining about missing fstab and the cdrom being read-only. [2006072617000712020] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@7768 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/rockinitrd/init | 10 ++++++---- target/bootdisk/build_stage1.sh | 3 +++ target/bootdisk/linuxrc.sh | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) 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