about summary refs log tree commit diff
path: root/dracut
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2013-05-21 21:44:45 +0200
committerJuan RP <xtraeme@gmail.com>2013-05-21 21:44:45 +0200
commit22bae418bba36efece13ad8b124286774c579ad0 (patch)
treeb2ef390c334e022f7d7d9bac736f13f215c5a330 /dracut
parente05ce506e8824aa09809e88bd9104858faf64ce4 (diff)
downloadhrmpf-22bae418bba36efece13ad8b124286774c579ad0.tar.gz
hrmpf-22bae418bba36efece13ad8b124286774c579ad0.tar.xz
hrmpf-22bae418bba36efece13ad8b124286774c579ad0.zip
dracut: new locale.sh script to rebuild the target locale.
Diffstat (limited to 'dracut')
-rw-r--r--dracut/locale.sh14
-rw-r--r--dracut/module-setup.sh1
2 files changed, 15 insertions, 0 deletions
diff --git a/dracut/locale.sh b/dracut/locale.sh
new file mode 100644
index 0000000..4225218
--- /dev/null
+++ b/dracut/locale.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+# Regen locales if it's set in the kernel cmdline.
+
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+
+LOCALE=$(getarg locale.LANG)
+[ -z "$LOCALE" ] && LOCALE="en_US.UTF-8"
+
+# Create new user and remove password. We'll use autologin by default.
+sed -e "s,^\#\($LOCALE.*\),\1," -i $NEWROOT/etc/default/libc-locales
+chroot $NEWROOT xbps-reconfigure -f glibc-locales >/dev/null 2>&1
diff --git a/dracut/module-setup.sh b/dracut/module-setup.sh
index 61fac22..a44efd2 100644
--- a/dracut/module-setup.sh
+++ b/dracut/module-setup.sh
@@ -17,4 +17,5 @@ install() {
     inst_hook pre-pivot 01 "$moddir/adduser.sh"
     inst_hook pre-pivot 02 "$moddir/display-manager-autologin.sh"
     inst_hook pre-pivot 03 "$moddir/copy-initramfs.sh"
+    inst_hook pre-pivot 04 "$moddir/locale.sh"
 }