46e28b
From 8aa62b8cb28a41d4739633aee9b02e40dc4a75d0 Mon Sep 17 00:00:00 2001
46e28b
From: Matt Coleman <matt@datto.com>
46e28b
Date: Fri, 23 Sep 2022 19:28:25 -0400
46e28b
Subject: [PATCH] feat(dmsquash-live): add new dmsquash-live-autooverlay module
46e28b
46e28b
Adapt to test properly with the CentOS Stream 9 container too.
46e28b
46e28b
(cherry picked from commit a3c67d27e75223bb45df19f850d246ced9a09938)
46e28b
46e28b
Co-authored-by: Neal Gompa <ngompa@datto.com>
46e28b
46e28b
Resolves: #2135060
46e28b
---
46e28b
 .github/workflows/integration.yml                  |   1 +
46e28b
 man/dracut.cmdline.7.asc                           |   4 +
46e28b
 .../create-overlay-genrules.sh                     |  10 ++
46e28b
 .../90dmsquash-live-autooverlay/create-overlay.sh  | 119 +++++++++++++++++++++
46e28b
 .../90dmsquash-live-autooverlay/module-setup.sh    |  25 +++++
46e28b
 pkgbuild/dracut.spec                               |   3 +-
46e28b
 test/TEST-16-DMSQUASH/create-root.sh               |  12 ++-
46e28b
 test/TEST-16-DMSQUASH/test-init.sh                 |   6 ++
46e28b
 test/TEST-16-DMSQUASH/test.sh                      |  38 ++++++-
46e28b
 test/container/Dockerfile-Arch                     |   2 +-
46e28b
 test/container/Dockerfile-CentOS-9-Stream          |   2 +
46e28b
 test/container/Dockerfile-Debian                   |   1 +
46e28b
 test/container/Dockerfile-Fedora-latest            |   1 +
46e28b
 test/container/Dockerfile-OpenSuse-latest          |   2 +-
46e28b
 14 files changed, 218 insertions(+), 8 deletions(-)
46e28b
46e28b
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
46e28b
index 40da300c..c22bf916 100644
46e28b
--- a/.github/workflows/integration.yml
46e28b
+++ b/.github/workflows/integration.yml
46e28b
@@ -98,6 +98,7 @@ jobs:
46e28b
                         "11",
46e28b
                         "12",
46e28b
                         "13",
46e28b
+                        "16",
46e28b
                         "17",
46e28b
                         "20",
46e28b
                         "21",
46e28b
diff --git a/man/dracut.cmdline.7.asc b/man/dracut.cmdline.7.asc
46e28b
index fda62fd1..40d13d83 100644
46e28b
--- a/man/dracut.cmdline.7.asc
46e28b
+++ b/man/dracut.cmdline.7.asc
46e28b
@@ -1161,6 +1161,10 @@ rd.live.overlay=/dev/sdb1:persistent-overlay.img
46e28b
 rd.live.overlay=UUID=99440c1f-8daa-41bf-b965-b7240a8996f4
46e28b
 --
46e28b
 
46e28b
+**rd.live.overlay.cowfs=**__[btrfs|ext4|xfs]__::
46e28b
+Specifies the filesystem to use when formatting the overlay partition.
46e28b
+The default is ext4.
46e28b
+
46e28b
 **rd.live.overlay.size=**__<size_MiB>__::
46e28b
 Specifies a non-persistent Device-mapper overlay size in MiB.  The default is
46e28b
 _32768_.
