]> git.plutz.net Git - bootimage/blobdiff - Makefile
adaptions from Zirkus Zack branch
[bootimage] / Makefile
index 493495c952fc0f63778d4b7e68d675295d28b346..00c2c4ea7474a634ebb593b701e8d4f22bb7b76f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,18 +35,19 @@ stretch_%_root/: stretch_%_root/bin/sh ${CONFIG} permissions .FORCE
        touch "$@"
 
 stretch_%_config/: stretch_%_root/ ${CONFIG} permissions .FORCE
-       btrfs subvolume delete "$@" || rm -r "$@" || true
+       if [ -d "$@" ]; then btrfs subvolume delete "$@" || rm -r "$@"; else true; fi
        btrfs subvolume snapshot "$<" "$@" || cp -rlv "$<" "$@"
        cp -av $(addsuffix /*, ${CONFIG}) "$@"
        -chroot "$@" locale-gen
        -chroot "$@" update-locale
-       chroot "$@" useradd -M -p "$$(printf %s\\n '${PASS}' |mkpasswd -m sha-256 -s)" '${USER}'
-       for g in ${GROUPS}; do chroot "$@" adduser '${USER}' "$$g"; done
+       -chroot "$@" useradd -M -p "$$(printf %s\\n '${PASS}' |mkpasswd -m sha-256 -s)" '${USER}'
+       -for g in ${GROUPS}; do chroot "$@" adduser '${USER}' "$$g"; done
        touch "$@"
 
 stretch_%.squashfs: stretch_%_config/
        rm "$@" || true
        mksquashfs "$<" "$@" -comp xz
+       chmod a+r "$@"
 
 vmlinuz: stretch_*_root/
        ln -fs '$<$@' ./