]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dmsquash-live): use the overlay size with thin provisioning
authorgregory-lee-bartholomew <gregory.lee.bartholomew@gmail.com>
Tue, 9 Jan 2024 18:16:53 +0000 (18:16 +0000)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Mon, 1 Apr 2024 03:52:52 +0000 (23:52 -0400)
Using the overlay size in the device mapper table allows the filesystem
in the base image to be extended if the overlay is larger than the
base image (e.g. `resize2fs /dev/mapper/live-rw`).

modules.d/90dmsquash-live/dmsquash-live-root.sh

index 7bafa018d522aa61d01c7d497339984fa65d1254..1237b82d793aa64db78e82eba0551b2847a1d4a9 100755 (executable)
@@ -298,7 +298,7 @@ do_live_overlay() {
         dmsetup message /dev/mapper/live-overlay-pool 0 "create_thin 0"
 
         # Create a snapshot of the base image
-        echo 0 "$sz" thin /dev/mapper/live-overlay-pool 0 "$base" | dmsetup create live-rw
+        echo 0 "$thin_data_sz" thin /dev/mapper/live-overlay-pool 0 "$base" | dmsetup create live-rw
     elif [ -z "$overlayfs" ]; then
         echo 0 "$sz" snapshot "$base" "$over" PO 8 | dmsetup create live-rw
     fi