46e28b
diff --git a/modules.d/90dmsquash-live-autooverlay/create-overlay-genrules.sh b/modules.d/90dmsquash-live-autooverlay/create-overlay-genrules.sh
46e28b
new file mode 100755
46e28b
index 00000000..ed168d9f
46e28b
--- /dev/null
46e28b
+++ b/modules.d/90dmsquash-live-autooverlay/create-overlay-genrules.sh
46e28b
@@ -0,0 +1,10 @@
46e28b
+#!/bin/sh
46e28b
+
46e28b
+# shellcheck disable=SC2154
46e28b
+case "$root" in
46e28b
+    live:/dev/*)
46e28b
+        printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/create-overlay %s"\n' \
46e28b
+            "${root#live:/dev/}" "${root#live:}" >> /etc/udev/rules.d/95-create-overlay.rules
46e28b
+        wait_for_dev -n "${root#live:}"
46e28b
+        ;;
46e28b
+esac
46e28b
diff --git a/modules.d/90dmsquash-live-autooverlay/create-overlay.sh b/modules.d/90dmsquash-live-autooverlay/create-overlay.sh
46e28b
new file mode 100755
46e28b
index 00000000..c89bda2b
46e28b
--- /dev/null
46e28b
+++ b/modules.d/90dmsquash-live-autooverlay/create-overlay.sh
46e28b
@@ -0,0 +1,119 @@
46e28b
+#!/bin/sh
46e28b
+
46e28b
+type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
46e28b
+
46e28b
+if getargbool 0 rd.live.debug -n -y rdlivedebug; then
46e28b
+    exec > /tmp/create-overlay.$$.out
46e28b
+    exec 2>> /tmp/create-overlay.$$.out
46e28b
+    set -x
46e28b
+fi
46e28b
+
46e28b
+gatherData() {
46e28b
+    overlay=$(getarg rd.live.overlay)
46e28b
+    if [ -z "$overlay" ]; then
46e28b
+        info "Skipping overlay creation: kernel command line parameter 'rd.live.overlay' is not set"
46e28b
+        exit 0
46e28b
+    fi
46e28b
+    # shellcheck disable=SC2086
46e28b
+    if ! str_starts ${overlay} LABEL=; then
46e28b
+        die "Overlay creation failed: the partition must be set by LABEL in the 'rd.live.overlay' kernel parameter"
46e28b
+    fi
46e28b
+
46e28b
+    overlayLabel=${overlay#LABEL=}
46e28b
+    # shellcheck disable=SC2086
46e28b
+    if [ -b /dev/disk/by-label/${overlayLabel} ]; then
46e28b
+        info "Skipping overlay creation: overlay already exists"
46e28b
+        exit 0
46e28b
+    fi
46e28b
+
46e28b
+    filesystem=$(getarg rd.live.overlay.cowfs)
46e28b
+    [ -z "$filesystem" ] && filesystem="ext4"
46e28b
+    if [ "$filesystem" != "ext4" ] && [ "$filesystem" != "xfs" ] && [ "$filesystem" != "btrfs" ]; then
46e28b
+        die "Overlay creation failed: only ext4, xfs, and btrfs are supported in the 'rd.live.overlay.cowfs' kernel parameter"
46e28b
+    fi
46e28b
+
46e28b
+    live_dir=$(getarg rd.live.dir)
46e28b
+    [ -z "$live_dir" ] && live_dir="LiveOS"
46e28b
+
46e28b
+    [ -z "$1" ] && exit 1
46e28b
+    rootDevice=$1
46e28b
+
46e28b
+    # The kernel command line's 'root=' parameter was parsed into the $root variable by the dmsquash-live module.
46e28b
+    # $root contains the path to a symlink within /dev/disk/by-label, which points to a partition.
46e28b
+    # This script needs that partition's parent block device.
46e28b
+    # shellcheck disable=SC2046
46e28b
+    # shellcheck disable=SC2086
46e28b
+    rootDeviceAbsolutePath=$(readlink -f ${rootDevice})
46e28b
+    rootDeviceSysfsPath=/sys/class/block/${rootDeviceAbsolutePath##*/}
46e28b
+    if [ -f "${rootDeviceSysfsPath}/partition" ]; then
46e28b
+        # shellcheck disable=SC2086
46e28b
+        partition=$(cat ${rootDeviceSysfsPath}/partition)
46e28b
+    else
46e28b
+        partition=0
46e28b
+    fi
46e28b
+    # shellcheck disable=SC2086
46e28b
+    readonly=$(cat ${rootDeviceSysfsPath}/ro)
46e28b
+    # shellcheck disable=SC2086
46e28b
+    if [ "$partition" != "1" ] || [ "$readonly" != "0" ]; then
46e28b
+        info "Skipping overlay creation: unpartitioned or read-only media detected"
46e28b
+        exit 0
46e28b
+    fi
46e28b
+    # shellcheck disable=SC2046
46e28b
+    # shellcheck disable=SC2086
46e28b
+    fullDriveSysfsPath=$(readlink -f ${rootDeviceSysfsPath}/..)
46e28b
+    blockDevice=/dev/${fullDriveSysfsPath##*/}
46e28b
+    currentPartitionCount=$(grep --count -E "${blockDevice#/dev/}[0-9]+" /proc/partitions)
46e28b
+
46e28b
+    # shellcheck disable=SC2086
46e28b
+    freeSpaceStart=$(parted --script ${blockDevice} unit % print free \
46e28b
+        | awk -v x=${currentPartitionCount} '$1 == x {getline; print $1}')
46e28b
+    if [ -z "$freeSpaceStart" ]; then
46e28b
+        info "Skipping overlay creation: there is no free space after the last partition"
46e28b
+        exit 0
46e28b
+    fi
46e28b
+    partitionStart=$((${freeSpaceStart%.*} + 1))
46e28b
+    if [ $partitionStart -eq 100 ]; then
46e28b
+        info "Skipping overlay creation: there is not enough free space after the last partition"
46e28b
+        exit 0
46e28b
+    fi
46e28b
+
46e28b
+    overlayPartition=${blockDevice}$((currentPartitionCount + 1))
46e28b
+
46e28b
+    label=$(blkid --match-tag LABEL --output value "$rootDevice")
46e28b
+    uuid=$(blkid --match-tag UUID --output value "$rootDevice")
46e28b
+    if [ -z "$label" ] || [ -z "$uuid" ]; then
46e28b
+        die "Overlay creation failed: failed to look up root device label and UUID"
46e28b
+    fi
46e28b
+}
46e28b
+
46e28b
+createPartition() {
46e28b
+    # shellcheck disable=SC2086
46e28b
+    parted --script --align optimal ${blockDevice} mkpart primary ${partitionStart}% 100%
46e28b
+}
46e28b
+
46e28b
+createFilesystem() {
46e28b
+    # shellcheck disable=SC2086
46e28b
+    mkfs.${filesystem} -L ${overlayLabel} ${overlayPartition}
46e28b
+
46e28b
+    baseDir=/run/initramfs/create-overlayfs
46e28b
+    mkdir -p ${baseDir}
46e28b
+    # shellcheck disable=SC2086
46e28b
+    mount -t auto ${overlayPartition} ${baseDir}
46e28b
+
46e28b
+    mkdir -p ${baseDir}/${live_dir}/ovlwork
46e28b
+    # shellcheck disable=SC2086
46e28b
+    mkdir ${baseDir}/${live_dir}/overlay-${label}-${uuid}
46e28b
+
46e28b
+    umount ${baseDir}
46e28b
+    rm -r ${baseDir}
46e28b
+}
46e28b
+
46e28b
+main() {
46e28b
+    gatherData "$1"
46e28b
+    createPartition
46e28b
+    udevsettle
46e28b
+    createFilesystem
46e28b
+    udevsettle
46e28b
+}
46e28b
+
46e28b
+main "$1"
46e28b
diff --git a/modules.d/90dmsquash-live-autooverlay/module-setup.sh b/modules.d/90dmsquash-live-autooverlay/module-setup.sh
46e28b
new file mode 100755
46e28b
index 00000000..c3712eba
46e28b
--- /dev/null
46e28b
+++ b/modules.d/90dmsquash-live-autooverlay/module-setup.sh
46e28b
@@ -0,0 +1,25 @@
46e28b
+#!/bin/bash
46e28b
+
46e28b
+check() {
46e28b
+    # including a module dedicated to live environments in a host-only initrd doesn't make sense
46e28b
+    [[ $hostonly ]] && return 1
46e28b
+    return 255
46e28b
+}
46e28b
+
46e28b
+depends() {
46e28b
+    echo dmsquash-live
46e28b
+    return 0
46e28b
+}
46e28b
+
46e28b
+installkernel() {
46e28b
+    instmods btrfs ext4 xfs
46e28b
+}
46e28b
+
46e28b
+install() {
46e28b
+    inst_multiple awk blkid cat grep mkdir mount parted readlink rmdir tr umount
46e28b
+    inst_multiple -o mkfs.btrfs mkfs.ext4 mkfs.xfs
46e28b
+    # shellcheck disable=SC2154
46e28b
+    inst_hook pre-udev 25 "$moddir/create-overlay-genrules.sh"
46e28b
+    inst_script "$moddir/create-overlay.sh" "/sbin/create-overlay"
46e28b
+    dracut_need_initqueue
46e28b
+}
46e28b
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec
46e28b
index 38de47b4..e148bbf7 100644
46e28b
--- a/pkgbuild/dracut.spec
46e28b
+++ b/pkgbuild/dracut.spec
46e28b
@@ -138,7 +138,7 @@ Requires: %{name} >= %{version}-%{dist_free_release}
46e28b
 Requires: %{name} = %{version}-%{release}
