uwu

hardware bitcoin wallet software and build system
git clone https://git.parazyd.org/uwu
Log | Files | Refs | README | LICENSE

commit e891008ba4f1caf396ac65c127d1a7bf6f2bf8d2
parent 76685eac09e017c4ea2fffe1934f797d42baa8cf
Author: parazyd <parazyd@dyne.org>
Date:   Fri, 27 Nov 2020 13:27:07 +0100

Use the valid "upstream_kernel" setting and install kernel and dtb.

Diffstat:
MMakefile | 14+++++++++-----
Mconfig.mk | 3+++
Mkernel.mk | 6+++---
3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ include config.mk BINS = qemu-wrapper install.sh -BOOT_BINS = rpi-boot/Image rpi-boot/bcm2835-rpi-zero.dtb +BOOT_BINS = rpi-boot/upstream/kernel.img rpi-boot/upstream/bcm2835-rpi-zero.dtb all: $(BINS) $(BOOT_BINS) @@ -27,10 +27,10 @@ install.sh: install.sh.in -e 's,@ROOTCREDENTIALS@,$(ROOTCREDENTIALS),g' \ < $@.in > $@ -rpi-boot/Image: $(KERNEL_BINS) - cp -f linux-5.8.18/arch/arm/boot/Image $@ +rpi-boot/upstream/kernel.img: $(KERNEL_BINS) + cp -f linux-5.8.18/arch/arm/boot/zImage $@ -rpi-boot/bcm2835-rpi-zero.dtb: $(KERNEL_BINS) +rpi-boot/upstream/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) ch @@ -47,7 +47,11 @@ $(IMAGE): $(BINS) $(BOOT_BINS) $(ALPINE_BINS) ch sudo umount -R ./ch/proc ./ch/sys ./ch/dev sudo rm -f ./ch/install.sh ./ch/qemu-wrapper ./ch/$(QEMU_ARM) sudo mkdir -p ./ch/boot - sudo cp -f rpi-boot/* ./ch/boot + sudo cp -r rpi-boot/* ./ch/boot +ifneq ($(DEBUG),) + sudo sed -e 's/BOOT_UART=0/BOOT_UART=1/' -i ./ch/boot/bootcode.bin + sudo sed -e 's/enable_uart=0/enable_uart=1/' -i ./ch/boot/config.txt +endif ( cd ch && sudo find . | sudo cpio -oa --reproducible --format=newc > ../$@) clean: diff --git a/config.mk b/config.mk @@ -5,6 +5,9 @@ VERSION = 0.1 IMAGE = uwu-$(VERSION).cpio +# Uncomment to enable certain things useful for debugging +DEBUG = 1 + # System path to qemu-arm binary used to emulate ARM ELFs in the chroot QEMU_ARM = /usr/bin/qemu-arm diff --git a/kernel.mk b/kernel.mk @@ -9,7 +9,7 @@ KERNEL_CFG = $(KERNEL_SRC)/config KERNEL_BINS = \ $(KERNEL_SRC) $(KERNEL_TAR) $(KERNEL_SIG) $(KERNEL_CFG) \ $(KERNEL_SRC)/arch/arm/boot/dts/bcm2835-rpi-zero.dtb \ - $(KERNEL_SRC)/arch/arm/boot/Image + $(KERNEL_SRC)/arch/arm/boot/zImage $(KERNEL_TAR): @@ -36,5 +36,5 @@ $(KERNEL_CFG): $(KERNEL_SRC) $(KERNEL_SRC)/arch/arm/boot/dts/bcm2835-rpi-zero.dtb: $(KERNEL_CFG) $(MAKE) -C $(KERNEL_SRC) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) bcm2835-rpi-zero.dtb -$(KERNEL_SRC)/arch/arm/boot/Image: $(KERNEL_SRC)/arch/arm/boot/dts/bcm2835-rpi-zero.dtb - $(MAKE) -C $(KERNEL_SRC) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) Image +$(KERNEL_SRC)/arch/arm/boot/zImage: $(KERNEL_SRC)/arch/arm/boot/dts/bcm2835-rpi-zero.dtb + $(MAKE) -C $(KERNEL_SRC) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) zImage