Do full console initialization in the initrd, not just keymap. (#458362)
Bill Nottingham wrote:
With the advent of plymouth, this means that the virtual console may be
in graphics mode. This causes font setting to fail. Since we can't
realistically wait until plymouth finishes to do this, we need to do
the full initialization before plymouth starts. Copy in the font and
any required mappings, and run the udev console setup helper directly.
This removes the special case for loading the keymap, as it's handled
by this.
---
mkinitrd | 49 +++++++++++++++++++++++++++++++++----------------
1 files changed, 33 insertions(+), 16 deletions(-)
Here you are testing for existence of /etc/sysconfig/keyboard
+ I18N=yes
if [ -f /etc/sysconfig/console/default.kmap ]; then
KEYMAP=/etc/sysconfig/console/default.kmap
else
@@ -1548,16 +1549,8 @@ if [ $ncryptodevs -ne 0 ]; then
KEYMAP="$KEYTABLE.map"
fi
fi
-
+ inst /etc/sysconfig/keyboard "$MNTIMAGE"
Yet here you are unconditionally installing it, "inst" will not handle non
existing files gracefully!
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
-
inst /bin/loadkeys "$MNTIMAGE"
findkeymap $KEYMAP
@@ -1573,6 +1566,34 @@ if [ $ncryptodevs -ne 0 ]; then
esac
done
fi
+
+ if [ -f /etc/sysconfig/i18n ]; then
+ . /etc/sysconfig/i18n
+ fi
+ inst /etc/sysconfig/i18n "$MNTIMAGE"
Same here, you check if it exists to source it, but you inst it unconditionally.
+ [ -z "$SYSFONT" ] && SYSFONT=latarcyrheb-sun16
+ if [ -n "$SYSFONT" ]; then
No need to put this in an if, as you've just assured SYSFONT is always set to
something.
+ 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
+ inst /lib/udev/console_init "$MNTIMAGE"
fi
echo -n >| $RCFILE
@@ -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"
+ 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
There is no need for the test here, you are in a
"if [ -f /etc/sysconfig/keyboard ] || [ -f /etc/sysconfig/console/default.kmap];"
block here, so if /etc/sysconfig/console/default.kmap does not exist then
/etc/sysconfig/keyboard must exist.
Other then that it looks fine.
Regards,
Hans
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list