46e28b
 %endif
46e28b
 Requires: %{name}-network = %{version}-%{release}
46e28b
-Requires: tar gzip coreutils bash device-mapper curl
46e28b
+Requires: tar gzip coreutils bash device-mapper curl parted
46e28b
 %if 0%{?fedora}
46e28b
 Requires: fuse ntfs-3g
46e28b
 %endif
46e28b
@@ -461,6 +461,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
46e28b
 %files live
46e28b
 %{dracutlibdir}/modules.d/99img-lib
46e28b
 %{dracutlibdir}/modules.d/90dmsquash-live
46e28b
+%{dracutlibdir}/modules.d/90dmsquash-live-autooverlay
46e28b
 %{dracutlibdir}/modules.d/90dmsquash-live-ntfs
46e28b
 %{dracutlibdir}/modules.d/90livenet
46e28b
 
46e28b
diff --git a/test/TEST-16-DMSQUASH/create-root.sh b/test/TEST-16-DMSQUASH/create-root.sh
46e28b
index 9bc1aa5d..c11e17e0 100755
46e28b
--- a/test/TEST-16-DMSQUASH/create-root.sh
46e28b
+++ b/test/TEST-16-DMSQUASH/create-root.sh
46e28b
@@ -11,9 +11,17 @@ udevadm control --reload
46e28b
 set -e
