From e38e5ff995e6d6131ce77de812783e263f5b3ee8 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Thu, 20 Feb 2025 09:23:22 +0100 Subject: [PATCH] hooks: restructure a bit --- hooks/009-locale-archive.chroot | 9 --------- hooks/010-locale-vconsole-symlinks.chroot | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) create mode 100755 hooks/010-locale-vconsole-symlinks.chroot diff --git a/hooks/009-locale-archive.chroot b/hooks/009-locale-archive.chroot index 50fa3853..cb860cc7 100755 --- a/hooks/009-locale-archive.chroot +++ b/hooks/009-locale-archive.chroot @@ -24,12 +24,3 @@ for encoding in "${!found_encodings[@]}"; do done apt-get purge -y locales - -# restore configuration so the default locale can be found -printf 'LANG=C.UTF-8\n' > /etc/writable/locale.conf -ln -s ../writable/locale.conf /etc/default/locale -ln -s writable/locale.conf /etc/locale.conf - -mv /etc/vconsole.conf /etc/writable/vconsole.conf -ln -s ../writable/vconsole.conf /etc/default/keyboard -ln -s writable/vconsole.conf /etc/vconsole.conf diff --git a/hooks/010-locale-vconsole-symlinks.chroot b/hooks/010-locale-vconsole-symlinks.chroot new file mode 100755 index 00000000..f6ef85d1 --- /dev/null +++ b/hooks/010-locale-vconsole-symlinks.chroot @@ -0,0 +1,15 @@ +#!/bin/bash + +set -eu + +# setup default console configuration, make them symlinks +# into writable so they can be changed +printf 'LANG=C.UTF-8\n' > /etc/writable/locale.conf +ln -s ../writable/locale.conf /etc/default/locale +ln -s writable/locale.conf /etc/locale.conf + +# setup default vconsole/keyboard configuration, make it a +# symlink as well so it can change +mv /etc/vconsole.conf /etc/writable/vconsole.conf +ln -s ../writable/vconsole.conf /etc/default/keyboard +ln -s writable/vconsole.conf /etc/vconsole.conf