Skip to content
Snippets Groups Projects
Commit 6225d269 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/alpine-conf: backport a couple of fixes

- fix kernel option with cryptroot
- fallback to u-boot bootloader for armv7

ref alpine/alpine-conf#10489
parent ce878745
No related branches found
No related tags found
No related merge requests found
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
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
# 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
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment