Pull upstream for 3.16
This commit is contained in:
commit
4afeeef91d
|
@ -61,7 +61,7 @@ source qemu alpine {
|
||||||
"root<enter>",
|
"root<enter>",
|
||||||
"setup-interfaces<enter><enter><enter><enter>",
|
"setup-interfaces<enter><enter><enter><enter>",
|
||||||
"ifup eth0<enter><wait${var.qemu.cmd_wait}>",
|
"ifup eth0<enter><wait${var.qemu.cmd_wait}>",
|
||||||
"setup-sshd -c openssh<enter><wait${var.qemu.cmd_wait}>",
|
"setup-sshd openssh<enter><wait${var.qemu.cmd_wait}>",
|
||||||
"echo PermitRootLogin yes >> /etc/ssh/sshd_config<enter>",
|
"echo PermitRootLogin yes >> /etc/ssh/sshd_config<enter>",
|
||||||
"service sshd restart<enter>",
|
"service sshd restart<enter>",
|
||||||
"echo 'root:${local.password}' | chpasswd<enter>",
|
"echo 'root:${local.password}' | chpasswd<enter>",
|
||||||
|
|
|
@ -48,13 +48,19 @@ from image_configs import ImageConfigManager
|
||||||
|
|
||||||
### Constants & Variables
|
### Constants & Variables
|
||||||
|
|
||||||
STEPS = ['configs', 'state', 'local', 'import', 'publish']
|
STEPS = ['configs', 'state', 'rollback', 'local', 'import', 'publish']
|
||||||
LOGFORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
LOGFORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||||
WORK_CLEAN = {'bin', 'include', 'lib', 'pyvenv.cfg', '__pycache__'}
|
WORK_CLEAN = {'bin', 'include', 'lib', 'pyvenv.cfg', '__pycache__'}
|
||||||
WORK_OVERLAYS = ['configs', 'scripts']
|
WORK_OVERLAYS = ['configs', 'scripts']
|
||||||
OVMF_FIRMWARE = {
|
UEFI_FIRMWARE = {
|
||||||
'aarch64': 'usr/share/OVMF/QEMU_EFI.fd',
|
'aarch64': {
|
||||||
'x86_64': 'usr/share/OVMF/OVMF.fd'
|
'apk': 'aavmf',
|
||||||
|
'bin': 'usr/share/AAVMF/QEMU_EFI.fd',
|
||||||
|
},
|
||||||
|
'x86_64': {
|
||||||
|
'apk': 'ovmf',
|
||||||
|
'bin': 'usr/share/OVMF/OVMF.fd',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
alpine = Alpine()
|
alpine = Alpine()
|
||||||
|
|
||||||
|
@ -120,6 +126,9 @@ def install_overlay(overlay):
|
||||||
os.makedirs(dest_dir, exist_ok=True)
|
os.makedirs(dest_dir, exist_ok=True)
|
||||||
for src in unique_list(['.'] + args.custom):
|
for src in unique_list(['.'] + args.custom):
|
||||||
src_dir = os.path.join(src, overlay)
|
src_dir = os.path.join(src, overlay)
|
||||||
|
if not os.path.exists(src_dir):
|
||||||
|
log.debug('%s does not exist, skipping', src_dir)
|
||||||
|
continue
|
||||||
for x in glob(os.path.join(src_dir, '**'), recursive=True):
|
for x in glob(os.path.join(src_dir, '**'), recursive=True):
|
||||||
x = x.removeprefix(src_dir + '/')
|
x = x.removeprefix(src_dir + '/')
|
||||||
src_x = os.path.join(src_dir, x)
|
src_x = os.path.join(src_dir, x)
|
||||||
|
@ -169,10 +178,12 @@ def install_qemu_firmware():
|
||||||
log.info('Installing UEFI firmware in work environment')
|
log.info('Installing UEFI firmware in work environment')
|
||||||
|
|
||||||
os.makedirs(firm_dir)
|
os.makedirs(firm_dir)
|
||||||
for arch, bin in OVMF_FIRMWARE.items():
|
for arch, a_cfg in UEFI_FIRMWARE.items():
|
||||||
v = alpine.apk_version('community', arch, 'ovmf')
|
apk = a_cfg['apk']
|
||||||
ovmf_url = f"{alpine.repo_url('community', arch)}/ovmf-{v}.apk"
|
bin = a_cfg['bin']
|
||||||
data = urlopen(ovmf_url).read()
|
v = alpine.apk_version('community', arch, apk)
|
||||||
|
apk_url = f"{alpine.repo_url('community', arch)}/{apk}-{v}.apk"
|
||||||
|
data = urlopen(apk_url).read()
|
||||||
|
|
||||||
# Python tarfile library can't extract from APKs
|
# Python tarfile library can't extract from APKs
|
||||||
tar_cmd = ['tar', '-zxf', '-', '-C', firm_dir, bin]
|
tar_cmd = ['tar', '-zxf', '-', '-C', firm_dir, bin]
|
||||||
|
@ -241,6 +252,8 @@ console.setFormatter(logfmt)
|
||||||
log.addHandler(console)
|
log.addHandler(console)
|
||||||
log.debug(args)
|
log.debug(args)
|
||||||
|
|
||||||
|
# TODO: rollback requires --revise
|
||||||
|
|
||||||
# set up credential provider, if we're going to use it
|
# set up credential provider, if we're going to use it
|
||||||
if args.use_broker:
|
if args.use_broker:
|
||||||
clouds.set_credential_provider(debug=args.debug)
|
clouds.set_credential_provider(debug=args.debug)
|
||||||
|
@ -274,7 +287,7 @@ if not image_configs.refresh_state(
|
||||||
log.info('No pending actions to take at this time.')
|
log.info('No pending actions to take at this time.')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if args.step == 'state':
|
if args.step == 'state' or args.step == 'rollback':
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# install firmware if missing
|
# install firmware if missing
|
||||||
|
|
|
@ -383,10 +383,13 @@ class AWSCloudAdapter(CloudAdapterInterface):
|
||||||
# set up AMI deprecation
|
# set up AMI deprecation
|
||||||
ec2c = image.meta.client
|
ec2c = image.meta.client
|
||||||
log.info('%s: Setting EOL deprecation time on %s', r, image.id)
|
log.info('%s: Setting EOL deprecation time on %s', r, image.id)
|
||||||
ec2c.enable_image_deprecation(
|
try:
|
||||||
ImageId=image.id,
|
ec2c.enable_image_deprecation(
|
||||||
DeprecateAt=f"{tags.end_of_life}T23:59:59Z"
|
ImageId=image.id,
|
||||||
)
|
DeprecateAt=f"{tags.end_of_life}T23:59:59Z"
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
log.warning('Unable to set EOL Deprecation on %s image:', r, exc_info=True)
|
||||||
|
|
||||||
artifacts[r] = image.id
|
artifacts[r] = image.id
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ Default {
|
||||||
# profile build matrix
|
# profile build matrix
|
||||||
Dimensions {
|
Dimensions {
|
||||||
version {
|
version {
|
||||||
|
"3.16" { include required("version/3.16.conf") }
|
||||||
"3.15" { include required("version/3.15.conf") }
|
"3.15" { include required("version/3.15.conf") }
|
||||||
"3.14" { include required("version/3.14.conf") }
|
"3.14" { include required("version/3.14.conf") }
|
||||||
"3.13" { include required("version/3.13.conf") }
|
"3.13" { include required("version/3.13.conf") }
|
||||||
"3.12" { include required("version/3.12.conf") }
|
|
||||||
edge { include required("version/edge.conf") }
|
edge { include required("version/edge.conf") }
|
||||||
}
|
}
|
||||||
arch {
|
arch {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# vim: ts=2 et:
|
# vim: ts=2 et:
|
||||||
name = [aarch64]
|
name = [aarch64]
|
||||||
|
arch_name = aarch64
|
||||||
|
|
||||||
# aarch64 is UEFI only
|
# aarch64 is UEFI only
|
||||||
EXCLUDE = [bios]
|
EXCLUDE = [bios]
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# vim: ts=2 et:
|
# vim: ts=2 et:
|
||||||
name = [x86_64]
|
name = [x86_64]
|
||||||
|
arch_name = x86_64
|
||||||
|
|
||||||
# TODO: until we have a image metadata service, let's avoid UEFI
|
# TODO: until we have a image metadata service, let's avoid UEFI
|
||||||
EXCLUDE = [uefi]
|
EXCLUDE = [uefi]
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# vim: ts=2 et:
|
# vim: ts=2 et:
|
||||||
# name = [cloudinit]
|
name = [cloudinit]
|
||||||
|
bootstrap_name = cloud-init
|
||||||
|
bootstrap_url = "https://cloud-init.io/"
|
||||||
|
|
||||||
# start cloudinit images with 3.15
|
# start cloudinit images with 3.15
|
||||||
EXCLUDE = ["3.12", "3.13", "3.14"]
|
EXCLUDE = ["3.12", "3.13", "3.14"]
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# vim: ts=2 et:
|
# vim: ts=2 et:
|
||||||
builder = qemu
|
cloud_name = Amazon Web Services
|
||||||
|
cloud_image_url = "https://{region}.console.aws.amazon.com/ec2/home#Images:visibility=public-images;imageId={image_id}",
|
||||||
|
cloud_launch_url = "https://{region}.console.aws.amazon.com/ec2/home#launchAmi={image_id}"
|
||||||
|
|
||||||
|
builder = qemu
|
||||||
ntp_server = 169.254.169.123
|
ntp_server = 169.254.169.123
|
||||||
|
|
||||||
kernel_modules {
|
kernel_modules {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# vim: ts=2 et:
|
# vim: ts=2 et:
|
||||||
#name = [bios]
|
name = [bios]
|
||||||
|
firmware_name = BIOS
|
||||||
|
|
||||||
bootloader = extlinux
|
bootloader = extlinux
|
||||||
packages.syslinux = --no-scripts
|
packages.syslinux = --no-scripts
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# vim: ts=2 et:
|
# vim: ts=2 et:
|
||||||
name = [uefi]
|
name = [uefi]
|
||||||
|
firmware_name = UEFI
|
||||||
|
|
||||||
bootloader = grub-efi
|
bootloader = grub-efi
|
||||||
packages {
|
packages {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
# vim: ts=2 et:
|
# vim: ts=2 et:
|
||||||
|
|
||||||
include required("base/1.conf")
|
include required("base/1.conf")
|
||||||
|
|
||||||
|
# NOTE: EOL 2022-05-01
|
|
@ -0,0 +1,7 @@
|
||||||
|
# vim: ts=2 et:
|
||||||
|
|
||||||
|
include required("base/4.conf")
|
||||||
|
|
||||||
|
motd {
|
||||||
|
sudo_removed = "NOTE: 'sudo' is no longer installed by default, please use 'doas' instead."
|
||||||
|
}
|
|
@ -206,6 +206,12 @@ class ImageConfig():
|
||||||
def image_description(self):
|
def image_description(self):
|
||||||
return self.description.format(**self.__dict__)
|
return self.description.format(**self.__dict__)
|
||||||
|
|
||||||
|
def image_url(self, region, image_id):
|
||||||
|
return self.cloud_image_url.format(region=region, image_id=image_id, **self.__dict__)
|
||||||
|
|
||||||
|
def launch_url(self, region, image_id):
|
||||||
|
return self.cloud_launch_url.format(region=region, image_id=image_id, **self.__dict__)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tags(self):
|
def tags(self):
|
||||||
# stuff that really ought to be there
|
# stuff that really ought to be there
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
# vim: ts=2 et:
|
||||||
|
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 {
|
||||||
|
aws {
|
||||||
|
packages.tiny-cloud-aws = true
|
||||||
|
WHEN {
|
||||||
|
"3.12" {
|
||||||
|
# tiny-cloud-network requires ifupdown-ng (unavailable in 3.12)
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# azure.packages.tiny-cloud-azure = true
|
||||||
|
# gcp.packages.tiny-cloud-gcp = true
|
||||||
|
# oci.packages.tiny-cloud-oci = true
|
||||||
|
}
|
||||||
|
|
||||||
|
scripts = [ setup-tiny ]
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/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
|
Loading…
Reference in New Issue