FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 11-06-2008, 08:17 AM
Hans de Goede
 
Default 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(-)

diff --git a/mkinitrd b/mkinitrd
index cbf5978..3a9bf0b 100755
--- a/mkinitrd
+++ b/mkinitrd
@@ -1535,9 +1535,10 @@ EOF

if [ $ncryptodevs -ne 0 ]; then

inst /sbin/cryptsetup "$MNTIMAGE"
+fi

- KEYTABLE=

- KEYMAP=
+if [ -f /etc/sysconfig/i18n -o -f /etc/sysconfig/keyboard ]; then


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"

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


Other then the remarks above it looks ok.

Regards,

Hans

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-06-2008, 05:12 PM
Hans de Goede
 
Default Do full console initialization in the initrd, not just keymap. (#458362)

Bill Nottingham wrote:
Hans de Goede (hdegoede@redhat.com) said:

Other then the remarks above it looks ok.


Updated diff attached.



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

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
 

Thread Tools




All times are GMT. The time now is 07:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org