]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - dracut-initramfs-restore.sh
debug: Add dd into debug module
[thirdparty/dracut.git] / dracut-initramfs-restore.sh
index 9479480490487d251aaad3a397975f24957ba75c..184697722e5121748d8e801fd99c24b15fe25198 100644 (file)
@@ -40,4 +40,18 @@ else
     exit 1
 fi
 
+if [[ -d squash ]]; then
+    unsquashfs -no-xattrs -f -d . squash/root.img >/dev/null
+    if [ $? -ne 0 ]; then
+        echo "Squash module is enabled for this initramfs but failed to unpack squash/root.img" >&2
+        rm -f -- /run/initramfs/shutdown
+        exit 1
+    fi
+fi
+
+if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ] ; then
+    . /etc/selinux/config
+    /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts /run/initramfs > /dev/null
+fi
+
 exit 0