build: Implement CONFIGDIR setting
In effort to support different builds of Aimee OS using the same scripts, without necessarily having to fork this repository, the build system now supports a `CONFIGDIR` setting. When this variable is set, files defining the target environment, such as the lists of packages to install, the kernel configuration, the Portage configuration, etc. are found in the path it specifes. The reference build, for the Home Assistant Yellow board, is configured in the `yellow` directory. To build it, run: ```sh CONFIGDIR=yellow ./vm-build.sh ```
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
. ./config
|
||||
. "${CONFIGDIR:=${PWD}}"/config
|
||||
|
||||
mkdir -p \
|
||||
/mnt/gentoo/usr/bin \
|
||||
@@ -20,16 +20,15 @@ mkdir -p /mnt/gentoo/etc/portage
|
||||
ln -snf \
|
||||
/var/db/repos/gentoo/profiles/${profile} \
|
||||
/mnt/gentoo/etc/portage/make.profile
|
||||
cp -r portage/. /mnt/gentoo/etc/portage/
|
||||
|
||||
ROOT=/mnt/gentoo \
|
||||
PORTAGE_CONFIGROOT="${PWD}"/portage/config/target \
|
||||
< install.packages xargs -ro \
|
||||
PORTAGE_CONFIGROOT="${CONFIGDIR}"/portage/target \
|
||||
< "${CONFIGDIR}"/install.packages xargs -ro \
|
||||
${target}-emerge -KvnuUDj --rebuilt-binaries=y
|
||||
|
||||
ROOT=/mnt/gentoo \
|
||||
PORTAGE_CONFIGROOT="${PWD}"/portage/config/target \
|
||||
< installonly.packages xargs -ro \
|
||||
PORTAGE_CONFIGROOT="${CONFIGDIR}"/portage/target \
|
||||
< "${CONFIGDIR}"/installonly.packages xargs -ro \
|
||||
${target}-emerge -vnuUDj
|
||||
|
||||
ROOT=/mnt/gentoo \
|
||||
@@ -51,9 +50,12 @@ while read name; do
|
||||
ln -snf busybox /mnt/gentoo/bin/"${name}" \
|
||||
|| printf 'Failed to create busybox symlink for %s\n' "${name}"
|
||||
fi
|
||||
done < busybox.symlinks
|
||||
done < "${CONFIGDIR}"/busybox.symlinks
|
||||
|
||||
rsync -rltpDO overlay/ /mnt/gentoo/
|
||||
if [ -d "${CONFIGDIR}"/overlay ]; then
|
||||
rsync -rltpDO "${CONFIGDIR}"/overlay/ /mnt/gentoo/
|
||||
fi
|
||||
|
||||
cp -uv /usr/${target}/usr/bin/grub-editenv /mnt/gentoo/usr/bin/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user