Use a more coherent, stable naming for build families and releases

This commit is contained in:
Gunnar Wolf 2021-01-25 14:06:46 -06:00
parent eac6b11833
commit 04ea975a1e
1 changed files with 42 additions and 36 deletions

View File

@ -1,84 +1,90 @@
all: shasums all: shasums
# List all the supported and built Pi platforms here. They get expanded # List all the supported and built Pi platforms here. They get expanded
# to names like 'raspi_2.yaml' and 'raspi_0w.img.xz'. # to names like 'raspi_2_buster.yaml' and 'raspi_3_bullseye.img.xz'.
BUILD_PLATFORMS := 0w_buster 2_buster 3_buster 4_buster \ BUILD_FAMILIES := 1 2 3 4
armel_bullseye armhf_bullseye arm64_bullseye 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)) shasums: $(addsuffix .sha256,$(platforms)) $(addsuffix .xz.sha256,$(platforms))
xzimages: $(addsuffix .img.xz,$(platforms)) xzimages: $(addsuffix .img.xz,$(platforms))
images: $(addsuffix .img,$(platforms)) images: $(addsuffix .img,$(platforms))
yaml: $(addsuffix .yaml,$(platforms)) yaml: $(addsuffix .yaml,$(platforms))
raspi_0w_buster.yaml: raspi_master.yaml raspi_base_buster.yaml: raspi_master.yaml
cat raspi_master.yaml | sed "s/__ARCH__/armel/" | \ 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/__LINUX_IMAGE__/linux-image-rpi/" | \
sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-rpi\\/bcm*rpi-*.dtb/" |\ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-rpi\\/bcm*rpi-*.dtb/" |\
sed "s/__RELEASE__/buster/" |\
grep -v "__OTHER_APT_ENABLE__" |\ grep -v "__OTHER_APT_ENABLE__" |\
sed "s/__HOST__/rpi0/" > $@ sed "s/__HOST__/rpi1/" > $@
raspi_2_buster.yaml: raspi_master.yaml raspi_2_buster.yaml: raspi_base_buster.yaml
cat raspi_master.yaml | sed "s/__ARCH__/armhf/" | \ cat raspi_base_buster.yaml | sed "s/__ARCH__/armhf/" | \
sed "s/__LINUX_IMAGE__/linux-image-armmp/" | \ sed "s/__LINUX_IMAGE__/linux-image-armmp/" | \
grep -v "__EXTRA_PKGS__" | \ grep -v "__EXTRA_PKGS__" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-armmp\\/bcm*rpi*.dtb/" |\ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-armmp\\/bcm*rpi*.dtb/" |\
sed "s/__OTHER_APT_ENABLE__//" |\ sed "s/__OTHER_APT_ENABLE__//" |\
sed "s/__RELEASE__/buster/" |\
sed "s/__HOST__/rpi2/" > $@ sed "s/__HOST__/rpi2/" > $@
raspi_3_buster.yaml: raspi_master.yaml raspi_3_buster.yaml: raspi_base_buster.yaml
cat raspi_master.yaml | sed "s/__ARCH__/arm64/" | \ cat raspi_base_buster.yaml | sed "s/__ARCH__/arm64/" | \
sed "s/__LINUX_IMAGE__/linux-image-arm64/" | \ sed "s/__LINUX_IMAGE__/linux-image-arm64/" | \
sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\
sed "s/__OTHER_APT_ENABLE__//" |\ sed "s/__OTHER_APT_ENABLE__//" |\
sed "s/__RELEASE__/buster/" |\
sed "s/__HOST__/rpi3/" > $@ sed "s/__HOST__/rpi3/" > $@
raspi_4_buster.yaml: raspi_master.yaml raspi_4_buster.yaml: raspi_base_buster.yaml
cat raspi_master.yaml | sed "s/__ARCH__/arm64/" | \ cat raspi_base_buster.yaml | sed "s/__ARCH__/arm64/" | \
sed "s#raspi3-firmware#raspi-firmware/buster-backports#" | \ 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#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#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/__LINUX_IMAGE__/linux-image-arm64\/buster-backports/" | \
sed "s/__EXTRA_PKGS__/- firmware-brcm80211\/buster-backports/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211\/buster-backports/" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\ 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/__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/" > $@ sed "s/__HOST__/rpi4/" > $@
raspi_armel_bullseye.yaml: raspi_master.yaml raspi_base_bullseye.yaml: raspi_master.yaml
cat raspi_master.yaml | sed "s/__ARCH__/armel/" | \ 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/__LINUX_IMAGE__/linux-image-rpi/" | \
sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-rpi\\/bcm*rpi-*.dtb/" |\ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-rpi\\/bcm*rpi-*.dtb/" |\
sed "s/__RELEASE__/bullseye/" |\ sed "s/__HOST__/rpi_1/" > $@
grep -v "__OTHER_APT_ENABLE__" |\
sed -e '/debian-security/ s/deb/# Uncomment after Bullseye becomes stable → deb/' |\
sed "s/__HOST__/rpi-armel/" > $@
raspi_armhf_bullseye.yaml: raspi_master.yaml raspi_2_bullseye.yaml: raspi_base_bullseye.yaml
cat raspi_master.yaml | sed "s/__ARCH__/armhf/" | \ cat raspi_base_bullseye.yaml | sed "s/__ARCH__/armhf/" | \
sed "s/__LINUX_IMAGE__/linux-image-armmp/" | \ sed "s/__LINUX_IMAGE__/linux-image-armmp/" | \
grep -v "__EXTRA_PKGS__" | \ grep -v "__EXTRA_PKGS__" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-armmp\\/bcm*rpi*.dtb/" |\ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-armmp\\/bcm*rpi*.dtb/" |\
sed "s/__OTHER_APT_ENABLE__//" |\ sed "s/__HOST__/rpi_2/" > $@
sed "s/__RELEASE__/bullseye/" |\
sed -e '/debian-security/ s/deb/# Uncomment after Bullseye becomes stable → deb/' |\
sed "s/__HOST__/rpi-armhf/" > $@
raspi_arm64_bullseye.yaml: raspi_master.yaml raspi_3_bullseye.yaml: raspi_base_bullseye.yaml
cat raspi_master.yaml | sed "s/__ARCH__/arm64/" | \ cat raspi_base_bullseye.yaml | sed "s/__ARCH__/arm64/" | \
sed "s/__LINUX_IMAGE__/linux-image-arm64/" | \ sed "s/__LINUX_IMAGE__/linux-image-arm64/" | \
sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \ sed "s/__EXTRA_PKGS__/- firmware-brcm80211/" | \
sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\ sed "s/__DTB__/\\/usr\\/lib\\/linux-image-*-arm64\\/broadcom\\/bcm*rpi*.dtb/" |\
sed "s/__OTHER_APT_ENABLE__//" |\ sed "s/__HOST__/rpi_3/" > $@
sed "s/__RELEASE__/bullseye/" |\
sed -e '/debian-security/ s/deb/# Uncomment after Bullseye becomes stable → deb/' |\ raspi_4_bullseye.yaml: raspi_base_bullseye.yaml
sed "s/__HOST__/rpi-arm64/" > $@ 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 %.sha256: %.img.xz
echo $@ echo $@
@ -100,7 +106,7 @@ _ck_root:
[ `whoami` = 'root' ] # Only root can summon vmdb2 ☹ [ `whoami` = 'root' ] # Only root can summon vmdb2 ☹
_clean_yaml: _clean_yaml:
rm -f $(addsuffix .yaml,$(platforms)) rm -f $(addsuffix .yaml,$(platforms)) raspi_base_buster.yaml raspi_base_bullseye.yaml
_clean_images: _clean_images:
rm -f $(addsuffix .img,$(platforms)) rm -f $(addsuffix .img,$(platforms))
_clean_xzimages: _clean_xzimages: