add note about 'sudo'/root and variable for image name
This commit is contained in:
parent
a9d06b116b
commit
c2181a4784
1 changed files with 14 additions and 3 deletions
|
|
@ -4,7 +4,18 @@ GIT_BRANCH=$(git branch --show-current 2>/dev/null)
|
|||
GIT_TAG=$(git tag 2>/dev/null | tail -n1)
|
||||
BUILD_DATE=$(date +"%d%m%y")
|
||||
SUFFIX="${GIT_BRANCH}_${GIT_TAG}_${BUILD_DATE}"
|
||||
time vmdb2 --rootfs-tarball=raspi4_$SUFFIX.tar.gz --output raspi4_butter_$SUFFIX.img --log raspi4_butter_$SUFFIX.log raspi_4_trixie.yaml
|
||||
tar cvfz raspi4_butter_$SUFFIX.img.tar.gz raspi4_butter_$SUFFIX.img
|
||||
#curl -H "Authorization: token" $CHURN_SECRET -X PUT --upload-file raspi4_butter_$SUFFIX.img.tar.gz https://guardianproject.dev/api/packages/butter/generic/churn/latest/raspi4_butter_$SUFFIX.img.tar.gz
|
||||
IMAGENAME="raspi4_butter"
|
||||
# This recipe builds an arm64 image. On a non-arm64 host, debootstrap's second
|
||||
# stage runs arm64 binaries via QEMU user-mode emulation, which requires the
|
||||
# aarch64 binfmt_misc handler to be registered. Fail fast with a clear message
|
||||
# instead of dying ~5 minutes into debootstrap.
|
||||
if [ "$(uname -m)" != "aarch64" ] && ! grep -q enabled /proc/sys/fs/binfmt_misc/qemu-aarch64 2>/dev/null; then
|
||||
echo "ERROR: arm64 emulation not registered. Run: sudo apt install qemu-user-static binfmt-support" >&2
|
||||
exit 1
|
||||
fi
|
||||
time vmdb2 --rootfs-tarball=${IMAGENAME}_$SUFFIX.tar.gz --output ${IMAGENAME}_$SUFFIX.img --log ${IMAGENAME}_$SUFFIX.log raspi_4_trixie.yaml
|
||||
# vmdb2 runs as root, so the output files are root-owned; hand them back to the calling user
|
||||
chown "$(id -un):$(id -gn)" ${IMAGENAME}_$SUFFIX.img ${IMAGENAME}_$SUFFIX.log
|
||||
tar cvfz ${IMAGENAME}_$SUFFIX.img.tar.gz ${IMAGENAME}_$SUFFIX.img
|
||||
#curl -H "Authorization: token" $CHURN_SECRET -X PUT --upload-file ${IMAGENAME}_$SUFFIX.img.tar.gz https://guardianproject.dev/api/packages/butter/generic/churn/latest/${IMAGENAME}_$SUFFIX.img.tar.gz
|
||||
#rm *img *tar.gz
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue