From de8c16211b5a1a3b8c7430e6339509d197a97f41 Mon Sep 17 00:00:00 2001 From: thiblizz <101073848+thiblizz@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:12:09 +0100 Subject: [PATCH] feat: support musl timezone --- scripts/main.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/scripts/main.sh b/scripts/main.sh index 0c98b4e..5f48140 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -54,12 +54,19 @@ function configure_base_system() { || die "Could not sed replace in /etc/conf.d/hostname" # Set timezone - einfo "Selecting timezone" - echo "$TIMEZONE" > /etc/timezone \ - || die "Could not write /etc/timezone" - chmod 644 /etc/timezone \ - || die "Could not set correct permissions for /etc/timezone" - try emerge -v --config sys-libs/timezone-data + if [[ $MUSL == "true" ]]; then + try emerge -v sys-libs/timezone-data + einfo "Selecting timezone" + echo -e "\nTZ=\"$TIMEZONE\"" >> /etc/env.d/00musl \ + || die "Could not write to /etc/env.d/00musl" + else + einfo "Selecting timezone" + echo "$TIMEZONE" > /etc/timezone \ + || die "Could not write /etc/timezone" + chmod 644 /etc/timezone \ + || die "Could not set correct permissions for /etc/timezone" + try emerge -v --config sys-libs/timezone-data + fi # Set keymap einfo "Selecting keymap" @@ -390,7 +397,7 @@ EOF # Install authorized_keys before dracut, which might need them for remote unlocking. install_authorized_keys - # Install required programs and kernel now, in oder to + # Install required programs and kernel now, in order to # prevent emerging module before an imminent kernel upgrade try emerge --verbose sys-kernel/dracut sys-kernel/gentoo-kernel-bin app-arch/zstd