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 ```
32 lines
556 B
Bash
Executable File
32 lines
556 B
Bash
Executable File
#!/bin/sh
|
|
# vim: set sw=4 ts=4 sts=4 et :
|
|
|
|
set -e
|
|
|
|
cleanup() {
|
|
if [ -n "${tmproot}" ]; then
|
|
if [ "${tmproot}" != / ]; then
|
|
rm -rf "${tmproot}"
|
|
fi
|
|
unset tmproot
|
|
fi
|
|
}
|
|
|
|
. "${CONFIGDIR:=${PWD}}"/config
|
|
|
|
O="${1}"
|
|
IMAGESDIR="${2}"
|
|
|
|
trap cleanup INT TERM QUIT EXIT
|
|
tmproot=$(mktemp -d)
|
|
tmppath=$(mktemp -d)
|
|
|
|
cd "${O}"
|
|
genimage \
|
|
--rootpath "${tmproot}" \
|
|
--tmppath "${tmppath}" \
|
|
--inputpath "${IMAGESDIR}" \
|
|
--outputpath "${IMAGESDIR}" \
|
|
--mkdosfs mkfs.vfat \
|
|
--config "${OLDPWD}"/genimage.cfg
|