2020-04-14 19:38:14 +01:00
all : shasums
2020-04-27 17:59:56 +01:00
shasums : raspi_ 0w .sha 256 raspi_ 2.sha 256 raspi_ 3.sha 256 raspi_ 0w .xz .sha 256 raspi_ 2.xz .sha 256 raspi_ 3.xz .sha 256
2020-04-15 04:27:20 +01:00
xzimages : raspi_ 0w .img .xz raspi_ 2.img .xz raspi_ 3.img .xz
2019-12-17 20:41:16 +00:00
images : raspi_ 0w .img raspi_ 2.img raspi_ 3.img
2020-04-14 19:38:14 +01:00
yaml : raspi_ 0w .yaml raspi_ 2.yaml raspi_ 3.yaml
2019-12-17 20:41:16 +00:00
raspi_0w.yaml : raspi_master .yaml
cat raspi_master.yaml | sed "s/__ARCH__/armel/" | \
sed "s/__LINUX_IMAGE__/linux-image-rpi/" | \
sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-rpi\\/bcm*rpi-*.dtb/" | \
2020-04-24 17:00:10 +01:00
sed "s/__OTHER_APT_ENABLE__/deb http:\/\/deb.debian.org\/debian\/ buster-proposed-updates main contrib non-free # Raspberries 0\/1 need raspi3-firmware >= 1.20190215-1+deb10u3/" | \
2019-12-17 20:41:16 +00:00
sed "s/__HOST__/rpi0/" > $@
raspi_2.yaml : raspi_master .yaml
cat raspi_master.yaml | sed "s/__ARCH__/armhf/" | \
sed "s/__LINUX_IMAGE__/linux-image-armmp/" | \
grep -v "__EXTRA_PKGS__" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-armmp\\/bcm*rpi*.dtb/" | \
2020-04-24 17:00:10 +01:00
sed "s/__OTHER_APT_ENABLE__//" | \
2019-12-17 20:41:16 +00:00
sed "s/__HOST__/rpi2/" > $@
raspi_3.yaml : raspi_master .yaml
cat raspi_master.yaml | sed "s/__ARCH__/arm64/" | \
sed "s/__LINUX_IMAGE__/linux-image-arm64/" | \
sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" | \
2020-04-24 17:00:10 +01:00
sed "s/__OTHER_APT_ENABLE__//" | \
2019-12-17 20:41:16 +00:00
sed "s/__HOST__/rpi3/" > $@
2020-04-15 04:27:20 +01:00
%.sha256 : %.img .xz
2020-04-27 17:59:56 +01:00
echo $@
sha256sum $( @:sha256= img) > $@
%.xz.sha256 : %.img .xz
echo $@
sha256sum $( @:xz.sha256= img.xz) > $@
2020-04-15 04:27:20 +01:00
%.img.xz : %.img
2020-04-24 16:37:52 +01:00
xz -f -k -z -9 $( @:.xz= )
2019-12-17 20:41:16 +00:00
2020-04-14 19:38:14 +01:00
%.img : %.yaml
touch $( @:.img= .log)
time nice vmdb2 --verbose --rootfs-tarball= $( subst .img,.tar.gz,$@ ) --output= $@ $( subst .img,.yaml,$@ ) --log $( subst .img,.log,$@ )
chmod 0644 $@ $( @,.img= .log)
2019-12-17 20:41:16 +00:00
_ck_root :
[ ` whoami` = 'root' ] # Only root can summon vmdb2 ☹
_clean_yaml :
rm -f raspi_0w.yaml raspi_2.yaml raspi_3.yaml
_clean_images :
rm -f raspi_0w.img raspi_2.img raspi_3.img
2020-04-24 16:37:52 +01:00
_clean_xzimages :
rm -f raspi_0w.img.xz raspi_2.img.xz raspi_3.img.xz
2020-04-14 19:38:14 +01:00
_clean_shasums :
rm -f raspi_0w.sha256 raspi_2.sha256 raspi_3.sha256
2019-12-17 20:41:16 +00:00
_clean_logs :
rm -f raspi_0w.log raspi_2.log raspi_3.log
_clean_tarballs :
rm -f raspi_0w.tar.gz raspi_2.tar.gz raspi_3.tar.gz
2020-04-24 16:37:52 +01:00
clean : _clean_xzimages _clean_images _clean_shasums _clean_yaml _clean_tarballs _clean_logs
2019-12-17 20:41:16 +00:00
.PHONY : _ck_root _build_img clean _clean_images _clean_yaml _clean_tarballs _clean_logs