From 04ea975a1ed1375e14fd3e849b89bc84948b580c Mon Sep 17 00:00:00 2001 From: Gunnar Wolf Date: Mon, 25 Jan 2021 14:06:46 -0600 Subject: [PATCH] Use a more coherent, stable naming for build families and releases --- Makefile | 78 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 9afde9f..65cd69a 100644 --- a/Makefile +++ b/Makefile @@ -1,84 +1,90 @@ all: shasums # List all the supported and built Pi platforms here. They get expanded -# to names like 'raspi_2.yaml' and 'raspi_0w.img.xz'. -BUILD_PLATFORMS := 0w_buster 2_buster 3_buster 4_buster \ - armel_bullseye armhf_bullseye arm64_bullseye +# to names like 'raspi_2_buster.yaml' and 'raspi_3_bullseye.img.xz'. +BUILD_FAMILIES := 1 2 3 4 +BUILD_RELEASES := buster bullseye + +platforms := $(foreach plat, $(BUILD_FAMILIES),$(foreach rel, $(BUILD_RELEASES), raspi_$(plat)_$(rel))) -platforms := $(addprefix raspi_,$(BUILD_PLATFORMS)) shasums: $(addsuffix .sha256,$(platforms)) $(addsuffix .xz.sha256,$(platforms)) xzimages: $(addsuffix .img.xz,$(platforms)) images: $(addsuffix .img,$(platforms)) yaml: $(addsuffix .yaml,$(platforms)) -raspi_0w_buster.yaml: raspi_master.yaml - cat raspi_master.yaml | sed "s/__ARCH__/armel/" | \ +raspi_base_buster.yaml: raspi_master.yaml + cat raspi_master.yaml | \ + sed "s/__RELEASE__/buster/" > $@ + +raspi_1_buster.yaml: raspi_base_buster.yaml + cat raspi_base_buster.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/" |\ - sed "s/__RELEASE__/buster/" |\ grep -v "__OTHER_APT_ENABLE__" |\ - sed "s/__HOST__/rpi0/" > $@ + sed "s/__HOST__/rpi1/" > $@ -raspi_2_buster.yaml: raspi_master.yaml - cat raspi_master.yaml | sed "s/__ARCH__/armhf/" | \ +raspi_2_buster.yaml: raspi_base_buster.yaml + cat raspi_base_buster.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/" |\ sed "s/__OTHER_APT_ENABLE__//" |\ - sed "s/__RELEASE__/buster/" |\ sed "s/__HOST__/rpi2/" > $@ -raspi_3_buster.yaml: raspi_master.yaml - cat raspi_master.yaml | sed "s/__ARCH__/arm64/" | \ +raspi_3_buster.yaml: raspi_base_buster.yaml + cat raspi_base_buster.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/" |\ sed "s/__OTHER_APT_ENABLE__//" |\ - sed "s/__RELEASE__/buster/" |\ sed "s/__HOST__/rpi3/" > $@ -raspi_4_buster.yaml: raspi_master.yaml - cat raspi_master.yaml | sed "s/__ARCH__/arm64/" | \ +raspi_4_buster.yaml: raspi_base_buster.yaml + cat raspi_base_buster.yaml | sed "s/__ARCH__/arm64/" | \ sed "s#raspi3-firmware#raspi-firmware/buster-backports#" | \ sed "s#apt-get update#echo 'APT::Default-Release \"buster\";' > /etc/apt/apt.conf\n apt-get update#" | \ sed "s#cmdline.txt#cmdline.txt\n sed -i 's/cma=64M //' /boot/firmware/cmdline.txt\n sed -i 's/cma=\\\$$CMA //' /etc/kernel/postinst.d/z50-raspi-firmware#" | \ sed "s/__LINUX_IMAGE__/linux-image-arm64\/buster-backports/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211\/buster-backports/" | \ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\ - sed "s/__RELEASE__/buster/" |\ sed "s/__OTHER_APT_ENABLE__/deb http:\/\/deb.debian.org\/debian\/ buster-backports main contrib non-free # raspi 4 needs a kernel and raspi-firmware newer than buster's/" |\ sed "s/__HOST__/rpi4/" > $@ -raspi_armel_bullseye.yaml: raspi_master.yaml - cat raspi_master.yaml | sed "s/__ARCH__/armel/" | \ +raspi_base_bullseye.yaml: raspi_master.yaml + cat raspi_master.yaml | \ + sed "s/__RELEASE__/bullseye/" |\ + grep -v "__OTHER_APT_ENABLE__" |\ + sed -e '/debian-security/ s/deb/# Uncomment after Bullseye becomes stable → deb/' > $@ + +raspi_1_bullseye.yaml: raspi_base_bullseye.yaml + cat raspi_base_bullseye.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/" |\ - sed "s/__RELEASE__/bullseye/" |\ - grep -v "__OTHER_APT_ENABLE__" |\ - sed -e '/debian-security/ s/deb/# Uncomment after Bullseye becomes stable → deb/' |\ - sed "s/__HOST__/rpi-armel/" > $@ + sed "s/__HOST__/rpi_1/" > $@ -raspi_armhf_bullseye.yaml: raspi_master.yaml - cat raspi_master.yaml | sed "s/__ARCH__/armhf/" | \ +raspi_2_bullseye.yaml: raspi_base_bullseye.yaml + cat raspi_base_bullseye.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/" |\ - sed "s/__OTHER_APT_ENABLE__//" |\ - sed "s/__RELEASE__/bullseye/" |\ - sed -e '/debian-security/ s/deb/# Uncomment after Bullseye becomes stable → deb/' |\ - sed "s/__HOST__/rpi-armhf/" > $@ + sed "s/__HOST__/rpi_2/" > $@ -raspi_arm64_bullseye.yaml: raspi_master.yaml - cat raspi_master.yaml | sed "s/__ARCH__/arm64/" | \ +raspi_3_bullseye.yaml: raspi_base_bullseye.yaml + cat raspi_base_bullseye.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/" |\ - sed "s/__OTHER_APT_ENABLE__//" |\ - sed "s/__RELEASE__/bullseye/" |\ - sed -e '/debian-security/ s/deb/# Uncomment after Bullseye becomes stable → deb/' |\ - sed "s/__HOST__/rpi-arm64/" > $@ + sed "s/__HOST__/rpi_3/" > $@ + +raspi_4_bullseye.yaml: raspi_base_bullseye.yaml + cat raspi_base_bullseye.yaml | sed "s/__ARCH__/arm64/" | \ + sed "s#cmdline.txt#cmdline.txt\n sed -i 's/cma=64M //' /boot/firmware/cmdline.txt\n sed -i 's/cma=\\\$$CMA //' /etc/kernel/postinst.d/z50-raspi-firmware#" | \ + 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/" |\ + sed "s/__HOST__/rpi_4/" > $@ %.sha256: %.img.xz echo $@ @@ -100,7 +106,7 @@ _ck_root: [ `whoami` = 'root' ] # Only root can summon vmdb2 ☹ _clean_yaml: - rm -f $(addsuffix .yaml,$(platforms)) + rm -f $(addsuffix .yaml,$(platforms)) raspi_base_buster.yaml raspi_base_bullseye.yaml _clean_images: rm -f $(addsuffix .img,$(platforms)) _clean_xzimages: