init.d/root: also remount / with options provided in /etc/fstab

Without this commit, the root OpenRC service remounts all mounted
filesystems (except /) with the options defined in /etc/fstab via
fstabinfo. It is presently unclear to me why / was excluded from
remounting in 497ff7ee41 and unfortunately
neither the commit nor the associated Bugzilla issue [1] provides
further information on this.

At Alpine, our initramfs does currently not remount / with all options
defined in /etc/fstab [2]. As part of the discussion on the Alpine side
of things we wondered why OpenRC does not remount / since this would be
the easier solution for us. For this reason, this commit changes the
behavior of the OpenRC root services accordingly to also remount / with
the options defined in /etc/fstab.

[1]: https://bugs.gentoo.org/401573
[2]: https://gitlab.alpinelinux.org/alpine/mkinitfs/-/merge_requests/103
This fixes #533.
This commit is contained in:
Sören Tempel 2022-06-20 05:08:32 +02:00 committed by William Hubbs
parent 9e5ce59a21
commit f60d42e901

View File

@ -48,14 +48,8 @@ start()
ebegin "Remounting filesystems"
local mountpoint
for mountpoint in $(fstabinfo); do
case "${mountpoint}" in
/)
;;
/*)
mountinfo -q "${mountpoint}" && \
fstabinfo --remount "${mountpoint}"
;;
esac
done
eend 0
}