xrsh-buildroot/build.sh

26 lines
535 B
Bash
Executable File

#!/usr/bin/env bash
set -x
test "$1" = "--edit" && {
EDIT="-ti -v $PWD/edit.sh:/root/edit.sh --entrypoint bash"
}
#-v $PWD/cache:/root/buildroot-2021.02-rc2/output
test -d dist || mkdir dist
test -d cache || mkdir cache
rm -rf cache/*
OCI=$(which podman || which docker)
$OCI images | grep buildroot || $OCI build -t buildroot .
#$OCI --conmon /usr/bin/false run \
$OCI run \
--name build-v86 \
-v $PWD/dist:/build \
-v $PWD/buildroot-v86/:/buildroot-v86 ${EDIT} \
buildroot
echo "See ./dist for built ISO"