46e28b
 
46e28b
 udevadm settle
46e28b
-mkfs.ext4 -q -L dracut /dev/disk/by-id/ata-disk_root
46e28b
+
46e28b
+# create a single partition using 50% of the capacity of the image file created by test_setup() in test.sh
46e28b
+sfdisk /dev/disk/by-id/ata-disk_root << EOF
46e28b
+2048,161792
46e28b
+EOF
46e28b
+
46e28b
+udevadm settle
46e28b
+
46e28b
+mkfs.ext4 -q -L dracut /dev/disk/by-id/ata-disk_root-part1
46e28b
 mkdir -p /root
46e28b
-mount /dev/disk/by-id/ata-disk_root /root
46e28b
+mount /dev/disk/by-id/ata-disk_root-part1 /root
46e28b
 mkdir -p /root/run /root/testdir
46e28b
 echo "Creating squashfs"
46e28b
 mksquashfs /source /root/testdir/rootfs.img -quiet
46e28b
diff --git a/test/TEST-16-DMSQUASH/test-init.sh b/test/TEST-16-DMSQUASH/test-init.sh
46e28b
index 068e8f38..959fa25f 100755
46e28b
--- a/test/TEST-16-DMSQUASH/test-init.sh
46e28b
+++ b/test/TEST-16-DMSQUASH/test-init.sh
46e28b
@@ -9,6 +9,12 @@ exec > /dev/console 2>&1
46e28b
 
46e28b
 echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker
46e28b
 
46e28b
+if grep -qF ' rd.live.overlay=LABEL=persist ' /proc/cmdline; then
46e28b
+    # Writing to a file in the root filesystem lets test_run() verify that the autooverlay module successfully created
46e28b
+    # and formatted the overlay partition and that the dmsquash-live module used it when setting up the rootfs overlay.
46e28b
+    echo "dracut-autooverlay-success" > /overlay-marker
46e28b
+fi
46e28b
+
46e28b
 export TERM=linux
