Skip to content

Commit c173256

Browse files
champtarjlebon
authored andcommitted
40ignition-ostree: bind mount stateroot_var_path rw
From man mount(8): Since util-linux 2.39, mount may use the new kernel mount API if it is available. This new kernel interface provides a more precise way to work with mountpoint attributes. For example, the -o bind,rw operation will create a read-write node even if the original node was read-only. ostree-prepare-root is creating a rw bind mount at stateroot_var_path because in the past, if a mount unit had 'Options=bind,rw', the 'rw' option was ignored. Remount /sysroot/var rw so we can remove the stateroot_var_path rw bind mount from ostree-prepare-root.
1 parent 586c968 commit c173256

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-mount-var.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ do_mount() {
4141
fi
4242

4343
echo "Mounting $stateroot_var_path"
44+
# older mount ignore 'rw' when using '-o bind,rw', so make 2 calls for now
4445
mount --bind "$stateroot_var_path" /sysroot/var
46+
mount -o remount,bind,rw /sysroot/var
4547
}
4648

4749
do_umount() {

0 commit comments

Comments
 (0)