[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH lorax/master 1/2] leave pregenerated locale files (save RAM)



Now that the runtime contents remain compressed and aren't always stored
in RAM, it generally takes less RAM to keep these around than to run
'localedef' in anaconda.

This switches us back to the old pre-lorax method for setting up the
locale archive - see e.g. anaconda commit ea71816d
---
 share/runtime-cleanup.tmpl |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/share/runtime-cleanup.tmpl b/share/runtime-cleanup.tmpl
index b80cfc4..58d156c 100644
--- a/share/runtime-cleanup.tmpl
+++ b/share/runtime-cleanup.tmpl
@@ -1,7 +1,14 @@
 ## lorax template file: cleanup for the ramdisk (runtime image)
 <%page args="removelocales, libdir, product, root"/>
 
-## remove_locales()
+## strip unused languages out of the locale-archive
+runcmd localedef --prefix ${root} \
+                 --delete-from-archive ${" ".join(removelocales)}
+move usr/lib/locale/locale-archive usr/lib/locale/locale-archive.tmpl
+runcmd chroot ${root} build-locale-archive
+## remove the sources
+remove usr/share/i18n
+## remove unused locales
 %for locale in removelocales:
     remove usr/share/locale/${locale}
 %endfor
@@ -92,10 +99,6 @@ arch/x86/kvm
 remove lib/modules/*/{build,source,*.map}
 ## NOTE: depmod gets re-run after cleanup finishes
 
-## remove generated locales - anaconda >=16.x builds them at runtime
-removefrom glibc-common /usr/lib/locale/*
-remove /usr/lib/locale/locale-archive
-
 ## remove unused themes, theme engines, icons, etc.
 removefrom gtk2 /usr/${libdir}/gtk-2.0/*/{engines,printbackends}/*
 removefrom gtk2 /usr/share/themes/*
@@ -200,7 +203,8 @@ removefrom glibc /usr/libexec/* /usr/sbin/*
 removefrom glibc-common /etc/* /usr/bin/catchsegv /usr/bin/gencat
 removefrom glibc-common /usr/bin/getconf /usr/bin/getent /usr/bin/ldd
 removefrom glibc-common /usr/bin/locale /usr/bin/rpcgen /usr/bin/sprof
-removefrom glibc-common /usr/bin/tzselect /usr/libexec/* /usr/sbin/*
+removefrom glibc-common /usr/bin/tzselect /usr/bin/localedef
+removefrom glibc-common /usr/libexec/* /usr/sbin/*
 removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.*
 removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth*
 removefrom gnome-bluetooth-libs /usr/share/*
-- 
1.7.10.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]