Adding upstream version 1.124.1.
[live-boot-grml.git] / scripts / live-bottom / 14locales
index 2de535e..db26f0b 100755 (executable)
@@ -44,8 +44,6 @@ if [ -n "${grep_file}" ]
 then
        # use rootfs configured locale
        locale=$(grep -s 'LANG=' ${grep_file} | sed s/'LANG='// | tr -d '"' )
-else
-       grep_file=/root/etc/default/locale
 fi
 
 if [ -n "${LOCALE}" ]
@@ -79,6 +77,20 @@ then
 
        LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q)
 
+       language="${LANG%%.UTF-8*}"
+       if [ -d /root/etc/default/kdm.d/ ]
+       then
+
+cat > /root/etc/default/kdm.d/live-autologin << EOF
+LANGUAGE=${language}
+EOF
+
+       elif [ -f /root/etc/kde3/kdm/kdmrc ]
+       then
+               sed -i -r -e "s/#Language=.*/Language=${language}/" \
+                       /root/etc/kde3/kdm/kdmrc
+       fi
+
        if [ -z "${LANG}" ]
        then
                log_warning_message "Locale ${locale} is unsupported."
@@ -88,16 +100,10 @@ then
 
        really_export LANG
 
-       if [ "${BUILD_SYSTEM}" = "Ubuntu" ]
-       then
-               printf 'LANG="%s"\n' "${LANG}" > "${grep_file}"
-               chroot /root /usr/sbin/locale-gen "${LANG}"
-               live-preseed /root debian-installer/locale "${locale}"
-       else
-               printf 'LANG=%s\n' "${LANG}" > "${grep_file}"
-               printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen
-               chroot /root /usr/sbin/locale-gen
-       fi
+       printf 'LANG="%s"\n' "${LANG}" >> /root/etc/default/locale
+       printf 'LANG="%s"\n' "${LANG}" >> /root/etc/environment
+       printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen
+       chroot /root /usr/sbin/locale-gen
 fi
 
 log_end_msg