From c04d694d3a910969cb77624f1c8b3503a9945f69 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 15 Oct 2025 13:18:56 +0200 Subject: [PATCH] overlay coreos/user-patches: Add patches for dev-util/catalyst Signed-off-by: Krzesimir Nowak --- ...upport-locale-gen-3-the-perl-version.patch | 47 +++++++++++++++++++ .../catalyst/0002-Fix-UTF-8-spelling.patch | 41 ++++++++++++++++ .../user-patches/dev-util/catalyst/README.md | 3 ++ 3 files changed, 91 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0001-Support-locale-gen-3-the-perl-version.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0002-Fix-UTF-8-spelling.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/README.md diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0001-Support-locale-gen-3-the-perl-version.patch b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0001-Support-locale-gen-3-the-perl-version.patch new file mode 100644 index 0000000000..ed392d74e0 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0001-Support-locale-gen-3-the-perl-version.patch @@ -0,0 +1,47 @@ +From 2478055bf48a54c0fcb518bbd48a30b307db0009 Mon Sep 17 00:00:00 2001 +From: Kerin Millar +Date: Mon, 18 Aug 2025 14:25:20 +0200 +Subject: [PATCH 1/2] Support locale-gen-3 (the perl version) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Andreas K. Hüttel +--- + targets/stage1/chroot.sh | 6 +++++- + targets/support/chroot-functions.sh | 2 +- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh +index e0587b59..541c060f 100755 +--- a/targets/stage1/chroot.sh ++++ b/targets/stage1/chroot.sh +@@ -91,7 +91,11 @@ run_merge --implicit-system-deps=n --oneshot "${buildpkgs[@]}" + # not run locale-gen when ROOT is set. Since we've set LANG, we need to run + # locale-gen explicitly. + if [ -x "$(command -v locale-gen)" ]; then +- locale-gen --destdir "$ROOT"/ || die "locale-gen failed" ++ if ! locale-gen -V | grep -q '^locale-gen-2\.'; then ++ locale-gen --config /etc/locale.gen --prefix "$ROOT"/ ++ else ++ locale-gen --destdir "$ROOT"/ ++ fi || die "locale-gen failed" + fi + + # Why are we removing these? Don't we need them for final make.conf? +diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh +index d8472d46..08738d0a 100755 +--- a/targets/support/chroot-functions.sh ++++ b/targets/support/chroot-functions.sh +@@ -284,7 +284,7 @@ show_debug() { + } + + readonly locales=" +-C.UTF8 UTF-8 ++C.UTF-8 UTF-8 + " + + if [[ ${RUN_DEFAULT_FUNCS} != no ]] +-- +2.51.0 + diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0002-Fix-UTF-8-spelling.patch b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0002-Fix-UTF-8-spelling.patch new file mode 100644 index 0000000000..79f65d2180 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/0002-Fix-UTF-8-spelling.patch @@ -0,0 +1,41 @@ +From 8f3dad52ef6b7360f69f93554172d76aa5d59d8a Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Mon, 15 Sep 2025 12:35:43 +0100 +Subject: [PATCH 2/2] Fix UTF-8 spelling + +Bug: https://bugs.gentoo.org/962878 +Signed-off-by: Sam James +--- + catalyst/base/stagebase.py | 2 +- + targets/stage1/chroot.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py +index 8a3d2af6..d09b3aad 100644 +--- a/catalyst/base/stagebase.py ++++ b/catalyst/base/stagebase.py +@@ -1252,7 +1252,7 @@ class StageBase(TargetBase, ClearBase, GenBase): + '\n' + '# This sets the language of build output to English.\n' + '# Please keep this setting intact when reporting bugs.\n' +- 'LC_MESSAGES=C.utf8\n') ++ 'LC_MESSAGES=C.UTF-8\n') + + def write_binrepos_conf(self): + # only if catalyst.conf defines the host and the spec defines the path... +diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh +index 541c060f..dc8571bd 100755 +--- a/targets/stage1/chroot.sh ++++ b/targets/stage1/chroot.sh +@@ -67,7 +67,7 @@ sed -i "/USE=\"${USE} build\"/d" ${clst_make_conf} + + echo "$locales" > /etc/locale.gen + for etc in /etc "$ROOT"/etc; do +- echo "LANG=C.UTF8" > ${etc}/env.d/02locale ++ echo "LANG=C.UTF-8" > ${etc}/env.d/02locale + done + update_env_settings + +-- +2.51.0 + diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/README.md b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/README.md new file mode 100644 index 0000000000..e404416d8e --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/dev-util/catalyst/README.md @@ -0,0 +1,3 @@ +The patches fix some locale generation issues in catalyst - they are +currently a part of the master branch, so there is no release that +contain those fixes yet.