From d117207bd23ba63447dcda1874af3ee7e0173312 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 5 Dec 2024 20:06:42 -0600 Subject: [PATCH] Make more project config files optional `build.packages`, `installonly.packages`, and `busybox.symlinks` are now optional in the `$CONFIGDIR`. If they do exist, they are combined with the same files in the Aimee OS source. --- Makefile | 6 ++--- build-rootfs.sh | 19 +++++++++------ busybox.symlinks | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 busybox.symlinks diff --git a/Makefile b/Makefile index 531551f..f3ea64e 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ $(O)/.built: \ build.sh \ build.packages \ install.packages \ - $(CONFIGDIR)/build.packages \ + $(wildcard $(CONFIGDIR)/build.packages) \ $(CONFIGDIR)/install.packages \ $(shell find $(CONFIGDIR)/portage/target -type f) \ $(O)/.prepared @@ -38,8 +38,8 @@ $(O)/.ready: \ build-rootfs.sh \ install.packages \ $(CONFIGDIR)/install.packages \ - $(CONFIGDIR)/installonly.packages \ - $(CONFIGDIR)/busybox.symlinks \ + $(wildcard $(CONFIGDIR)/installonly.packages) \ + $(wildcard $(CONFIGDIR)/busybox.symlinks) \ $(O)/linux/arch/arm64/boot/Image.gz \ $(O)/semanage.mods \ $(shell find overlay -type f) \ diff --git a/build-rootfs.sh b/build-rootfs.sh index c8d64ff..f232b2c 100755 --- a/build-rootfs.sh +++ b/build-rootfs.sh @@ -33,11 +33,13 @@ ${target}-emerge \ -KvnuUDj \ --rebuilt-binaries=y -< "${CONFIGDIR}"/installonly.packages xargs -ro \ -${target}-emerge \ - --root=/mnt/gentoo \ - --config-root="${CONFIGDIR}"/portage/target \ - -vnuUDj +if [ -f "${CONFIGDIR}"/installonly.packages ]; then + < "${CONFIGDIR}"/installonly.packages xargs -ro \ + ${target}-emerge \ + --root=/mnt/gentoo \ + --config-root="${CONFIGDIR}"/portage/target \ + -vnuUDj +fi ROOT=/mnt/gentoo \ locale-gen @@ -52,13 +54,16 @@ mkdir -p \ : > /mnt/gentoo/etc/machine-id -while read name; do +cat \ + "${CONFIGDIR}"/busybox.symlinks \ + busybox.symlinks \ +| while read name; do if [ ! -h /mnt/gentoo/bin/"${name}" ]; then printf "'/bin/%s' -> 'busybox'\n" "${name}" ln -snf busybox /mnt/gentoo/bin/"${name}" \ || printf 'Failed to create busybox symlink for %s\n' "${name}" fi -done < "${CONFIGDIR}"/busybox.symlinks +done rsync -rltpDO overlay/ /mnt/gentoo/ if [ -d "${CONFIGDIR}"/overlay ]; then diff --git a/busybox.symlinks b/busybox.symlinks new file mode 100644 index 0000000..4994e8c --- /dev/null +++ b/busybox.symlinks @@ -0,0 +1,62 @@ +basename +cat +chcon +cp +dd +df +du +echo +env +false +free +fsync +fuser +grep +groups +head +id +install +ip +kill +less +link +ln +ls +lsof +mkdir +mkfifo +mktemp +mv +nice +nproc +pgrep +ping +ping6 +pkill +ppidof +printf +ps +readahead +readlink +realpath +rm +rmdir +sed +seq +sh +sha1sum +sha256sum +sha3sum +sha512sum +sort +stat +stty +sync +tac +tail +tar +tee +truncate +tty +uname +uptime