diff --git a/main/alpine-conf/0001-setup-disk-fix-kernel-options-with-encrypted-root.patch b/main/alpine-conf/0001-setup-disk-fix-kernel-options-with-encrypted-root.patch new file mode 100644 index 0000000000000000000000000000000000000000..571fe63b7ecdbd4598c90f843ae10475277432d2 --- /dev/null +++ b/main/alpine-conf/0001-setup-disk-fix-kernel-options-with-encrypted-root.patch @@ -0,0 +1,27 @@ +From ca0d44eadabefa305c30bd5af43a33a852fc4a6d Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Tue, 16 Nov 2021 14:25:13 +0100 +Subject: [PATCH] setup-disk: fix kernel options with encrypted root + +We should append the kernel options for cryptroot, not replace. This is +so nomodeset, quiet and other options are kept. +--- + setup-disk.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup-disk.in b/setup-disk.in +index 5754c04..2f310fc 100644 +--- a/setup-disk.in ++++ b/setup-disk.in +@@ -619,7 +619,7 @@ install_mounted_root() { + if cryptsetup status "$cryptroot" 2>&1 >/dev/null; then + cryptroot=$(cryptsetup status "$cryptroot" | awk '/device:/ { print $2 }') + cryptroot=$(uuid_or_device $cryptroot) +- kernel_opts="cryptroot=$cryptroot cryptdm=root" ++ kernel_opts="cryptroot=$cryptroot cryptdm=root $kernel_opts" + root=$([ -n "$pvs" ] && echo "$rootdev" || echo "/dev/mapper/root") + fi + +-- +2.34.0 + diff --git a/main/alpine-conf/0001-setup-disk-improve-bootloader-selection.patch b/main/alpine-conf/0001-setup-disk-improve-bootloader-selection.patch new file mode 100644 index 0000000000000000000000000000000000000000..172daa714d367b53e986b281aadf830605b78bc8 --- /dev/null +++ b/main/alpine-conf/0001-setup-disk-improve-bootloader-selection.patch @@ -0,0 +1,87 @@ +From 7b2c478bb0f4c39ffc15c7e36c8bdb4b0a42fcbf Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Tue, 16 Nov 2021 16:05:04 +0100 +Subject: [PATCH] setup-disk: improve bootloader selection + +- unify bootloader selection. +- respect previously set BOOTLOADER, even if it may not work +- fall back to u-boot for arm and aarch64 if not efi + +fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10489 +--- + setup-disk.in | 43 +++++++++++++++++++------------------------ + 1 file changed, 19 insertions(+), 24 deletions(-) + +diff --git a/setup-disk.in b/setup-disk.in +index 2f310fc..f949949 100644 +--- a/setup-disk.in ++++ b/setup-disk.in +@@ -14,12 +14,6 @@ KERNELOPTS=${KERNELOPTS:-quiet} + # default location for mounted root + SYSROOT=${SYSROOT:-/mnt} + +-# machine arch +-ARCH=$(apk --print-arch) +-case "$ARCH" in +- x86*) BOOTLOADER=${BOOTLOADER:-syslinux};; +-esac +- + in_list() { + local i="$1" + shift +@@ -1433,8 +1427,27 @@ shift $(( $OPTIND - 1)) + + if is_rpi; then + : ${BOOTLOADER:=raspberrypi-bootloader} ++ BOOTFS=vfat ++ SWAP_SIZE=0 + fi + ++if is_efi || [ -n "$USE_EFI" ]; then ++ USE_EFI=1 ++ DISKLABEL=gpt ++ BOOT_SIZE=512 ++ BOOTFS=vfat ++ : ${BOOTLOADER:=grub} ++fi ++ ++# machine arch ++ARCH=$(apk --print-arch) ++case "$ARCH" in ++ x86*) : ${BOOTLOADER:=syslinux};; ++ ppc64le) : ${BOOTLOADER:=grub};; ++ s390x) : ${BOOTLOADER:=zipl};; ++ arm*|aarch64) : ${BOOTLOADER:=u-boot};; ++esac ++ + if [ -d "$1" ]; then + # install to given mounted root + [ "$BOOTLOADER" = "syslinux" ] && apk add --quiet syslinux +@@ -1541,24 +1554,6 @@ if [ $# -gt 1 ]; then + USE_RAID=1 + fi + +-if is_efi || [ -n "$USE_EFI" ]; then +- USE_EFI=1 +- DISKLABEL=gpt +- BOOTLOADER=grub +- BOOT_SIZE=512 +- BOOTFS=vfat +-fi +- +-if is_rpi; then +- BOOTFS=vfat +- SWAP_SIZE=0 +-fi +- +-case "$ARCH" in +- ppc64le) BOOTLOADER=grub;; +- s390x) BOOTLOADER=zipl;; +-esac +- + dmesg -n1 + + if [ -n "$USE_LVM" ] && ! grep -w -q device-mapper /proc/misc; then +-- +2.34.0 + diff --git a/main/alpine-conf/APKBUILD b/main/alpine-conf/APKBUILD index b92ae6f9765721fcc40da23872ccc76a72d3a94b..b3c60bd60585fc41af1b4b07159bb83ffda48db9 100644 --- a/main/alpine-conf/APKBUILD +++ b/main/alpine-conf/APKBUILD @@ -1,13 +1,15 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=alpine-conf pkgver=3.13.0_rc1 -pkgrel=0 +pkgrel=1 pkgdesc="Alpine configuration management scripts" url="https://git.alpinelinux.org/alpine-conf/about" arch="all" license="MIT" depends="openrc>=0.24.1-r6 busybox>=1.26.1-r3" source="https://gitlab.alpinelinux.org/alpine/alpine-conf/-/archive/$pkgver/alpine-conf-$pkgver.tar.gz + 0001-setup-disk-fix-kernel-options-with-encrypted-root.patch + 0001-setup-disk-improve-bootloader-selection.patch " builddir="$srcdir"/$pkgname-$pkgver @@ -26,4 +28,6 @@ package() { sha512sums=" f6e638652abea9e9e1379fe0f16140bd71461c195152bafa29e74def7fae895709a1e3cbb7eaedfd535ac80fee958e957cab8e7810853550b674e5a8a0e678ed alpine-conf-3.13.0_rc1.tar.gz +fe8e8a0998180a247a46413945c8949c5a6b2a8680b7fae8c9b85edc905fd526c581786dfb31c938a70755d59bd4b9ff30058869a98abc752e7741d64d7eb241 0001-setup-disk-fix-kernel-options-with-encrypted-root.patch +bde5bd6fa42a022432be84451ac19a4ea6ef97049a53be721c4000783ad3e78836fb42b2f6d67abdbc90c6c5efe6ec2e8fd23798b629c7be0a5e8687b6208851 0001-setup-disk-improve-bootloader-selection.patch "