X-Git-Url: http://git.plutz.net/?p=bootimage;a=blobdiff_plain;f=Makefile;h=00c2c4ea7474a634ebb593b701e8d4f22bb7b76f;hp=1e5afbb8cfc09eb53a88ee648f7da08a31d7a6e8;hb=HEAD;hpb=f0d58488893d101cd696826d9825b4713a11161f diff --git a/Makefile b/Makefile index 1e5afbb..00c2c4e 100644 --- a/Makefile +++ b/Makefile @@ -35,40 +35,46 @@ 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 -s '$<$@' ./ + ln -fs '$<$@' ./ initrd.img: stretch_*_root/ - ln -s '$<$@' ./ + ln -fs '$<$@' ./ /dev/sd%: partitions .FORCE sfdisk ${@}