Add top-level Makefile
Building the OS is now as simple as running `make` on a Gentoo system. Interestingly, when `make` is executed as a (grand)child process of another `make` process, it always prints an `Entering directory ...` message. This breaks the `make kernelversion` command, by adding extraneous text to the output.
parent
b35ff1b85d
commit
8a2bb1666d
|
@ -1,3 +1,5 @@
|
||||||
/images
|
/images
|
||||||
/linux
|
/linux
|
||||||
/output
|
/output
|
||||||
|
/.prepared
|
||||||
|
/.host-tools
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
update.tar: output/update.tar.zstd
|
||||||
|
|
||||||
|
.prepared: \
|
||||||
|
prepare.sh \
|
||||||
|
config-portage.sh \
|
||||||
|
setup-local-repo.sh \
|
||||||
|
$(shell find portage host-portage -type f) \
|
||||||
|
$(shell find patches/ebuilds -type f)
|
||||||
|
./prepare.sh
|
||||||
|
./config-portage.sh
|
||||||
|
./setup-local-repo.sh
|
||||||
|
touch .prepared
|
||||||
|
|
||||||
|
prepare: .prepared
|
||||||
|
|
||||||
|
.host-tools: \
|
||||||
|
build-host-tools.sh \
|
||||||
|
.prepared
|
||||||
|
./build-host-tools.sh
|
||||||
|
touch .host-tools
|
||||||
|
|
||||||
|
host-tools: .host-tools
|
||||||
|
|
||||||
|
images/rootfs.squashfs: \
|
||||||
|
build.sh \
|
||||||
|
build-rootfs.sh \
|
||||||
|
build-squashfs.sh \
|
||||||
|
linux/arch/arm64/boot/Image.gz \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build.sh
|
||||||
|
./build-rootfs.sh
|
||||||
|
./build-squashfs.sh
|
||||||
|
|
||||||
|
squashfs: images/rootfs.squashfs
|
||||||
|
|
||||||
|
linux/arch/arm64/boot/Image.gz: \
|
||||||
|
build-kernel.sh \
|
||||||
|
linux.config \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build-kernel.sh
|
||||||
|
|
||||||
|
kernel: linux/arch/arm64/boot/Image.gz
|
||||||
|
|
||||||
|
output/efi-part/EFI/BOOT/BOOTAA64.efi: \
|
||||||
|
build-grub.sh \
|
||||||
|
grub.cfg \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build-grub.sh
|
||||||
|
|
||||||
|
grub: output/efi-part/EFI/BOOT/BOOTAA64.efi
|
||||||
|
|
||||||
|
output/efi-part/u-boot.bin: \
|
||||||
|
build-uboot.sh \
|
||||||
|
u-boot.config
|
||||||
|
./build-uboot.sh
|
||||||
|
|
||||||
|
uboot: output/efi-part/u-boot.bin
|
||||||
|
|
||||||
|
images/sdcard.img: \
|
||||||
|
genimage.cfg \
|
||||||
|
genimage.sh \
|
||||||
|
post-build.sh \
|
||||||
|
output/efi-part/u-boot.bin \
|
||||||
|
output/efi-part/EFI/BOOT/BOOTAA64.efi
|
||||||
|
./post-build.sh
|
||||||
|
./genimage.sh
|
||||||
|
|
||||||
|
sdcard.img: images/sdcard.img
|
||||||
|
|
||||||
|
images/firmware.img: images/sdcard.img
|
||||||
|
|
||||||
|
output/update.tar.zstd: \
|
||||||
|
images/rootfs.squashfs \
|
||||||
|
images/firmware.img \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build-update.sh
|
||||||
|
|
||||||
|
clean:
|
||||||
|
git -C u-boot clean -fdx && git -C u-boot checkout -- .
|
||||||
|
rm -rf linux output images tmp
|
||||||
|
rm -f .prepared .host-tools
|
||||||
|
|
||||||
|
.PHONY: \
|
||||||
|
grub \
|
||||||
|
host-tools \
|
||||||
|
kernel \
|
||||||
|
prepare \
|
||||||
|
sdcard.img \
|
||||||
|
squashfs \
|
||||||
|
uboot \
|
||||||
|
update.tar
|
|
@ -15,11 +15,11 @@ cd linux
|
||||||
../linux.config
|
../linux.config
|
||||||
make -C /usr/src/linux O=${PWD} olddefconfig
|
make -C /usr/src/linux O=${PWD} olddefconfig
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
kver=$(make kernelversion)
|
kver=$(make -s kernelversion)
|
||||||
make modules_install INSTALL_MOD_PATH=/mnt/gentoo
|
make modules_install INSTALL_MOD_PATH=/mnt/gentoo
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
printf 'Installing Kernel ...\n'
|
printf 'Installing Kernel %s ...\n' "${kver}"
|
||||||
mkdir -p /mnt/gentoo/boot
|
mkdir -p /mnt/gentoo/boot
|
||||||
cp -au linux/arch/arm64/boot/Image.gz /mnt/gentoo/boot/vmlinuz-${kver}
|
cp -au linux/arch/arm64/boot/Image.gz /mnt/gentoo/boot/vmlinuz-${kver}
|
||||||
cp -au linux/.config /mnt/gentoo/boot/config-${kver}
|
cp -au linux/.config /mnt/gentoo/boot/config-${kver}
|
||||||
|
|
|
@ -22,7 +22,7 @@ cid=$(podman run \
|
||||||
|
|
||||||
./patch-uboot.sh
|
./patch-uboot.sh
|
||||||
|
|
||||||
podman exec -it ${cid} ./build-all.sh "${target}"
|
podman exec -it ${cid} make
|
||||||
|
|
||||||
podman stop ${cid}
|
podman stop ${cid}
|
||||||
podman rm ${cid}
|
podman rm ${cid}
|
||||||
|
|
Loading…
Reference in New Issue