소스 검색

dracut: new locale.sh script to rebuild the target locale.

Juan RP 12 년 전
부모
커밋
22bae418bb
2개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      dracut/locale.sh
  2. 1 0
      dracut/module-setup.sh

+ 14 - 0
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

+ 1 - 0
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"
 }