Skip to contentSkip to conversation

Allow fstab-based remount to be controlled by modules

PATCH In review Daniel Drake 2 participants 3 messages Nov 8, 2010 – Nov 10, 2010 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow fstab-based remount to be controlled by modules

OLPC would like to be able to disable this behaviour through a custom dracut module. Add a "no_fstab_remount" flag which can be set by modules that want to disable this functionality.

(Background: having the correct rootfs info in /etc/fstab is a bit of a
challenge for OLPC, because this info is not known at build time.)

---
 modules.d/95rootfs-block/mount-root.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
modules.d/95rootfs-block/mount-root.sh +1 -0
index ff64209..7602731 100755
@@ -73,6 +73,7 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
     rootopts=
     if getargbool 1 rd.fstab -n rd_NO_FSTAB \
         && ! getarg rootflags \
+        && [ -z "$no_fstab_remount" ] \
         && [ -f "$NEWROOT/etc/fstab" ] \
         && ! [ -L "$NEWROOT/etc/fstab" ]; then
         # if $NEWROOT/etc/fstab contains special mount options for 
Signature · 1 line
1.7.3.2

A message that is not in the archive (sent off-list or not yet received): 20101108194128.EBFEB9D401B-k/[email protected]

#2 lore raw
Quoted 15 lines · Daniel Drake

OLPC would like to be able to disable this behaviour through a custom dracut module. Add a "no_fstab_remount" flag which can be set by modules that want to disable this functionality.

(Background: having the correct rootfs info in /etc/fstab is a bit of a
challenge for OLPC, because this info is not known at build time.)

---
  modules.d/95rootfs-block/mount-root.sh |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
modules.d/95rootfs-block/mount-root.sh +0 -0
index ff64209..7602731 100755

modules.d/95rootfs-block/mount-root.sh if [ -n "$root" -a -z "${root%%block:*}" ]; then · line 79

Quoted 7 lines
modules.d/95rootfs-block/mount-root.sh +1 -0
@@ -73,6 +73,7 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
      rootopts=
      if getargbool 1 rd.fstab -n rd_NO_FSTAB \
          &&  ! getarg rootflags \
+&&  [ -z "$no_fstab_remount" ] \
          &&  [ -f "$NEWROOT/etc/fstab" ] \
          &&  ! [ -L "$NEWROOT/etc/fstab" ]; then
          # if $NEWROOT/etc/fstab contains special mount options for

Why don't you reuse rd.fstab then? You could add preset kernel cmdline options in /etc/cmdline in the initramfs.

Just add for your dracut module in install:

mkdir -p ${initdir}/etc
echo " rd.fstab=0 " >> ${initdir}/etc/cmdline

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 4 lines · Harald Hoyer

Just add for your dracut module in install:

mkdir -p ${initdir}/etc
echo " rd.fstab=0 " >> ${initdir}/etc/cmdline

Thanks!
Wasn't aware that you could do this. It was exactly what I was looking for, no patch needed.

Daniel