initramfs-tools: fix KEYMAP and use loadkmap/kbd_mode from busybox.

This commit is contained in:
Juan RP 2011-10-12 21:22:25 +02:00
parent cd0172f2bc
commit a5b99f522c
3 changed files with 10 additions and 37 deletions

View File

@ -20,36 +20,12 @@ if [ "$KEYMAP" != "y" ] && [ "$KEYMAP" != "Y" ]; then
exit 0
fi
# Step 1 - Basic tools
if [ ! -x /sbin/loadkeys -a ! -r /lib/rc/console/keymap ]; then
exit 0
fi
[ ! -x /sbin/loadkeys -a ! -x /sbin/dumpkeys ] && exit 0
. /usr/share/initramfs-tools/hook-functions
copy_exec /sbin/loadkeys /sbin
cp /lib/rc/console/keymap ${DESTDIR}/etc/boottime.kmap
gzip -9 ${DESTDIR}/etc/boottime.kmap
# Step 2 - Check for UTF8 console
if [ ! -x /sbin/kbd_mode ]; then
exit 0
fi
if [ -r /etc/profile.d/locale ]; then
env="/etc/profile.d/locale"
else
exit 0
fi
for var in LANG LC_ALL LC_CTYPE; do
value=$(egrep "^[^#]*${var}=" $env | tail -n1 | cut -d= -f2)
eval $var=$value
done
charmap=$(LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap)
if [ "$charmap" = "UTF-8" ]; then
copy_exec /sbin/kbd_mode /sbin
fi
/sbin/dumpkeys > ${DESTDIR}/kmap-tmp
/sbin/loadkeys -u -b ${DESTDIR}/kmap-tmp > ${DESTDIR}/etc/bkeymap
rm -f ${DESTDIR}/kmap-tmp
exit 0

View File

@ -13,15 +13,12 @@ prereqs)
;;
esac
OPTS="-q"
# Should terminal be in UTF8 mode?
if [ -x /sbin/kbd_mode ]; then
/sbin/kbd_mode -u
OPTS="${OPTS} -u"
if [ -x /bin/kbd_mode ]; then
/bin/kbd_mode -u -C /dev/console
fi
# Load custom keymap
if [ -x /sbin/loadkeys -a -r /etc/boottime.kmap.gz ]; then
loadkeys ${OPTS} /etc/boottime.kmap.gz
if [ -x /bin/loadkmap -a -r /etc/bkeymap ]; then
/bin/loadkmap < /etc/bkeymap
fi

View File

@ -1,6 +1,6 @@
# Template file for 'initramfs-tools'
pkgname=initramfs-tools
_localver=101 # This is the XBPS version
_localver=103 # This is the XBPS version
_distver=0.99 # This should match debian version
version=${_distver}.${_localver}
build_style=custom-install
@ -36,7 +36,7 @@ Add_dependency full bzip2
Add_dependency full xz
Add_dependency full udev
Add_dependency full module-init-tools
Add_dependency full busybox
Add_dependency full busybox ">=1.19.2" # loadkmap
Add_dependency full klibc-resume
do_install()