alpine-zdt-images/scripts/setup-tiny
Stefan Reimer 97f9193bcd Squashed 'alpine-cloud-images/' changes from 99474a8..190e7f0
190e7f0 Merge branch 'main' of https://gitlab.alpinelinux.org/alpine/cloud/alpine-cloud-images
dd0e7b2 filter out non-tiny bootstrap images
7ac2029 Minor Fixes
5e89670 always apk upgrade builder VM, fix --clean of symlinked dirs
3399bde Fine tune apk upgrade

git-subtree-dir: alpine-cloud-images
git-subtree-split: 190e7f014539314b2ab29bd92156eec933da785f
2022-03-21 12:57:04 +01:00

22 lines
581 B
Bash
Executable File

#!/bin/sh -eu
# vim: ts=4 et:
[ -z "$DEBUG" ] || [ "$DEBUG" = 0 ] || set -x
TARGET=/mnt
einfo() {
printf '\n\033[1;7;36m> %s <\033[0m\n' "$@" >&2 # bold reversed cyan
}
if [ "$VERSION" = "3.12" ]; then
# tiny-cloud-network requires ifupdown-ng, not in 3.12
einfo "Configuring Tiny EC2 Bootstrap..."
echo "EC2_USER=$IMAGE_LOGIN" > /etc/conf.d/tiny-ec2-bootstrap
else
einfo "Configuring Tiny Cloud..."
sed -i.bak -Ee "s/^#?CLOUD_USER=.*/CLOUD_USER=$IMAGE_LOGIN/" \
"$TARGET"/etc/conf.d/tiny-cloud
rm "$TARGET"/etc/conf.d/tiny-cloud.bak
fi