Re: [PATCH] Do full console initialization in the initrd, not just keymap. (#458362)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hans de Goede (hdegoede@xxxxxxxxxx) said: 
> Other then the remarks above it looks ok.

Updated diff attached.

Bill
diff --git a/mkinitrd b/mkinitrd
index cbf5978..8f49ae9 100755
--- a/mkinitrd
+++ b/mkinitrd
@@ -1535,29 +1535,20 @@ EOF
 
 if [ $ncryptodevs -ne 0 ]; then
     inst /sbin/cryptsetup "$MNTIMAGE"
+fi
 
-    KEYTABLE=
-    KEYMAP=
+if [ -f /etc/sysconfig/keyboard ] || [ -f /etc/sysconfig/console/default.kmap ]; then
+    I18N=yes
     if [ -f /etc/sysconfig/console/default.kmap ]; then
         KEYMAP=/etc/sysconfig/console/default.kmap
     else
-        if [ -f /etc/sysconfig/keyboard ]; then
-            . /etc/sysconfig/keyboard
-        fi
+        [ -f /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
         if [ -n "$KEYTABLE" -a -d "/lib/kbd/keymaps" ]; then
             KEYMAP="$KEYTABLE.map"
         fi
     fi
-
     if [ -n "$KEYMAP" ]; then
-        LOADKEYS=loadkeys
-        if [ -f /etc/sysconfig/i18n ]; then
-            . /etc/sysconfig/i18n
-        fi
-        if [ "${LANG}" != "${LANG%%.UTF-8}" -o "${LANG}" != "${LANG%%.utf8}" ]; then
-            LOADKEYS="loadkeys -u"
-        fi
-
+        [ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard "$MNTIMAGE"
         inst /bin/loadkeys "$MNTIMAGE"
         findkeymap $KEYMAP
 
@@ -1575,6 +1566,36 @@ if [ $ncryptodevs -ne 0 ]; then
     fi
 fi
 
+if [ -f /etc/sysconfig/i18n ]; then
+    I18N=yes
+    . /etc/sysconfig/i18n
+    inst /etc/sysconfig/i18n "$MNTIMAGE"
+    [ -z "$SYSFONT" ] && SYSFONT=latarcyrheb-sun16
+    inst /bin/setfont "$MNTIMAGE"
+
+    for FN in /lib/kbd/consolefonts/$SYSFONT.* ; do
+        inst $FN "$MNTIMAGE"
+        case "$FN" in
+            *.gz)
+                gzip -d "$MNTIMAGE$FN"
+                ;;
+            *.bz2)
+                bzip2 -d "$MNTIMAGE$FN"
+                ;;
+        esac
+    done
+    if [ -n "$SYSFONTACM" ]; then
+        inst /lib/kbd/consoletrans/$SYSFONTACM "$MNTIMAGE"
+    fi
+    if [ -n "$UNIMAP" ]; then
+        inst /lib/kbd/unimaps/$UNIMAP "$MNTIMAGE"
+    fi
+fi
+
+if [ -n "$I18N" ]; then
+    inst /lib/udev/console_init "$MNTIMAGE"
+fi
+
 echo -n >| $RCFILE
 cemit << EOF
 #!/bin/nash
@@ -1612,6 +1633,7 @@ fi
 for i in 0 1 2 3 ; do
     emit "mknod /dev/ttyS$i c 4 $(($i + 64))"
 done
+[ -n "$I18N" ] && emit "/lib/udev/console_init tty0"
 
 emit "daemonize --ignore-missing /bin/plymouthd"
 
@@ -1690,11 +1712,6 @@ emitcrypto()
     emit "plymouth ask-for-password --command \"cryptsetup luksOpen $1 $2\""
 }
 
-if [ -n "$KEYMAP" ]; then
-    emit "echo Loading keymap."
-    emit "$LOADKEYS $KEYMAP"
-fi
-
 for cryptdev in ${!cryptopart@} ; do
     emitcrypto `eval echo '$'$cryptdev`
 done
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux