Skip to contentSkip to conversation

files: overlayfs-etc: wrap long lines of preinit file

PATCH New Claudius Heine 1 participant 2 messages Mar 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 files: overlayfs-etc: wrap long lines of preinit file

Make it easier to see what is happening by wrapping the overly long lines in the preinit file for the overlayfs-etc.

---
 meta/files/overlayfs-etc-preinit.sh.in | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
meta/files/overlayfs-etc-preinit.sh.in +9 -2
index 2ebb6c9224..1daf83513e 100644
@@ -16,11 +16,18 @@ mount -t sysfs sysfs /sys
 [ -z "$CONSOLE" ] && CONSOLE="/dev/console"
 
 mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}
-if mount -n -t {OVERLAYFS_ETC_FSTYPE} -o {OVERLAYFS_ETC_MOUNT_OPTIONS} {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT}
+if mount -n -t {OVERLAYFS_ETC_FSTYPE} \
+	-o {OVERLAYFS_ETC_MOUNT_OPTIONS} \
+	{OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT}
 then
     mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper
     mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work
-    mount -n -t overlay -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper,lowerdir=/etc,workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || echo "PREINIT: Mounting etc-overlay failed!"
+    mount -n -t overlay \
+	    -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper \
+	    -o lowerdir=/etc \
+	    -o workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work \
+	    {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || \
+		    echo "PREINIT: Mounting etc-overlay failed!"
 else
     echo "PREINIT: Mounting </data> failed!"
 fi
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/2 files: overlayfs-etc: add index=off and xino=off mount option to preinit

Overlayfs-etc is useful if the rootfs is read-only. One reason to have the rootfs read-only is to allow image based updating.

Image based updating will change the underlying root file system, which is unsupported by overlayfs when with some mount options [1].

This disables those options.

[1] https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html?highlight=overlayfs#changes-to-underlying-filesystems

---
 meta/files/overlayfs-etc-preinit.sh.in | 1 +
 1 file changed, 1 insertion(+)
meta/files/overlayfs-etc-preinit.sh.in +1 -0
index 1daf83513e..51cbdf25a8 100644
@@ -26,6 +26,7 @@ then
 	    -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper \
 	    -o lowerdir=/etc \
 	    -o workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work \
+	    -o index=off,xino=off,redirect_dir=off,metacopy=off \
 	    {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || \
 		    echo "PREINIT: Mounting etc-overlay failed!"
 else
Signature · 1 line
2.35.1