[Buildroot] [PATCH v2] skeleton: Have a portable remount RW/RO
Luca Ceresoli
luca at lucaceresoli.net
Wed Oct 7 22:03:42 UTC 2015
Dear Maxime,
sorry for having kind of endorsed this patch in its v1, but now I
tested it and it seems flawed in its very core (unless I'm still drunk).
Maxime Hadjinlian wrote:
> With systemd, inittab is useless, but it's also where we stored a 'mount
> -o remount ...' to toggle the rootfs ro/rw at the demand of the user.
>
> Instead, doing a simple 'mount -a -o remount' should change the flag of
> every mountpoint by reading /etc/fstab.
Maybe it should, but it doesn't:
# cat /etc/fstab
# <file system> <mount pt> <type> <options> <dump> <pass>
/dev/root / ext2 rw,noauto 0 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts defaults,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
tmpfs /tmp tmpfs mode=1777 0 0
tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
# mount
/dev/root on / type ext2 (ro,relatime,errors=remount-ro)
devtmpfs on /dev type devtmpfs
(rw,relatime,size=62812k,nr_inodes=15703,mode=755)
proc on /proc type proc (rw,relatime)
# /bin/mount -a -o remount
# mount
/dev/root on / type ext2 (ro,relatime,errors=remount-ro)
devtmpfs on /dev type devtmpfs
(rw,relatime,size=62812k,nr_inodes=15703,mode=755)
proc on /proc type proc (rw,relatime)
#
It's still mounted ro. Removing the noauto for /dev/root/ does not
change the result.
This is using the default mount from busybox on
qemu_arm_versatile_defconfig with an external toolchain. Wild guess: are
you using the full-featured mount command from util-linux? Or maybe
systemd ships it own mount command with this feature?
--
Luca
More information about the buildroot
mailing list