From f55e637f2510e6a374e94deee50fc48cef90e655 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Sep 14 2016 17:04:43 +0000 Subject: treecompose-post.sh: copy, don't move the locale archive Most processes, including bash, will have locale-archive mmap'ed. Renaming it to .tmpl will cause it to get truncated by build-locale-archive. We should make sure that it remains untouched so that bash doesn't die with SIGBUS. OTOH, build-locale-archive knows to unlink and create a new inode so as to not affect already mmap'ed versions. --- diff --git a/treecompose-post.sh b/treecompose-post.sh index 836afac..52d8a1e 100755 --- a/treecompose-post.sh +++ b/treecompose-post.sh @@ -9,5 +9,5 @@ echo 'Storage=persistent' >> /etc/systemd/journald.conf KEEPLANG=en_US find /usr/share/locale -mindepth 1 -maxdepth 1 -type d -not -name "${KEEPLANG}" -exec rm -rf {} + localedef --list-archive | grep -a -v ^"${KEEPLANG}" | xargs localedef --delete-from-archive -mv -f /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl +cp -f /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl build-locale-archive