]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat: rename rd.live.overlay.overlayfs to rd.overlayfs
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 1 Nov 2025 23:20:42 +0000 (19:20 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Tue, 11 Nov 2025 17:07:18 +0000 (12:07 -0500)
The overlayfs dracut module can be used without the dmsquash-live
dracut module. This change improves on naming of command line options
with better namespace scoping.

Move overlayfs documentation out of the live images section.

Follow-up to 40dd5c90e.

man/dracut.cmdline.7.adoc
modules.d/70dmsquash-live/dmsquash-generator.sh
modules.d/70dmsquash-live/dmsquash-live-root.sh
modules.d/70livenet/livenet-generator.sh
modules.d/70overlayfs/mount-overlayfs.sh
modules.d/70overlayfs/prepare-overlayfs.sh
test/TEST-30-DMSQUASH/test.sh
test/TEST-60-NFS/test.sh

index 6e54be4ced64f54041d91c5adf8209591563f78c..272608151f6e32ccd53f81dacca264d8c0bce537 100644 (file)
@@ -1086,6 +1086,29 @@ rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
 rd.znet=ctc,0.0.0600,0.0.0601,protocol=bar
 --
 
+OverlayFS
+~~~~~~~~~
+Requires the dracut 'overlayfs' module.
+
+**rd.overlayfs=**1::
+Enables the use of the *OverlayFS* kernel module, if available, to provide a
+copy-on-write union directory for the root filesystem.  OverlayFS overlays are
+directories of the files that have changed on the read-only base (lower)
+filesystem.  The root filesystem is provided through a special overlay type
+mount that merges at least two directories, designated the lower and the upper.
+If an OverlayFS upper directory is not present on the boot device, a tmpfs
+directory will be created at `/run/overlayfs` to provide temporary storage.
+Persistent storage can be provided on vfat or msdos formatted devices by
+supplying the OverlayFS upper directory within an embedded filesystem that
+supports the creation of trusted.* extended attributes and provides a valid
+d_type in readdir responses, such as with btrfs, ext4, f2fs, & xfs.  On
+non-vfat-formatted devices, a persistent OverlayFS overlay can extend the
+available root filesystem storage up to the capacity of the LiveOS disk device.
++
+The **rd.overlayfs.readonly** option, which allows a persistent overlayfs to
+be mounted read-only through a higher level transient overlay directory, has
+been implemented through the multiple lower layers feature of OverlayFS.
+
 Booting live images
 ~~~~~~~~~~~~~~~~~~~
 Requires the dracut 'dmsquash-live' module.
@@ -1129,7 +1152,7 @@ filesystem, which often provide only a small number of gigabytes of free space.
 This shortage could be remedied by building the root filesystem with more
 allocated free space, or the OverlayFS based overlay mount method can be used.
 
-When the *_rd.live.overlay.overlayfs_* option is specified or when
+When the *_rd.overlayfs_* option is specified or when
 *_rd.live.overlay=_* points to an appropriate directory with a sister at
 `/../ovlwork`, then an OverlayFS based overlay mount is employed.  Such a
 persistent OverlayFS overlay can extend the available root filesystem storage
@@ -1293,7 +1316,7 @@ where _<label>_ and _<uuid>_ are the LABEL and UUID of the filesystem specified
 by the **root=**live:__<path|url>__ device.
 
 If a persistent overlay __is detected__ at the standard LiveOS path,
-and *_rd.live.overlay.overlayfs_* is not set to 1, the overlay type (either
+and *_rd.overlayfs_* is not set to 1, the overlay type (either
 Device-mapper or OverlayFS) will be detected and it will be used.
 --
 +
@@ -1340,28 +1363,6 @@ blocks that are not claimed by the filesystem. In this use case, this means
 that memory is given back to the kernel when the filesystem does not claim it
 anymore.
 
-**rd.live.overlay.overlayfs=**1::
-Enables the use of the *OverlayFS* kernel module, if available, to provide a
-copy-on-write union directory for the root filesystem.  OverlayFS overlays are
-directories of the files that have changed on the read-only base (lower)
-filesystem.  The root filesystem is provided through a special overlay type
-mount that merges at least two directories, designated the lower and the upper.
-If an OverlayFS upper directory is not present on the boot device, a tmpfs
-directory will be created at `/run/overlayfs` to provide temporary storage.
-Persistent storage can be provided on vfat or msdos formatted devices by
-supplying the OverlayFS upper directory within an embedded filesystem that
-supports the creation of trusted.* extended attributes and provides a valid
-d_type in readdir responses, such as with btrfs, ext4, f2fs, & xfs.  On
-non-vfat-formatted devices, a persistent OverlayFS overlay can extend the
-available root filesystem storage up to the capacity of the LiveOS disk device.
-Requires the dracut 'overlayfs' module.
-+
-The **rd.live.overlay.readonly** option, which allows a persistent overlayfs to
-be mounted read-only through a higher level transient overlay directory, has
-been implemented through the multiple lower layers feature of OverlayFS.
-Requires the dracut 'overlayfs' module.
-
-
 ZIPL
 ~~~~
 Requires the dracut 'zipl' module.
@@ -1508,6 +1509,10 @@ UNICODE:: vconsole.unicode
 
 EXT_KEYMAP:: vconsole.keymap.ext
 
+rd.live.overlay.overlayfs:: rd.overlayfs
+
+rd.live.overlay.readonly:: rd.overlayfs.readonly
+
 Configuration in the Initramfs
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 _/etc/conf.d/_::
index bbb232f257ae9f2b23c88e99f1f69aace38f3a7e..3b11ef313e2b812fccdb3667bb08c04389bafef2 100755 (executable)
@@ -45,8 +45,8 @@ GENERATOR_DIR="$2"
 [ -z "$GENERATOR_DIR" ] && exit 1
 [ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR"
 
-getargbool 0 rd.live.overlay.readonly && readonly_overlay="--readonly" || readonly_overlay=""
-getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
+getargbool 0 rd.overlayfs.readonly -d rd.live.overlayfs.readonly && readonly_overlay="--readonly" || readonly_overlay=""
+getargbool 0 rd.overlayfs -d rd.live.overlay.overlayfs && overlayfs="yes"
 [ -e /xor_overlayfs ] && xor_overlayfs="yes"
 [ -e /xor_readonly ] && xor_readonly="--readonly"
 ROOTFLAGS="$(getarg rootflags)"
index ce8fcbbdd39a57571735ba3c046ee8e75cbd3c2a..429e28775b66c473358c64ab722a0a450b57ad6d 100755 (executable)
@@ -24,7 +24,7 @@ squash_image=$(getarg rd.live.squashimg)
 
 getargbool 0 rd.live.ram && live_ram="yes"
 getargbool 0 rd.live.overlay.reset && reset_overlay="yes"
-getargbool 0 rd.live.overlay.readonly && readonly_overlay="--readonly" || readonly_overlay=""
+getargbool 0 rd.overlayfs.readonly -d rd.live.overlay.readonly && readonly_overlay="--readonly" || readonly_overlay=""
 getargbool 0 rd.live.overlay.nouserconfirmprompt && overlay_no_user_confirm_prompt="--noprompt" || overlay_no_user_confirm_prompt=""
 overlay=$(getarg rd.live.overlay)
 getargbool 0 rd.writable.fsimg && writable_fsimg="yes"
@@ -32,7 +32,7 @@ overlay_size=$(getarg rd.live.overlay.size=)
 [ -z "$overlay_size" ] && overlay_size=32768
 
 getargbool 0 rd.live.overlay.thin && thin_snapshot="yes"
-getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
+getargbool 0 rd.overlayfs -d rd.live.overlay.overlayfs && overlayfs="yes"
 
 # Take a path to a disk label and return the parent disk if it is a partition
 # Otherwise returns the original path
@@ -416,7 +416,7 @@ fi
 ROOTFLAGS="$(getarg rootflags)"
 
 if [ "$overlayfs" = required ]; then
-    echo "rd.live.overlay.overlayfs=1" > /etc/cmdline.d/20-dmsquash-need-overlay.conf
+    echo "rd.overlayfs=1" > /etc/cmdline.d/20-dmsquash-need-overlay.conf
 fi
 
 if [ -n "$overlayfs" ]; then
index 59af8515a02d6066c358136dde8cdc153f24b66a..6f0946c122070171396834f8d1152f7bc147994c 100755 (executable)
@@ -49,8 +49,8 @@ GENERATOR_DIR="$2"
 
 [ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR"
 
-getargbool 0 rd.live.overlay.readonly && readonly_overlay="--readonly" || readonly_overlay=""
-getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
+getargbool 0 rd.overlayfs.readonly -d rd.live.overlay.readonly && readonly_overlay="--readonly" || readonly_overlay=""
+getargbool 0 rd.overlayfs -d rd.live.overlayfs.readonly && overlayfs="yes"
 [ -e /xor_overlayfs ] && xor_overlayfs="yes"
 [ -e /xor_readonly ] && xor_readonly="--readonly"
 ROOTFLAGS="$(getarg rootflags)"
index f84a14e41ca7fc63956181a5ca9efbfd4bd08fa3..dd09ba72548b7d907623c22d2d05bd9e0e5df2d9 100755 (executable)
@@ -2,8 +2,8 @@
 
 command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
-getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
-getargbool 0 rd.live.overlay.readonly && readonly_overlay="--readonly" || readonly_overlay=""
+getargbool 0 rd.overlayfs -d rd.live.overlay.overlayfs && overlayfs="yes"
+getargbool 0 rd.overlayfs.readonly -d rd.live.overlayfs.readonly && readonly_overlay="--readonly" || readonly_overlay=""
 
 if [ -n "$overlayfs" ]; then
     if [ -n "$readonly_overlay" ] && [ -h /run/overlayfs-r ]; then
index da12a936a6f8218b7130591ebc068665b21a1a44..3319139fc76904307419ae80faeaa89cad1334df 100755 (executable)
@@ -2,7 +2,7 @@
 
 command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
-getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
+getargbool 0 rd.overlayfs -d rd.live.overlay.overlayfs && overlayfs="yes"
 getargbool 0 rd.live.overlay.reset && reset_overlay="yes"
 
 if [ -n "$overlayfs" ]; then
index 323634bb25486c94e9cffb19080db03a810c95c3..14caef89e766cb29358e12feee188c3bed25e987 100755 (executable)
@@ -33,7 +33,7 @@ client_run() {
     test_marker_reset
     "$testdir"/run-qemu \
         "${disk_args[@]}" \
-        -append "$TEST_KERNEL_CMDLINE rd.live.overlay.overlayfs=1 root=live:/dev/disk/by-label/dracut $client_opts" \
+        -append "$TEST_KERNEL_CMDLINE rd.overlayfs=1 root=live:/dev/disk/by-label/dracut $client_opts" \
         -initrd "$TESTDIR"/initramfs.testing
 
     if ! test_marker_check; then
index cb350dd6b2fc0abe771afec8d62fb3b3cab2ae75..a238d5d26e71de30a9d01dbd94f7642e19c6198d 100755 (executable)
@@ -192,10 +192,10 @@ test_nfsv4() {
         "root=dhcp" 192.168.50.3 wsize=4096
 
     client_test "NFSv4 Overlayfs root=nfs4:..." 52:54:00:12:34:84 \
-        "root=nfs4:192.168.50.1:/client rd.live.overlay.overlayfs=1 " 192.168.50.1 -wsize=4096
+        "root=nfs4:192.168.50.1:/client rd.overlayfs=1 " 192.168.50.1 -wsize=4096
 
     client_test "NFSv4 Live Overlayfs root=nfs4:..." 52:54:00:12:34:84 \
-        "root=nfs4:192.168.50.1:/client rd.live.image rd.live.overlay.overlayfs=1" 192.168.50.1 -wsize=4096
+        "root=nfs4:192.168.50.1:/client rd.live.image rd.overlayfs=1" 192.168.50.1 -wsize=4096
 
     return 0
 }