Merge commit '469804206a51674d2e512ca523e2a3bf74de2b14'

This commit is contained in:
Stefan Reimer 2023-06-21 14:25:52 +00:00
commit 6152828797
7 changed files with 61 additions and 13 deletions

View File

@ -55,10 +55,10 @@ Default {
# profile build matrix
Dimensions {
version {
"3.18" { include required("version/3.17.conf") }
"3.17" { include required("version/3.17.conf") }
"3.16" { include required("version/3.16.conf") }
"3.15" { include required("version/3.15.conf") }
"3.14" { include required("version/3.14.conf") }
edge { include required("version/edge.conf") }
}
arch {

View File

@ -12,6 +12,19 @@ packages {
openssh-server-pam = true
e2fsprogs-extra = true # for resize2fs
}
WHEN.nocloud {
# fix for "failed to mount /dev/sr0 when looking for data"
# @see https://git.alpinelinux.org/aports/tree/community/cloud-init/README.Alpine
packages.mount = true
WHEN {
"3.15 3.16" {
packages.mount = null
packages.util-linux-misc = true
}
}
}
services.default.cloud-init-hotplugd = true
scripts = [ setup-cloudinit ]

View File

@ -3,23 +3,22 @@ name = [tiny]
bootstrap_name = Tiny Cloud
bootstrap_url = "https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud"
services {
sysinit.tiny-cloud-early = true
default.tiny-cloud = true
default.tiny-cloud-final = true
}
WHEN {
"3.13 3.14 3.15 3.16 3.17" {
# tiny-cloud < 3.0.0 doesn't have --setup option
boot.tiny-cloud-early = true
default.tiny-cloud = true
default.tiny-cloud-final = true
}
aws {
packages.tiny-cloud-aws = true
WHEN {
"3.12" {
# tiny-cloud-network requires ifupdown-ng (unavailable in 3.12)
# fallback to the old tiny-ec2-bootstrap package
packages.tiny-cloud-aws = null
services.sysinit.tiny-cloud-early = null
services.default.tiny-cloud = null
services.default.tiny-cloud-final = null
# fall back to tiny-ec2-bootstrap instead
packages.tiny-ec2-bootstrap = true
services.default.tiny-ec2-bootstrap = true
}

View File

@ -0,0 +1,7 @@
# vim: ts=2 et:
include required("base/5.conf")
motd {
sudo_removed = "NOTE: 'sudo' is not installed by default, please use 'doas' instead."
}

View File

@ -6,6 +6,8 @@ repos {
"https://dl-cdn.alpinelinux.org/alpine/v{version}/testing" = false
}
repo_keys = []
packages {
alpine-base = true
linux-virt = true

View File

@ -56,7 +56,10 @@ make_filesystem() {
mkfs.fat -n EFI "${DEVICE}1"
fi
mkfs.ext4 -O ^64bit -L / "$root_dev"
# before Alpine 3.18...
# - grub2 can't handle "metadata_csum_seed"
# - fsck can't handle "orphan_file"
mkfs.ext4 -O ^64bit,^metadata_csum_seed,^orphan_file -L / "$root_dev"
mkdir -p "$TARGET"
mount -t ext4 "$root_dev" "$TARGET"

View File

@ -15,7 +15,31 @@ if [ "$VERSION" = "3.12" ]; then
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
TC_CONF="$TARGET/etc/tiny-cloud.conf"
# tiny-cloud >= 3.0.0 moved configs, the following supports older versions
[ ! -f "$TC_CONF" ] && TC_CONF="$TARGET/etc/conf.d/tiny-cloud"
sed -i.bak -Ee "s/^#?CLOUD_USER=.*/CLOUD_USER=$IMAGE_LOGIN/" "$TC_CONF"
rm "$TC_CONF.bak"
# tiny-cloud >= 3.0.0 sets up init scripts with /sbin/tiny-cloud --setup
if [ -f "$TARGET/sbin/tiny-cloud" ]; then
# fixed in tiny-cloud >3.0.1
#chroot "$TARGET" /sbin/tiny-cloud --enable
# logic directly implemented here, for now
echo -- "- removing tiny-cloud* from all runlevels"
rm -f "$TARGET"/etc/runlevels/*/tiny-cloud*
ln -s /etc/init.d/tiny-cloud-boot "$TARGET"/etc/runlevels/boot
echo -- "+ tiny-cloud-boot service added to boot runlevel"
for p in early main final; do
ln -s "/etc/init.d/tiny-cloud-$p" "$TARGET"/etc/runlevels/default
echo -- "+ tiny-cloud-$p service added to default runlevel"
done
# TODO: will need to update this for >3.18
elif [ "$VERSION" = "3.18" ]; then
# 3.18 has tiny-cloud 3.0.0, and we didn't find what we expected
echo "Error: /sbin/tiny-cloud not found" >&2
exit 1
fi
fi