]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(squash-erofs): properly exclude $squashdir
authorPhilipp Rudo <prudo@redhat.com>
Wed, 14 Aug 2024 14:33:23 +0000 (16:33 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Fri, 16 Aug 2024 00:02:00 +0000 (20:02 -0400)
Option --exclude-path from mkfs.erofs requires a path relative to the
source of the image. Otherwise the path won't be excluded resulting in a
slightly larger (~1M) initrd.

Fixes: ebc9e84d ("feat(squash): add module 95squash-erofs")
Signed-off-by: Philipp Rudo <prudo@redhat.com>
modules.d/95squash-erofs/module-setup.sh

index d763a90249dac3c9cf31584d55dd5829b6aa4100..5f5b803b11b726e7aeda993c7682bf1596946cd9 100755 (executable)
@@ -20,7 +20,8 @@ erofs_installpost() {
     local _img="$squashdir/erofs-root.img"
     local -a _erofs_args
 
-    _erofs_args+=("--exclude-path=$squashdir")
+    # --exclude-path requires a relative path
+    _erofs_args+=("--exclude-path=${squashdir#"$initdir"/}")
     _erofs_args+=("-E" "fragments")
 
     if [[ -n $squash_compress ]]; then