46e28b
 export PS1='initramfs-test:\w\$ '
46e28b
 [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
46e28b
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
46e28b
index 52029375..58d73b0d 100755
46e28b
--- a/test/TEST-16-DMSQUASH/test.sh
46e28b
+++ b/test/TEST-16-DMSQUASH/test.sh
46e28b
@@ -5,8 +5,9 @@ TEST_DESCRIPTION="live root on a squash filesystem"
46e28b
 
46e28b
 KVERSION="${KVERSION-$(uname -r)}"
46e28b
 
46e28b
-# Uncomment this to debug failures
46e28b
-#DEBUGFAIL="rd.shell rd.debug loglevel=7"
46e28b
+# Uncomment these to debug failures
46e28b
+#DEBUGFAIL="rd.shell rd.debug rd.live.debug loglevel=7"
46e28b
+#DEBUGTOOLS="setsid ls cat sfdisk"
46e28b
 
46e28b
 test_run() {
46e28b
     dd if=/dev/zero of="$TESTDIR"/marker.img bs=1MiB count=1
46e28b
@@ -23,6 +24,27 @@ test_run() {
46e28b
         -initrd "$TESTDIR"/initramfs.testing
46e28b
 
46e28b
     grep -U --binary-files=binary -F -m 1 -q dracut-root-block-success -- "$TESTDIR"/marker.img || return 1
46e28b
+
46e28b
+    rootPartitions=$(sfdisk -d "$TESTDIR"/root.img | grep -c 'root\.img[0-9]')
46e28b
+    [ "$rootPartitions" -eq 1 ] || return 1
46e28b
+
46e28b
+    "$testdir"/run-qemu \
46e28b
+        "${disk_args[@]}" \
46e28b
+        -boot order=d \
46e28b
+        -append "rd.live.image rd.live.overlay.overlayfs=1 rd.live.overlay=LABEL=persist rd.live.dir=testdir root=LABEL=dracut console=ttyS0,115200n81 quiet selinux=0 rd.info rd.shell=0 panic=1 oops=panic softlockup_panic=1 $DEBUGFAIL" \
46e28b
+        -initrd "$TESTDIR"/initramfs.testing-autooverlay
46e28b
+
46e28b
+    rootPartitions=$(sfdisk -d "$TESTDIR"/root.img | grep -c 'root\.img[0-9]')
46e28b
+    [ "$rootPartitions" -eq 2 ] || return 1
46e28b
+
46e28b
+    (
46e28b
+        # Ensure that this test works when run with the `V=1` parameter, which runs the script with `set -o pipefail`.
46e28b
+        set +o pipefail
46e28b
+
46e28b
+        # Verify that the string "dracut-autooverlay-success" occurs in the second partition in the image file.
46e28b
+        dd if="$TESTDIR"/root.img bs=1MiB skip=80 status=none \
46e28b
+            | grep -U --binary-files=binary -F -m 1 -q dracut-autooverlay-success
46e28b
+    ) || return 1
46e28b
 }
46e28b
 
46e28b
 test_setup() {
46e28b
@@ -49,7 +71,7 @@ test_setup() {
46e28b
         ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
46e28b
         ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
46e28b
 
46e28b
-        inst_multiple mkdir ln dd stty mount poweroff
46e28b
+        inst_multiple mkdir ln dd stty mount poweroff grep "$DEBUGTOOLS"
46e28b
 
46e28b
         cp -a -- /etc/ld.so.conf* "$initdir"/etc
46e28b
         ldconfig -r "$initdir"
46e28b
@@ -115,6 +137,16 @@ test_setup() {
46e28b
         --force "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
46e28b
 
46e28b
     ls -sh "$TESTDIR"/initramfs.testing
46e28b
+
46e28b
+    "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
46e28b
+        --modules "dmsquash-live-autooverlay qemu" \
46e28b
+        --omit "rngd" \
46e28b
+        --drivers "ext4 sd_mod" \
46e28b
+        --no-hostonly --no-hostonly-cmdline \
46e28b
+        --force "$TESTDIR"/initramfs.testing-autooverlay "$KVERSION" || return 1
46e28b
+
46e28b
+    ls -sh "$TESTDIR"/initramfs.testing-autooverlay
46e28b
+
46e28b
     rm -rf -- "$TESTDIR"/overlay
46e28b
 }
46e28b
 
46e28b
diff --git a/test/container/Dockerfile-Arch b/test/container/Dockerfile-Arch
46e28b
index ac1513a1..4112cc5b 100644
46e28b
--- a/test/container/Dockerfile-Arch
46e28b
+++ b/test/container/Dockerfile-Arch
46e28b
@@ -12,7 +12,7 @@ RUN pacman --noconfirm -Sy \
46e28b
     linux dash strace dhclient asciidoc cpio pigz squashfs-tools \
46e28b
     qemu btrfs-progs mdadm dmraid nfs-utils nfsidmap lvm2 nbd \
46e28b
     dhcp networkmanager multipath-tools vi tcpdump open-iscsi \
46e28b
-    git shfmt shellcheck astyle which base-devel && yes | pacman  -Scc
46e28b
+    git shfmt shellcheck astyle which base-devel glibc parted && yes | pacman -Scc
46e28b
 
46e28b
 RUN useradd -m build
46e28b
 RUN su build -c 'cd && git clone https://aur.archlinux.org/perl-config-general.git && cd perl-config-general && makepkg -s --noconfirm'
46e28b
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream
46e28b
index c9a96020..abcc067e 100644
46e28b
--- a/test/container/Dockerfile-CentOS-9-Stream
46e28b
+++ b/test/container/Dockerfile-CentOS-9-Stream
46e28b
@@ -33,8 +33,10 @@ RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \
46e28b
     make \
46e28b
     mdadm \
46e28b
     nfs-utils \
46e28b
+    parted \
46e28b
     pigz \
46e28b
     rpm-build \
46e28b
+    squashfs-tools \
46e28b
     strace \
46e28b
     sudo \
46e28b
     tar \
46e28b
diff --git a/test/container/Dockerfile-Debian b/test/container/Dockerfile-Debian
46e28b
index b4c1704e..15eb9958 100644
46e28b
--- a/test/container/Dockerfile-Debian
46e28b
+++ b/test/container/Dockerfile-Debian
46e28b
@@ -42,6 +42,7 @@ RUN apt-get update -y -qq && apt-get upgrade -y -qq && DEBIAN_FRONTEND=nonintera
46e28b
     network-manager \
46e28b
     nfs-common \
46e28b
     open-iscsi \
46e28b
+    parted \
46e28b
     pigz \
46e28b
     pkg-config \
46e28b
     procps \
46e28b
diff --git a/test/container/Dockerfile-Fedora-latest b/test/container/Dockerfile-Fedora-latest
46e28b
index 87c749f9..a38a72ef 100644
46e28b
--- a/test/container/Dockerfile-Fedora-latest
46e28b
+++ b/test/container/Dockerfile-Fedora-latest
46e28b
@@ -49,6 +49,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
46e28b
     which \
46e28b
     ShellCheck \
46e28b
     shfmt \
46e28b
+    parted \
46e28b
     && dnf -y update && dnf clean all
46e28b
 
46e28b
 # Set default command
46e28b
diff --git a/test/container/Dockerfile-OpenSuse-latest b/test/container/Dockerfile-OpenSuse-latest
46e28b
index 637d50c6..9aaf07b1 100644
46e28b
--- a/test/container/Dockerfile-OpenSuse-latest
46e28b
+++ b/test/container/Dockerfile-OpenSuse-latest
46e28b
@@ -13,7 +13,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
46e28b
     strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \
46e28b
     sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \
46e28b
     tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \
46e28b
-    iscsiuio open-iscsi which ShellCheck procps pigz \
46e28b
+    iscsiuio open-iscsi which ShellCheck procps pigz parted squashfs \
46e28b
     && dnf -y update && dnf clean all
46e28b
 
46e28b
 RUN shfmt_version=3.2.4; wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O /usr/local/bin/shfmt \