commit 95cc5b65a46e71837337f5cb423091af90fd78e7
parent 325b079f8ac8a3831f53be629ad9b14484cb00a2
Author: parazyd <parazyd@dyne.org>
Date: Sat, 21 Nov 2020 19:10:12 +0100
Makefile cleanups.
Diffstat:
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/Makefile b/Makefile
@@ -6,15 +6,15 @@
include config.mk
-BINS = qemu-wrapper install-chroot.sh
+BINS = qemu-wrapper install.sh
BOOT_BINS = rpi-boot/Image rpi-boot/bcm2835-rpi-zero.dtb
all: $(BINS) $(BOOT_BINS)
image: all $(IMAGE)
-include kernel.mk
include alpine.mk
+include kernel.mk
qemu-wrapper.c:
sed -e 's,@QEMU_ARM@,$(QEMU_ARM),g' < $@.in > $@
@@ -22,7 +22,7 @@ qemu-wrapper.c:
qemu-wrapper: qemu-wrapper.c
gcc -static $@.c -O3 -s -o $@
-install-chroot.sh: install-chroot.sh.in
+install.sh: install.sh.in
sed -e 's,@USERCREDENTIALS@,$(USERCREDENTIALS),g' \
-e 's,@ROOTCREDENTIALS@,$(ROOTCREDENTIALS),g' \
< $@.in > $@
@@ -33,27 +33,27 @@ rpi-boot/Image: $(KERNEL_BINS)
rpi-boot/bcm2835-rpi-zero.dtb: $(KERNEL_BINS)
cp -f linux-5.8.18/arch/arm/boot/dts/bcm2835-rpi-zero.dtb $@
-$(IMAGE): $(BINS) $(BOOT_BINS) $(ALPINE_BINS) alpinechroot
- cp -f $(BINS) ./alpinechroot
- sudo cp -f $(QEMU_ARM) ./alpinechroot/$(QEMU_ARM)
- chmod 755 ./alpinechroot/qemu-wrapper
- chmod 755 ./alpinechroot/install-chroot.sh
- sudo mount --types proc /proc ./alpinechroot/proc
- sudo mount --rbind /sys ./alpinechroot/sys
- sudo mount --make-rslave ./alpinechroot/sys
- sudo mount --rbind /dev ./alpinechroot/dev
- sudo mount --make-rslave ./alpinechroot/dev
- sudo chroot ./alpinechroot /install-chroot.sh
- sudo umount -R ./alpinechroot/dev ./alpinechroot/sys ./alpinechroot/proc
- sudo rm -f ./alpinechroot/install-chroot.sh \
- ./alpinechroot/qemu-wrapper ./alpinechroot/$(QEMU_ARM)
- sudo mkdir -p ./alpinechroot/boot
- sudo cp -f rpi-boot/* ./alpinechroot/boot
- ( cd alpinechroot && sudo find . | \
+$(IMAGE): $(BINS) $(BOOT_BINS) $(ALPINE_BINS) ch
+ cp -f $(BINS) ./ch
+ sudo cp -f $(QEMU_ARM) ./ch/$(QEMU_ARM)
+ chmod 755 ./ch/qemu-wrapper
+ chmod 755 ./ch/install.sh
+ sudo mount --types proc /proc ./ch/proc
+ sudo mount --rbind /sys ./ch/sys
+ sudo mount --make-rslave ./ch/sys
+ sudo mount --rbind /dev ./ch/dev
+ sudo mount --make-rslave ./ch/dev
+ sudo chroot ./ch /install.sh || sudo umount -R ./ch/dev ./ch/sys ./ch/proc
+ sudo umount -R ./ch/dev ./ch/sys ./ch/proc
+ sudo rm -f ./ch/install.sh \
+ ./ch/qemu-wrapper ./ch/$(QEMU_ARM)
+ sudo mkdir -p ./ch/boot
+ sudo cp -f rpi-boot/* ./ch/boot
+ ( cd ch && sudo find . | \
sudo cpio -oa --reproducible --format=newc > ../$@)
clean:
- sudo rm -rf $(BINS) $(BOOT_BINS) qemu-wrapper.c $(IMAGE) alpinechroot
+ sudo rm -rf $(BINS) $(BOOT_BINS) qemu-wrapper.c $(IMAGE) ch
distclean: clean
rm -rf $(KERNEL_BINS) $(ALPINE_BINS)
diff --git a/alpine.mk b/alpine.mk
@@ -17,7 +17,7 @@ $(ALPINE_SIG):
$(ALPINE_SHA):
wget -c https://nl.alpinelinux.org/alpine/v$(ALPINE_MAJ)/releases/armhf/$(ALPINE_SHA)
-alpinechroot: $(ALPINE_BINS)
+ch: $(ALPINE_BINS)
sha256sum -c $(ALPINE_SHA)
gpg --no-default-keyring --keyring=./verification_keyring.gpg \
--verify $(ALPINE_SIG)