From 7c180b163a821127451d43786e0e10c751f2b756 Mon Sep 17 00:00:00 2001 From: Bashel <74869101+bashelled@users.noreply.github.com> Date: Wed, 28 Jul 2021 14:28:13 +0100 Subject: [PATCH 1/5] Add Carbs Linux --- .../share/brl-fetch/distros/carbs | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/slash-bedrock/share/brl-fetch/distros/carbs diff --git a/src/slash-bedrock/share/brl-fetch/distros/carbs b/src/slash-bedrock/share/brl-fetch/distros/carbs new file mode 100644 index 00000000..d9663f5c --- /dev/null +++ b/src/slash-bedrock/share/brl-fetch/distros/carbs @@ -0,0 +1,60 @@ +#!/bedrock/libexec/busybox sh +# +# Carbs Linux bootstrap support +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# Copyright (c) 2019-2020 Daniel Thau +# + +# shellcheck source=src/slash-bedrock/libexec/brl-fetch +. /bedrock/share/common-code +trap 'fetch_abort "Unexpected error occurred."' EXIT + +check_supported() { + false +} + +speed_test_url() { + echo "sha256sums.txt" +} + +list_mirrors() { + echo 'https://dl.carbslinux.org/releases/' +} + +brl_arch_to_distro() { + case "${1}" in + "x86_64") echo "x86_64" ;; + "i686") echo "i686" ;; + *) abort "brl does not know how to translate arch \"${1}\" to ${distro} format" ;; + esac +} + +list_architectures() { + cat < Date: Thu, 18 Nov 2021 06:43:19 -0500 Subject: [PATCH 2/5] installer: additional GRUB+BTRFS check --- src/installer/installer.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/installer/installer.sh b/src/installer/installer.sh index 4992b374..cdb0265e 100644 --- a/src/installer/installer.sh +++ b/src/installer/installer.sh @@ -6,7 +6,7 @@ # modify it under the terms of the GNU General Public License # version 2 as published by the Free Software Foundation. # -# Copyright (c) 2018-2020 Daniel Thau +# Copyright (c) 2018-2021 Daniel Thau # # Installs or updates a Bedrock Linux system. @@ -119,6 +119,9 @@ Please type \"Not reversible!\" without quotes at the prompt to continue: abort "grub-mkrelpath/grub2-mkrelpath --relative does not support bind-mounts on /boot. Continuing may break the bootloader on a kernel update. This is a known Bedrock issue with OpenSUSE+btrfs/GRUB." elif [ -r /boot/grub/grub.cfg ] && { grep -q 'subvol=' /boot/grub/grub.cfg || grep -q 'ZFS=' /boot/grub/grub.cfg; }; then abort '`subvol=` or `ZFS=` detected in `/boot/grub/grub.cfg` indicating GRUB usage on either BTRFS or ZFS. GRUB can get confused when updating this content on Bedrock which results in a non-booting system. Either use another filesystem or another bootloader.' + elif grep -qi 'btrfs' '/proc/mounts' && find /boot -iname "*grub*" >/dev/null 2>&; then + # Some users have reported getting past above two checks. This additional check is prone to false-positive, but it's better to be conservative here. + abort 'Detected BTRFS mount and GRUB reference in /boot. GRUB can get confused when updating its configuration in this scenario. Either use another filesystem or another bootloader.' elif [ -e /bedrock/ ]; then # Prefer this check at end of sanity check list so other sanity # checks can be tested directly on a Bedrock system. From cd943299058a6a305aae64e63c156367698d6f86 Mon Sep 17 00:00:00 2001 From: Daniel Thau Date: Fri, 19 Nov 2021 06:52:59 -0500 Subject: [PATCH 3/5] brl-fetch: gentoo: follow upstream --- src/slash-bedrock/share/brl-fetch/distros/gentoo | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/slash-bedrock/share/brl-fetch/distros/gentoo b/src/slash-bedrock/share/brl-fetch/distros/gentoo index fd25bacb..9d83d089 100644 --- a/src/slash-bedrock/share/brl-fetch/distros/gentoo +++ b/src/slash-bedrock/share/brl-fetch/distros/gentoo @@ -6,7 +6,7 @@ # modify it under the terms of the GNU General Public License # version 2 as published by the Free Software Foundation. # -# Copyright (c) 2016-2020 Daniel Thau +# Copyright (c) 2016-2021 Daniel Thau # # shellcheck source=src/slash-bedrock/libexec/brl-fetch @@ -68,6 +68,12 @@ list_releases() { } fetch() { + # TODO: Gentoo apprently removed minimal Stage 3, now requires an init. + # Defaulting to openrc. In Bedrock 0.8.0 when `brl fetch --flavor` is + # available make deskop vs hardened vs musl, openrc vs systemd, + # flavors. + flavor="desktop-openrc" + step "Finding bootstrap software" groups="$(download -q "${target_mirror}/releases/" - | list_links | @@ -76,7 +82,7 @@ fetch() { group="$(for group in ${groups}; do if download -q "${target_mirror}/releases/${group}/autobuilds/" - | list_links | - grep "^current-stage3-${distro_arch}/$" >/dev/null; then + grep "^current-stage3-${distro_arch}-${flavor}/$" >/dev/null; then echo "${group}" break fi @@ -86,7 +92,7 @@ fetch() { fi step "Downloading bootstrap software" - bootstrap_url="$(find_link "${target_mirror}/releases/${group}/autobuilds/current-stage3-${distro_arch}/" "^stage3-${distro_arch}-[^.]*[.]tar[.]\(xz\|bz2\)$")" + bootstrap_url="$(find_link "${target_mirror}/releases/${group}/autobuilds/current-stage3-${distro_arch}-${flavor}/" "^stage3-${distro_arch}-[^.]*[.]tar[.]\(xz\|bz2\)$")" bootstrap_name="$(echo "${bootstrap_url}" | sed 's,^.*/,,')" download "${bootstrap_url}.DIGESTS" "${bootstrap_dir}/checksum" bootstrap_checksum="$(awk -v"name=${bootstrap_name}" '/^# .* HASH$/ {hash=$2;next} hash == "SHA512" && $2 == name {print$1;exit}' "${bootstrap_dir}/checksum")" From d01ed441e0752832607b67ab5ac4b9cc495e35ae Mon Sep 17 00:00:00 2001 From: Daniel Thau Date: Fri, 10 Dec 2021 05:34:15 -0500 Subject: [PATCH 4/5] Fix brl fetch centos -r 7 CentOS 7 does not have the centos-gpg-keys package which was added to the dependency list for CentOS 8. --- src/slash-bedrock/share/brl-fetch/distros/centos | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slash-bedrock/share/brl-fetch/distros/centos b/src/slash-bedrock/share/brl-fetch/distros/centos index ba61f0f8..7dc445fc 100644 --- a/src/slash-bedrock/share/brl-fetch/distros/centos +++ b/src/slash-bedrock/share/brl-fetch/distros/centos @@ -99,11 +99,11 @@ determine_package_manager() { } bootstrap_deps() { - echo "${package_manager} rpm centos-release filesystem centos-gpg-keys shadow-utils" + echo "${package_manager} rpm centos-release filesystem shadow-utils" # At the time of writing, CentOS 8-stream no longer includes repos as a dependency of the package manager if echo "${target_release}" | grep -q stream; then - echo "centos-stream-repos" + echo "centos-stream-repos centos-gpg-keys" fi } From 491861fb8349dc5c97bcb61ffdd782131742e89f Mon Sep 17 00:00:00 2001 From: Daniel Thau Date: Sat, 18 Dec 2021 10:18:49 -0500 Subject: [PATCH 5/5] brl-fetch: fedora: fix release list detection URL --- src/slash-bedrock/share/brl-fetch/distros/fedora | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slash-bedrock/share/brl-fetch/distros/fedora b/src/slash-bedrock/share/brl-fetch/distros/fedora index 621aaf19..ebcd0c65 100644 --- a/src/slash-bedrock/share/brl-fetch/distros/fedora +++ b/src/slash-bedrock/share/brl-fetch/distros/fedora @@ -59,10 +59,11 @@ default_release() { } list_releases() { - download -q 'https://download-ib01.fedoraproject.org/pub/fedora-secondary/releases/' - | + download -q 'https://dl.fedoraproject.org/pub/fedora/linux/releases/' - | list_links | grep '^[0-9][0-9]*/$' | - sed 's,/$,,' + sed 's,/$,,' | + sort -n } determine_package_manager() {