From 05d86fc992ed124add30e02bd64d468c56b1fbc0 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 1 Sep 2011 15:00:19 +0200 Subject: [PATCH] makedist.sh: configure i18n and kbd settings in /etc/locale.conf and /etc/vconsole.conf as required by dracut --- makedist.inc.sh | 53 ++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/makedist.inc.sh b/makedist.inc.sh index 3b4356e..795d928 100644 --- a/makedist.inc.sh +++ b/makedist.inc.sh @@ -17,6 +17,39 @@ create_fstab "$ROOTDEV" "$ROOTFS" install_rpms "filesystem gzip texinfo ldconfig bash libreadline glibc libncurses initscripts setup coreutils chkconfig libattr libstdc++6" "--nodeps --noorder --noscripts" +[ "$LANGUAGE" ] && { + + [ "$LANGUAGE" = "en" ] && KEYMAP=us || KEYMAP="$LANGUAGE" + + # configure localization + cat > $MOUNTDIR/etc/vconsole.conf << _EOF +KEYMAP=$KEYMAP +FONT=lat9w-16 +FONT_MAP=8859-1_to_uni +FONT_UNIMAP= +_EOF + + # legacy + cat > $MOUNTDIR/etc/sysconfig/keyboard << _EOF +KEYMAP=$KEYMAP.map +XKB_LAYOUT=$KEYMAP +XKB_MODEL=pc105 +XKB_OPTIONS= +_EOF + + [ "$COUNTRY" ] && { + cat > $MOUNTDIR/etc/locale.conf << _EOF +LANG=${LANGUAGE}_${COUNTRY}.UTF-8 +LC_COLLATE=C +_EOF + # legacy + cat > $MOUNTDIR/etc/sysconfig/i18n << _EOF +LANG=${LANGUAGE}_${COUNTRY}.UTF-8 +_EOF + } + +} + # Workaround: avoid a circular dependency with bash INSTALLED="texinfo" @@ -78,26 +111,6 @@ fi # erase_rpm_database clean_rpm_database -[ "$LANGUAGE" ] && { - - [ "$LANGUAGE" = "en" ] && KEYMAP=us || KEYMAP="$LANGUAGE" - - # configure localization - cat > $MOUNTDIR/etc/sysconfig/keyboard << _EOF -KEYMAP=$KEYMAP.map -XKB_LAYOUT=$KEYMAP -XKB_MODEL=pc105 -XKB_OPTIONS= -_EOF - - [ "$COUNTRY" ] && { - cat > $MOUNTDIR/etc/sysconfig/i18n << _EOF -LANG=${LANGUAGE}_${COUNTRY}.UTF-8 -_EOF - } - -} - echo "Deleting unneeded files..." # delete unused localizations #