Skip to contentSkip to conversation

fstab-sys: mount it in initramfs instead of newroot if mount point is not found

PATCH Applied Dave Young 2 participants 2 messages Jan 12, 2012 – Jan 13, 2012 1 message not in the archive

lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 fstab-sys: mount it in initramfs instead of newroot if mount point is not found

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 |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
modules.d/95fstab-sys/mount-sys.sh +6 -1
index a8fbd50..4de7285 100755
@@ -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
 }
Signature · 1 line
1.7.7.5
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 7 lines · Dave Young

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 |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

applied