aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-02-05 19:13:08 +0100
committerlonkaars <loek@pipeframe.xyz>2024-02-05 19:13:08 +0100
commitb854e8abb7e1ff0b43c9f99e9b641895e4d6c148 (patch)
treeab8061666835221d155cfb259559752353c8a2e9 /makefile
parent2a218ea1205c8dd547b742931290058def5de85f (diff)
WIP busybox
Diffstat (limited to 'makefile')
-rw-r--r--makefile22
1 files changed, 15 insertions, 7 deletions
diff --git a/makefile b/makefile
index d6fe483..5a9886a 100644
--- a/makefile
+++ b/makefile
@@ -26,7 +26,7 @@ include ./env
export
.PHONY: all
-all:
+all: load_boot load_rootfs
.PHONY: sd_format sd_partition
sd_format: state/sdcard_fmt
@@ -52,7 +52,6 @@ state/sdcard_fmt: state/sdcard_part
bootloader/.config: state/submodules state/container_img
$(CTRIZE) $(MAKE) -C bootloader am335x_evm_config
-.PHONY: build_bootloader
build_bootloader: bootloader/.config state/container_img
$(CTRIZE) $(MAKE) -C bootloader
uboot.env: uboot.txt
@@ -66,13 +65,22 @@ $(BOOTLOADER_FILES): build_bootloader
kernel/.config: state/submodules state/container_img
$(CTRIZE) $(MAKE) -C kernel bb.org_defconfig
-.PHONY: build_kernel
build_kernel: kernel/.config state/container_img
$(CTRIZE) $(MAKE) -C kernel zImage am335x-boneblack.dtb
KERNEL_FILES += kernel/arch/$(ARCH)/boot/dts/am335x-boneblack.dtb
KERNEL_FILES += kernel/arch/$(ARCH)/boot/zImage
$(KERNEL_FILES): build_kernel
+busybox/.config: state/submodules state/container_img
+ $(CTRIZE) $(MAKE) -C busybox defconfig
+ sed -i 's/^[# ]*CONFIG_STATIC\>.*$$/CONFIG_STATIC=y/' $@
+ sed -i 's/^[# ]*CONFIG_PREFIX\>.*$$/CONFIG_PREFIX=".\/rootfs"/' $@
+busybox/busybox: busybox/.config state/container_img
+ $(CTRIZE) $(MAKE) -C busybox
+busybox/_install: busybox/busybox state/container_img
+ $(CTRIZE) $(MAKE) -C busybox install
+build_busybox: busybox/busybox
+
# NOTE: ordering is important!
FILES_PART_BOOT += $(BOOTLOADER_FILES)
FILES_PART_BOOT += $(KERNEL_FILES)
@@ -84,12 +92,12 @@ load_boot: $(FILES_PART_BOOT) state/sdcard_fmt
$(AS_ROOT) sync
$(AS_ROOT) umount mnt/boot
-# TODO
-# FILES_PART_ROOTFS += ....
-load_rootfs: state/sdcard_fmt
+FILES_PART_ROOTFS += $(shell find rootfs)
+FILES_PART_ROOTFS += busybox/rootfs
+load_rootfs: $(FILES_PART_ROOTFS) state/sdcard_fmt
mkdir -p mnt/rootfs
$(AS_ROOT) mount $(SDCARD_PART_ROOTFS) mnt/rootfs
- $(AS_ROOT) cp $(FILES_PART_ROOTFS) mnt/boot
+ $(AS_ROOT) util/mkrootfs mnt/rootfs
$(AS_ROOT) sync
$(AS_ROOT) umount mnt/rootfs