From d7ef78033160a7fb0c448b902e1c556a14e0167b Mon Sep 17 00:00:00 2001 From: thiblizz <101073848+thiblizz@users.noreply.github.com> Date: Fri, 13 Oct 2023 01:18:00 +0200 Subject: [PATCH 1/3] Fix musl stage3 variant --- scripts/main.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/main.sh b/scripts/main.sh index 709bf2e..91b14bc 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -13,13 +13,13 @@ function install_stage3() { } function configure_base_system() { - einfo "Generating locales" - echo "$LOCALES" > /etc/locale.gen \ - || die "Could not write /etc/locale.gen" - locale-gen \ - || die "Could not generate locales" - if [[ $SYSTEMD == "true" ]]; then + einfo "Generating locales" + echo "$LOCALES" > /etc/locale.gen \ + || die "Could not write /etc/locale.gen" + locale-gen \ + || die "Could not generate locales" + einfo "Setting machine-id" systemd-machine-id-setup \ || die "Could not setup systemd machine id" @@ -43,6 +43,9 @@ function configure_base_system() { ln -sfn "../usr/share/zoneinfo/$TIMEZONE" /etc/localtime \ || die "Could not change /etc/localtime link" else + einfo "Installing musl-locales" + try emerge --verbose sys-apps/musl-locales + # Set hostname einfo "Selecting hostname" sed -i "/hostname=/c\\hostname=\"$HOSTNAME\"" /etc/conf.d/hostname \ From 5d27a4c1c91fbe6298f2471d475ceb54d33d0dc4 Mon Sep 17 00:00:00 2001 From: thiblizz <101073848+thiblizz@users.noreply.github.com> Date: Fri, 13 Oct 2023 02:28:23 +0200 Subject: [PATCH 2/3] Make musl variant optional --- configure | 1 + gentoo.conf.example | 2 ++ scripts/main.sh | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8a72258..5f93bf7 100755 --- a/configure +++ b/configure @@ -1595,6 +1595,7 @@ USE_PORTAGE_TESTING=${USE_PORTAGE_TESTING@Q} SELECT_MIRRORS=${SELECT_MIRRORS@Q} SELECT_MIRRORS_LARGE_FILE=${SELECT_MIRRORS_LARGE_FILE@Q} SYSTEMD=\$([[ \$STAGE3_VARIANT == *systemd* ]] && echo "true" || echo "false") +MUSL=\$([[ \$STAGE3_VARIANT == *musl* ]] && echo "true" || echo "false") ################################################ diff --git a/gentoo.conf.example b/gentoo.conf.example index bc5fc0b..0e798c7 100644 --- a/gentoo.conf.example +++ b/gentoo.conf.example @@ -248,6 +248,8 @@ STAGE3_BASENAME="stage3-$GENTOO_ARCH-$STAGE3_VARIANT" # Automatically set to true, if the stage3 tarball is based on systemd. In this case # we need to use slightly different utilities to setup the base system. SYSTEMD=$([[ $STAGE3_VARIANT == *systemd* ]] && echo "true" || echo "false") +# Automatically set to true, if the stage3 tarball is based on musl. +MUSL=$([[ $STAGE3_VARIANT == *musl* ]] && echo "true" || echo "false") # If set to true, the installer will add ACCEPT_KEYWORDS="~$GENTOO_ARCH" # to /etc/portage/make.conf to enable packages in testing. diff --git a/scripts/main.sh b/scripts/main.sh index 91b14bc..56ce505 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -43,8 +43,10 @@ function configure_base_system() { ln -sfn "../usr/share/zoneinfo/$TIMEZONE" /etc/localtime \ || die "Could not change /etc/localtime link" else - einfo "Installing musl-locales" - try emerge --verbose sys-apps/musl-locales + if [[ $MUSL == "true" ]]; then + einfo "Installing musl-locales" + try emerge --verbose sys-apps/musl-locales + fi # Set hostname einfo "Selecting hostname" From e9f7f6603cc9c1f3a5363a9e866e01bc10aaa9a0 Mon Sep 17 00:00:00 2001 From: thiblizz <101073848+thiblizz@users.noreply.github.com> Date: Fri, 13 Oct 2023 02:47:14 +0200 Subject: [PATCH 3/3] Revert to initial logic --- scripts/main.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/main.sh b/scripts/main.sh index 56ce505..0c98b4e 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -13,13 +13,18 @@ function install_stage3() { } function configure_base_system() { - if [[ $SYSTEMD == "true" ]]; then + if [[ $MUSL == "true" ]]; then + einfo "Installing musl-locales" + try emerge --verbose sys-apps/musl-locales + else einfo "Generating locales" echo "$LOCALES" > /etc/locale.gen \ || die "Could not write /etc/locale.gen" locale-gen \ || die "Could not generate locales" + fi + if [[ $SYSTEMD == "true" ]]; then einfo "Setting machine-id" systemd-machine-id-setup \ || die "Could not setup systemd machine id" @@ -43,11 +48,6 @@ function configure_base_system() { ln -sfn "../usr/share/zoneinfo/$TIMEZONE" /etc/localtime \ || die "Could not change /etc/localtime link" else - if [[ $MUSL == "true" ]]; then - einfo "Installing musl-locales" - try emerge --verbose sys-apps/musl-locales - fi - # Set hostname einfo "Selecting hostname" sed -i "/hostname=/c\\hostname=\"$HOSTNAME\"" /etc/conf.d/hostname \