Replace the sed maze with one generate-recipe call for each combination.
This commit is contained in:
parent
1410839911
commit
0f8884c39c
102
Makefile
102
Makefile
|
@ -24,101 +24,13 @@ endif
|
||||||
target_platforms:
|
target_platforms:
|
||||||
@echo $(platforms)
|
@echo $(platforms)
|
||||||
|
|
||||||
raspi_base_buster.yaml: raspi_master.yaml
|
# Generate targets based on all family * release combinations:
|
||||||
cat raspi_master.yaml | \
|
define dynamic_yaml_target =
|
||||||
sed "s/__FIRMWARE_PKG__/raspi3-firmware/" | \
|
raspi_$(1)_$(2).yaml: raspi_master.yaml generate-recipe.py
|
||||||
sed "s/__RELEASE__/buster/" |\
|
raspi_$(1)_$(2).yaml:
|
||||||
sed "s/__SECURITY_SUITE__/buster\/updates/" |\
|
./generate-recipe.py $(1) $(2)
|
||||||
sed "s/__FIX_FIRMWARE_PKG_NAME__/sed -i s\/raspi-firmware\/raspi3-firmware\/ \$${ROOT?}\/etc\/systemd\/system\/rpi-reconfigure-raspi-firmware.service/" |\
|
endef
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
$(foreach release,$(BUILD_RELEASES),$(foreach family,$(BUILD_FAMILIES),$(eval $(call dynamic_yaml_target,$(family),$(release)))))
|
||||||
|
|
||||||
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/__SERIAL_CONSOLE__/ttyAMA0,115200/" |\
|
|
||||||
grep -v "__OTHER_APT_ENABLE__" |\
|
|
||||||
sed "s/__HOST__/rpi1/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
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/__SERIAL_CONSOLE__/ttyAMA0,115200/" |\
|
|
||||||
sed "s/__OTHER_APT_ENABLE__//" |\
|
|
||||||
sed "s/__HOST__/rpi2/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
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/__SERIAL_CONSOLE__/ttyS1,115200/" |\
|
|
||||||
sed "s/__OTHER_APT_ENABLE__//" |\
|
|
||||||
sed "s/__HOST__/rpi3/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
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#\(RASPIROOT.*cmdline.txt\)#\1\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/__SERIAL_CONSOLE__/ttyS1,115200/" |\
|
|
||||||
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/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
raspi_base_bullseye.yaml: raspi_master.yaml
|
|
||||||
cat raspi_master.yaml | \
|
|
||||||
sed "s/__RELEASE__/bullseye/" |\
|
|
||||||
sed "s/__FIRMWARE_PKG__/raspi-firmware/" | \
|
|
||||||
grep -v "__OTHER_APT_ENABLE__" |\
|
|
||||||
grep -v "__FIX_FIRMWARE_PKG_NAME__" |\
|
|
||||||
sed "s/__SECURITY_SUITE__/bullseye-security/" > $@
|
|
||||||
|
|
||||||
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/__SERIAL_CONSOLE__/ttyAMA0,115200/" |\
|
|
||||||
sed "s/__HOST__/rpi_1/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
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/__SERIAL_CONSOLE__/ttyAMA0,115200/" |\
|
|
||||||
sed "s/__HOST__/rpi_2/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
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/__SERIAL_CONSOLE__/ttyS1,115200/" |\
|
|
||||||
sed "s/__HOST__/rpi_3/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
raspi_4_bullseye.yaml: raspi_base_bullseye.yaml
|
|
||||||
cat raspi_base_bullseye.yaml | sed "s/__ARCH__/arm64/" | \
|
|
||||||
sed "s#\(RASPIROOT.*cmdline.txt\)#\1\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/__SERIAL_CONSOLE__/ttyS1,115200/" |\
|
|
||||||
sed "s/__HOST__/rpi_4/" |\
|
|
||||||
grep -v '__EXTRA_SHELL_CMDS__' > $@
|
|
||||||
|
|
||||||
%.img.sha256: %.img
|
%.img.sha256: %.img
|
||||||
echo $@
|
echo $@
|
||||||
|
|
Loading…
Reference in New Issue