]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fstab-sys: mount it in initramfs instead of newroot if mount point is not found
authorDave Young <dyoung@redhat.com>
Thu, 12 Jan 2012 08:00:31 +0000 (16:00 +0800)
committerHarald Hoyer <harald@redhat.com>
Fri, 13 Jan 2012 10:50:53 +0000 (11:50 +0100)
fstab-sys now also handles device passed by dracut argument "--mount"
The "--mount" mount point is possible not exist in $NEWROOT. Thus mount it
in initramfs if mount point is not exist in real rootfs

modules.d/95fstab-sys/mount-sys.sh

index a8fbd50b20bc4b4967251e85afeb4cf11631436a..4de72859fc98be63377e3b63215c1db6b5a7b656 100755 (executable)
@@ -20,7 +20,12 @@ fstab_mount() {
         fi
         _fs=$(det_fs "$_dev" "$_fs")
         info "Mounting $_dev"
-        mount -v -t $_fs -o $_opts $_dev $NEWROOT/$_mp 2>&1 | vinfo
+        if [[ -d $NEWROOT/$_mp ]]; then
+            mount -v -t $_fs -o $_opts $_dev $NEWROOT/$_mp 2>&1 | vinfo
+        else
+            mkdir -p "$_mp"
+            mount -v -t $_fs -o $_opts $_dev $_mp 2>&1 | vinfo
+        fi
     done < $1
     return 0
 }