Adding casper 1.66+debian-1.
[live-boot-grml.git] / scripts / casper-bottom / 14locales
index 6d5b73c..f69fa0f 100755 (executable)
@@ -27,6 +27,10 @@ elif [ -e /root/etc/environment ]; then # Old locales policy
        grep_file=/root/etc/environment
 fi
 
+if [ -z "${grep_file}" ]; then 
+       grep_file=/root/etc/default/locale
+fi
+
 # commandline
 for x in $(cat /proc/cmdline); do
        case $x in
@@ -34,6 +38,10 @@ for x in $(cat /proc/cmdline); do
                        locale=${x#debian-installer/locale=}
                        set_locale="true"
                        ;;
+               locale=*)
+                       locale=${x#locale=}
+                       set_locale="true"
+                       ;;
        esac
 done
 
@@ -43,10 +51,14 @@ if [ -z "${locale}" ]; then
        set_locale="true"
 fi
 
-if [ ! -z "${set_locale}" ]; then
+if [ "${set_locale}" ]; then
        LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q)
-       printf 'LANG="%s"\n' "${LANG}" >> "${grep_file}" 
-       chroot /root /usr/sbin/locale-gen "${LANG}"
+       printf 'LANG="%s"\n' "${LANG}" >> "${grep_file}"
+       if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+               chroot /root /usr/sbin/locale-gen
+       else
+               chroot /root /usr/sbin/locale-gen "${LANG}"
+       fi
 fi
 
 log_end_msg