From: Daan De Meyer Date: Wed, 20 Apr 2022 18:08:24 +0000 (+0200) Subject: mkosi: Force /etc/default/locale to be a symlink to locale.conf X-Git-Tag: v13~49^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F952%2Fhead;p=thirdparty%2Fmkosi.git mkosi: Force /etc/default/locale to be a symlink to locale.conf If the locales package is installed, /etc/default/locale will exist in the filesystem already. Let's make sure we handle that properly. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 5d1ce87ca..e4a370924 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2836,6 +2836,10 @@ def install_debian_or_ubuntu(args: MkosiArgs, root: Path, *, do_run_build_script run_workspace_command(args, root, ["kernel-install", "add", kver, Path("/") / kimg]) root.joinpath("etc/locale.conf").write_text("LANG=C.UTF-8\n") + try: + root.joinpath("etc/default/locale").unlink() + except FileNotFoundError: + pass root.joinpath("etc/default/locale").symlink_to("/etc/locale.conf")