armbian_amlogic_s905x/makefile

58 lines
1.6 KiB
Makefile
Raw Permalink Normal View History

2024-04-20 19:32:26 +02:00
rel := https://github.com/armbian/community/releases/download/24.5.0-trunk.433/Armbian_community_24.5.0-trunk.433_Aml-s9xx-box_bookworm_current_6.6.28_minimal.img.xz
sig := https://github.com/armbian/community/releases/download/24.5.0-trunk.433/Armbian_community_24.5.0-trunk.433_Aml-s9xx-box_bookworm_current_6.6.28_minimal.img.xz.asc
2024-04-20 16:04:18 +02:00
image := $(shell echo $(rel) | sed 's/.*\///')
raw := $(shell echo $(image) | sed 's/\.xz//')
2024-04-20 19:32:26 +02:00
git := $(shell git rev-parse --short HEAD)
2024-04-20 16:04:18 +02:00
$(image):
2024-04-20 19:32:26 +02:00
curl -L -O $(rel)
curl -L -O $(sig)
2024-04-20 16:04:18 +02:00
verify: $(image) $(image).asc
gpg --verify $(image).asc $(image)
$(raw): $(image)
xz -dk $(image)
mount: $(raw) umount
mkdir -p ./rootfs
mkdir -p ./boot
sudo losetup /dev/loop1337 $(raw)
sudo partprobe /dev/loop1337
sudo mount /dev/loop1337p2 ./rootfs
sudo mount /dev/loop1337p1 ./boot
2024-04-20 16:53:06 +02:00
# Armbian signing keys
2024-04-20 16:04:18 +02:00
get-keys:
gpg --recv-keys DF00FAF1C577104B50BF1D0093D6889F9F0E78D5
umount:
-sudo umount -f ./rootfs
-sudo umount -f ./boot
-sudo losetup -d /dev/loop1337
2024-04-20 16:53:06 +02:00
uboot: mount
sudo cp boot/u-boot-s905x-s912 boot/u-boot.ext
extlinux: uboot
2024-04-20 19:32:26 +02:00
sudo sed -i '4iFDT /dtb/amlogic/meson-gxl-s905x-p212.dtb' boot/extlinux/extlinux.conf
2024-04-20 16:53:06 +02:00
2024-04-20 19:32:26 +02:00
armbian-$(git).img.zst: extlinux
2024-04-20 16:53:06 +02:00
sudo dd if=/dev/loop1337 bs=1M | zstd -10 -fo $@
2024-04-20 19:32:26 +02:00
build: armbian-$(git).img.zst
2024-04-20 16:53:06 +02:00
2024-04-20 19:32:26 +02:00
sign: armbian-$(git).img.zst
2024-04-20 16:53:06 +02:00
minisign -Sm $<
# Imbus personal key
2024-04-20 19:32:26 +02:00
verify-build:
2024-04-20 16:53:06 +02:00
minisign -Vm armbian.img.zst -P RWRzPhin2brRy61x/adSOnFyhdWRkC0i37VJrOrFjMy6M073Mdu7gZXO
2024-04-20 16:04:18 +02:00
clean: umount
rm -f $(image) $(raw) $(image).asc $(readme) $(sig) $(sums) armbian.img *.txt *.sha
2024-04-20 16:53:06 +02:00
rm -f armbian.img.zst armbian.img.zst.minisig
2024-04-20 16:04:18 +02:00
-rmdir ./rootfs
-rmdir ./boot