[Buildroot] [PATCH v2] skeleton: Have a portable remount RW/RO

Maxime Hadjinlian maxime.hadjinlian at gmail.com
Thu Oct 8 08:12:11 UTC 2015


Hi Luca,

On Thu, Oct 8, 2015 at 12:03 AM, Luca Ceresoli <luca at lucaceresoli.net>
wrote:

> 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?
>
I'll test this on my side, I remember it worked (I created this patch
during the Buildroot Summer Camp and had not sent it yet, but I clearly
remember having testing it), as you said, maybe I was util the full blown
mount, I'll test and respin. I'll mark this as "Changes Requested" for the
moment.


>
>
> --
> Luca
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151008/9b9602b6/attachment-0002.html>


More information about the buildroot mailing list