From 8711dd27d8d1647c18051df5accbe81dce9f9547 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Mon, 20 Jun 2022 12:51:18 +0200 Subject: [PATCH] Readd configs --- configs/alpine.conf | 82 ++++++++++++++++++++++++++++++++ configs/arch/aarch64.conf | 15 ++++++ configs/arch/x86_64.conf | 9 ++++ configs/bootstrap/cloudinit.conf | 16 +++++++ configs/cloud/aws.conf | 37 ++++++++++++++ configs/firmware/bios.conf | 7 +++ configs/firmware/uefi.conf | 18 +++++++ configs/images.conf | 1 + configs/version/3.13.conf | 3 ++ configs/version/3.14.conf | 3 ++ configs/version/3.15.conf | 7 +++ configs/version/3.16.conf | 7 +++ configs/version/base/1.conf | 60 +++++++++++++++++++++++ configs/version/base/2.conf | 8 ++++ configs/version/base/3.conf | 8 ++++ configs/version/base/4.conf | 8 ++++ configs/version/edge.conf | 15 ++++++ 17 files changed, 304 insertions(+) create mode 100644 configs/alpine.conf create mode 100644 configs/arch/aarch64.conf create mode 100644 configs/arch/x86_64.conf create mode 100644 configs/bootstrap/cloudinit.conf create mode 100644 configs/cloud/aws.conf create mode 100644 configs/firmware/bios.conf create mode 100644 configs/firmware/uefi.conf create mode 120000 configs/images.conf create mode 100644 configs/version/3.13.conf create mode 100644 configs/version/3.14.conf create mode 100644 configs/version/3.15.conf create mode 100644 configs/version/3.16.conf create mode 100644 configs/version/base/1.conf create mode 100644 configs/version/base/2.conf create mode 100644 configs/version/base/3.conf create mode 100644 configs/version/base/4.conf create mode 100644 configs/version/edge.conf diff --git a/configs/alpine.conf b/configs/alpine.conf new file mode 100644 index 0000000..37cf0bd --- /dev/null +++ b/configs/alpine.conf @@ -0,0 +1,82 @@ +# vim: ts=2 et: + +# NOTE: If you are using alpine-cloud-images to build public cloud images +# for something/someone other than Alpine Linux, you *MUST* override +# *AT LEAST* the 'project' setting with a unique identifier string value +# via a "config overlay" to avoid image import and publishing collisions. + +project = "https://alpinelinux.org/cloud" + +# all build configs start with these +Default { + project = ${project} + + # image name/description components + name = [ alpine ] + description = [ Alpine Linux ] + + motd { + welcome = "Welcome to Alpine!" + + wiki = "The Alpine Wiki contains a large amount of how-to guides and general\n"\ + "information about administrating Alpine systems.\n"\ + "See ." + + version_notes = "Release Notes:\n"\ + "* " + release_notes = "* " + } + + # initial provisioning script and data directory + scripts = [ setup ] + script_dirs = [ setup.d ] + + size = 1G + login = alpine + + local_format = qcow2 + + # image access + access.PUBLIC = true + + # image publication + regions.ALL = true +} + +# profile build matrix +Dimensions { + version { + "3.16" { include required("version/3.16.conf") } + "3.15" { include required("version/3.15.conf") } + "3.14" { include required("version/3.14.conf") } + "3.13" { include required("version/3.13.conf") } + edge { include required("version/edge.conf") } + } + arch { + x86_64 { include required("arch/x86_64.conf") } + aarch64 { include required("arch/aarch64.conf") } + } + firmware { + bios { include required("firmware/bios.conf") } + uefi { include required("firmware/uefi.conf") } + } + bootstrap { + tiny { include required("bootstrap/tiny.conf") } + cloudinit { include required("bootstrap/cloudinit.conf") } + } + cloud { + aws { include required("cloud/aws.conf") } + } +} + +# all build configs merge these at the very end +Mandatory { + name = [ "r{revision}" ] + description = [ "- https://alpinelinux.org/cloud" ] + + # final motd message + motd.motd_change = "You may change this message by editing /etc/motd." + + # final provisioning script + scripts = [ cleanup ] +} diff --git a/configs/arch/aarch64.conf b/configs/arch/aarch64.conf new file mode 100644 index 0000000..dc4cfc3 --- /dev/null +++ b/configs/arch/aarch64.conf @@ -0,0 +1,15 @@ +# vim: ts=2 et: +name = [aarch64] +arch_name = aarch64 + +# aarch64 is UEFI only +EXCLUDE = [bios] + +qemu.machine_type = virt +qemu.args = [ + [-cpu, cortex-a57], + [-boot, d], + [-device, virtio-gpu-pci], + [-device, usb-ehci], + [-device, usb-kbd], +] diff --git a/configs/arch/x86_64.conf b/configs/arch/x86_64.conf new file mode 100644 index 0000000..d90ba09 --- /dev/null +++ b/configs/arch/x86_64.conf @@ -0,0 +1,9 @@ +# vim: ts=2 et: +name = [x86_64] +arch_name = x86_64 + +# TODO: until we have a image metadata service, let's avoid UEFI +EXCLUDE = [uefi] + +qemu.machine_type = null +qemu.args = null diff --git a/configs/bootstrap/cloudinit.conf b/configs/bootstrap/cloudinit.conf new file mode 100644 index 0000000..19dd869 --- /dev/null +++ b/configs/bootstrap/cloudinit.conf @@ -0,0 +1,16 @@ +# vim: ts=2 et: +name = [cloudinit] +bootstrap_name = cloud-init +bootstrap_url = "https://cloud-init.io/" + +# start cloudinit images with 3.15 +EXCLUDE = ["3.12", "3.13", "3.14"] + +packages { + cloud-init = true + openssh-server-pam = true + e2fsprogs-extra = true # for resize2fs +} +services.default.cloud-init-hotplugd = true + +scripts = [ setup-cloudinit ] \ No newline at end of file diff --git a/configs/cloud/aws.conf b/configs/cloud/aws.conf new file mode 100644 index 0000000..fd23f4e --- /dev/null +++ b/configs/cloud/aws.conf @@ -0,0 +1,37 @@ +# vim: ts=2 et: +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 + +kernel_modules { + ena = true + nvme = true +} +kernel_options { + "nvme_core.io_timeout=4294967295" = true +} +initfs_features { + ena = true + nvme = true +} + +access.PUBLIC = true +regions.ALL = true + +WHEN { + aarch64 { + # new AWS aarch64 default... + kernel_modules.gpio_pl061 = true + initfs_features.gpio_pl061 = true + WHEN { + "3.14 3.13 3.12" { + # ...but not supported for older versions + kernel_modules.gpio_pl061 = false + initfs_features.gpio_pl061 = false + } + } + } +} \ No newline at end of file diff --git a/configs/firmware/bios.conf b/configs/firmware/bios.conf new file mode 100644 index 0000000..6bd8161 --- /dev/null +++ b/configs/firmware/bios.conf @@ -0,0 +1,7 @@ +# vim: ts=2 et: +name = [bios] +firmware_name = BIOS + +bootloader = extlinux +packages.syslinux = --no-scripts +qemu.firmware = null \ No newline at end of file diff --git a/configs/firmware/uefi.conf b/configs/firmware/uefi.conf new file mode 100644 index 0000000..12937c7 --- /dev/null +++ b/configs/firmware/uefi.conf @@ -0,0 +1,18 @@ +# vim: ts=2 et: +name = [uefi] +firmware_name = UEFI + +bootloader = grub-efi +packages { + grub-efi = --no-scripts + dosfstools = true +} + +WHEN { + aarch64 { + qemu.firmware = work/firmware/uefi-aarch64.bin + } + x86_64 { + qemu.firmware = work/firmware/uefi-x86_64.bin + } +} \ No newline at end of file diff --git a/configs/images.conf b/configs/images.conf new file mode 120000 index 0000000..99f2529 --- /dev/null +++ b/configs/images.conf @@ -0,0 +1 @@ +alpine.conf \ No newline at end of file diff --git a/configs/version/3.13.conf b/configs/version/3.13.conf new file mode 100644 index 0000000..9481943 --- /dev/null +++ b/configs/version/3.13.conf @@ -0,0 +1,3 @@ +# vim: ts=2 et: + +include required("base/2.conf") \ No newline at end of file diff --git a/configs/version/3.14.conf b/configs/version/3.14.conf new file mode 100644 index 0000000..9481943 --- /dev/null +++ b/configs/version/3.14.conf @@ -0,0 +1,3 @@ +# vim: ts=2 et: + +include required("base/2.conf") \ No newline at end of file diff --git a/configs/version/3.15.conf b/configs/version/3.15.conf new file mode 100644 index 0000000..a9f6475 --- /dev/null +++ b/configs/version/3.15.conf @@ -0,0 +1,7 @@ +# vim: ts=2 et: + +include required("base/3.conf") + +motd { + sudo_deprecated = "NOTE: 'sudo' has been deprecated, please use 'doas' instead." +} \ No newline at end of file diff --git a/configs/version/3.16.conf b/configs/version/3.16.conf new file mode 100644 index 0000000..29a6936 --- /dev/null +++ b/configs/version/3.16.conf @@ -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." +} diff --git a/configs/version/base/1.conf b/configs/version/base/1.conf new file mode 100644 index 0000000..9d95504 --- /dev/null +++ b/configs/version/base/1.conf @@ -0,0 +1,60 @@ +# vim: ts=2 et: + +repos { + "https://dl-cdn.alpinelinux.org/alpine/v{version}/main" = true + "https://dl-cdn.alpinelinux.org/alpine/v{version}/community" = true + "https://dl-cdn.alpinelinux.org/alpine/v{version}/testing" = false +} + +packages { + alpine-base = true + linux-virt = true + alpine-mirrors = true + chrony = true + e2fsprogs = true + openssh = true + sudo = true + tzdata = true +} + +services { + sysinit { + devfs = true + dmesg = true + hwdrivers = true + mdev = true + } + boot { + acpid = true + bootmisc = true + hostname = true + hwclock = true + modules = true + swap = true + sysctl = true + syslog = true + } + default { + chronyd = true + networking = true + sshd = true + } + shutdown { + killprocs = true + mount-ro = true + savecache = true + } +} + +kernel_modules { + sd-mod = true + usb-storage = true + ext4 = true +} + +kernel_options { + "console=ttyS0,115200n8" = true +} + +initfs_features { +} diff --git a/configs/version/base/2.conf b/configs/version/base/2.conf new file mode 100644 index 0000000..f6909c6 --- /dev/null +++ b/configs/version/base/2.conf @@ -0,0 +1,8 @@ +# vim: ts=2 et: + +include required("1.conf") + +packages { + # drop old alpine-mirrors + alpine-mirrors = null +} diff --git a/configs/version/base/3.conf b/configs/version/base/3.conf new file mode 100644 index 0000000..4373266 --- /dev/null +++ b/configs/version/base/3.conf @@ -0,0 +1,8 @@ +# vim: ts=2 et: + +include required("2.conf") + +packages { + # doas will officially replace sudo in 3.16 + doas = true +} diff --git a/configs/version/base/4.conf b/configs/version/base/4.conf new file mode 100644 index 0000000..6f2e978 --- /dev/null +++ b/configs/version/base/4.conf @@ -0,0 +1,8 @@ +# vim: ts=2 et: + +include required("3.conf") + +packages { + # doas officially replaces sudo in 3.16 + sudo = false +} diff --git a/configs/version/edge.conf b/configs/version/edge.conf new file mode 100644 index 0000000..885a4bf --- /dev/null +++ b/configs/version/edge.conf @@ -0,0 +1,15 @@ +# vim: ts=2 et: + +include required("base/4.conf") + +motd { + sudo_removed = "NOTE: 'sudo' is no longer installed by default, please use 'doas' instead." +} + +# clear out inherited repos +repos = null +repos { + "https://dl-cdn.alpinelinux.org/alpine/edge/main" = true + "https://dl-cdn.alpinelinux.org/alpine/edge/community" = true + "https://dl-cdn.alpinelinux.org/alpine/edge/testing" = true +}