uwu

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

commit 39952df6f53bdef258babae7eab4c416ca0b71da
parent 3d2af2a8d770f1432b8331c06b1a9f5d3a1c1395
Author: parazyd <parazyd@dyne.org>
Date:   Sat, 21 Nov 2020 14:34:48 +0100

Don't compress kernel and cpio archive.

Diffstat:
MMakefile | 14++++++++------
Mconfig.mk | 2+-
Mkernel.mk | 22+++++++++++-----------
Mrpi-boot/config.txt | 2+-
4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ include config.mk BINS = qemu-wrapper install-chroot.sh -BOOT_BINS = rpi-boot/zImage rpi-boot/bcm2835-rpi-zero.dtb +BOOT_BINS = rpi-boot/Image rpi-boot/bcm2835-rpi-zero.dtb all: $(BINS) $(BOOT_BINS) @@ -27,8 +27,8 @@ install-chroot.sh: install-chroot.sh.in -e 's,@ROOTCREDENTIALS@,$(ROOTCREDENTIALS),g' \ < $@.in > $@ -rpi-boot/zImage: $(KERNEL_BINS) - cp -f linux-5.8.18/arch/arm/boot/zImage $@ +rpi-boot/Image: $(KERNEL_BINS) + cp -f linux-5.8.18/arch/arm/boot/Image $@ rpi-boot/bcm2835-rpi-zero.dtb: $(KERNEL_BINS) cp -f linux-5.8.18/arch/arm/boot/dts/bcm2835-rpi-zero.dtb $@ @@ -38,9 +38,11 @@ $(IMAGE): $(BINS) $(BOOT_BINS) $(ALPINE_BINS) alpinechroot sudo cp -f $(QEMU_ARM) ./alpinechroot/$(QEMU_ARM) chmod 755 ./alpinechroot/qemu-wrapper chmod 755 ./alpinechroot/install-chroot.sh - sudo mount --rbind /dev ./alpinechroot/dev + sudo mount --types proc /proc ./alpinechroot/proc sudo mount --rbind /sys ./alpinechroot/sys - sudo mount -t proc /proc ./alpinechroot/proc + 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 \ @@ -48,7 +50,7 @@ $(IMAGE): $(BINS) $(BOOT_BINS) $(ALPINE_BINS) alpinechroot sudo mkdir -p ./alpinechroot/boot sudo cp -f rpi-boot/* ./alpinechroot/boot ( cd alpinechroot && sudo find . | \ - sudo cpio -oa --reproducible --format=newc | xz -v - > ../$@) + sudo cpio -oa --reproducible --format=newc > ../$@) clean: sudo rm -rf $(BINS) $(BOOT_BINS) qemu-wrapper.c $(IMAGE) alpinechroot diff --git a/config.mk b/config.mk @@ -3,7 +3,7 @@ # See LICENSE file for copyright and license details. VERSION = 0.1 -IMAGE = uwu-$(VERSION).cpio.gz +IMAGE = uwu-$(VERSION).cpio # 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 @@ -4,13 +4,13 @@ KERNEL_TAR = $(KERNEL_SRC).tar KERNEL_SIG = $(KERNEL_SRC).tar.sign +KERNEL_CFG = $(KERNEL_SRC)/config KERNEL_BINS = \ - $(KERNEL_SRC) $(KERNEL_TAR) $(KERNEL_SIG) \ - $(KERNEL_SRC)/arch/arm/configs/uwu_pizero_defconfig \ - $(KERNEL_SRC)/.config \ + $(KERNEL_SRC) $(KERNEL_TAR) $(KERNEL_SIG) $(KERNEL_CFG) \ $(KERNEL_SRC)/arch/arm/boot/dts/bcm2835-rpi-zero.dtb \ - $(KERNEL_SRC)/arch/arm/boot/zImage + $(KERNEL_SRC)/arch/arm/boot/Image + $(KERNEL_TAR): wget -c https://cdn.kernel.org/pub/linux/kernel/v5.x/$@.xz @@ -24,14 +24,14 @@ $(KERNEL_SRC): $(KERNEL_TAR) $(KERNEL_SIG) --verify $(KERNEL_SIG) tar xf $(KERNEL_SRC).tar -$(KERNEL_SRC)/arch/arm/configs/uwu_pizero_defconfig: $(KERNEL_SRC) - cp -f uwu_pizero_defconfig $@ - -$(KERNEL_SRC)/.config: $(KERNEL_SRC)/arch/arm/configs/uwu_pizero_defconfig +$(KERNEL_CFG): $(KERNEL_SRC) + cp -f uwu_pizero_defconfig $(KERNEL_SRC)/arch/arm/configs/ $(MAKE) -C $(KERNEL_SRC) ARCH=arm uwu_pizero_defconfig + # Hacky rule. I don't know how target/depend doesn't work with dotfiles. + cp -f $(KERNEL_SRC)/.config $@ -$(KERNEL_SRC)/arch/arm/boot/dts/bcm2835-rpi-zero.dtb: $(KERNEL_SRC)/.config +$(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/zImage: $(KERNEL_SRC)/arch/arm/boot/dts/bcm2835-rpi-zero.dtb - $(MAKE) -C $(KERNEL_SRC) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) zImage +$(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 diff --git a/rpi-boot/config.txt b/rpi-boot/config.txt @@ -1,4 +1,4 @@ -kernel=zImage +kernel=Image device_tree=bcm-2835-rpi-zero.dtb #avoid_warnings=2 gpu_mem=16