This commit is contained in:
parent
478b91b9fd
commit
935dd3d2c7
49
fbtest.8
Normal file
49
fbtest.8
Normal file
@ -0,0 +1,49 @@
|
||||
'\" -*- coding: UTF-8 -*-
|
||||
.\"
|
||||
.\" Copyright 2008 Werner Fink, 2008 SUSE LINUX Products GmbH, Germany.
|
||||
.\"
|
||||
.\" This program is free software; you can redistribute it and/or modify
|
||||
.\" it under the terms of the GNU General Public License as published by
|
||||
.\" the Free Software Foundation; either version 2 of the License, or
|
||||
.\" (at your option) any later version.
|
||||
.\"
|
||||
.TH FBTEST 8 "May 6, 2008" "0.42" "International Support"
|
||||
.SH NAME
|
||||
fbtest \- test if a virtual console is mapped to a frame buffer devive
|
||||
.SH SYNOPSIS
|
||||
.B fbtest
|
||||
.RB [ \-f \ \fI<fb_device>\fR]
|
||||
.RB [ \-C \ \fI<vc_device>\fR]
|
||||
.br
|
||||
.B fbtest
|
||||
.B \-\-help
|
||||
.SH DESCRIPTION
|
||||
The program
|
||||
.BR fbtest (8)
|
||||
is used to test if a virtual console, e.g.
|
||||
.I /dev/tty1
|
||||
is mapped on a frame buffer device.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-f ,\ \-\-fb = \fI<fb_device>\fR
|
||||
This option specifies an other frame buffer device than
|
||||
the default
|
||||
.IR /dev/fb0 .
|
||||
.TP
|
||||
.BR \-C ,\ \-\-vc = \fI<vc_device>\fR
|
||||
This option specifies an other virtual console than the default
|
||||
.IR /dev/tty1 .
|
||||
.SH EXIT STATUS
|
||||
.IP \fB0\fR 5
|
||||
The virtual console is mapped onto a frame buffer device.
|
||||
.IP \fB1\fR 5
|
||||
The virtual console is
|
||||
.B not
|
||||
mapped onto a frame buffer device.
|
||||
.PP
|
||||
.SH FILES
|
||||
.I /dev/fb0
|
||||
.br
|
||||
.I /dev/tty<1...63>
|
||||
.SH SEE ALSO
|
||||
.BR fbset (8).
|
111
fbtest.c
Normal file
111
fbtest.c
Normal file
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* fbtest(.c)
|
||||
*
|
||||
* Copyright 2008 Werner Fink, 2008 SUSE LINUX Products GmbH, Germany.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/fb.h>
|
||||
|
||||
static struct option options[] = {
|
||||
{ "fb", required_argument, 0, 'f'},
|
||||
{ "vc", required_argument, 0, 'C'},
|
||||
{ "help", no_argument, 0, 'h'},
|
||||
{ (const char*)0, 0, (int*)0, 0}
|
||||
};
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
struct fb_con2fbmap map = {1, -1};
|
||||
const char *base = basename(argv[0]);
|
||||
const char * fb = (char*)0;
|
||||
const char * vc = (char*)0;
|
||||
struct stat st;
|
||||
int c, fd;
|
||||
|
||||
opterr = 0;
|
||||
while ((c = getopt_long(argc, argv, "hf:C:", options, (int *)0)) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
fb = optarg;
|
||||
break;
|
||||
case 'C':
|
||||
vc = optarg;
|
||||
break;
|
||||
case 'h':
|
||||
fprintf(stderr, "%s: Usage:\n %s [-f <fb_device>] [-C <vc_device>]\n", base, base);
|
||||
fprintf(stderr, "Valid options are:\n");
|
||||
fprintf(stderr, " -f <fb_device> The frame buffer device (default /dev/fb0)\n");
|
||||
fprintf(stderr, " -C <vc_device> The virtual console device (default /dev/tty1)\n");
|
||||
return 0;
|
||||
case '?':
|
||||
fprintf(stdout, "%s: Invalid option for help use:\n %s --help\n", base, base);
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fb == (char*)0) {
|
||||
fb = "/dev/fb/0";
|
||||
if (stat(fb, &st) < 0) {
|
||||
if (errno != ENOENT && errno != ENOTDIR) {
|
||||
fprintf(stderr, "%s: %s: %m\n", base, fb);
|
||||
return 1;
|
||||
}
|
||||
fb = "/dev/fb0";
|
||||
if (stat(fb, &st) < 0) {
|
||||
fprintf(stderr, "%s: %s: %m\n", base, fb);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vc == (char*)0)
|
||||
vc = "/dev/tty1";
|
||||
|
||||
if (stat(vc, &st) < 0) {
|
||||
fprintf(stderr, "%s: %s: %m\n", base, vc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (major(st.st_rdev) != (dev_t)4) {
|
||||
errno = ECANCELED;
|
||||
fprintf(stderr, "%s: %s: %m\n", base, vc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((fd = open(fb, O_RDONLY|O_NOCTTY)) < 0) {
|
||||
if (errno != ENODEV)
|
||||
fprintf(stderr, "%s: %s: %m\n", base, fb);
|
||||
return 1;
|
||||
}
|
||||
|
||||
map.console = (typeof(map.console))minor(st.st_rdev);
|
||||
map.framebuffer = (typeof(map.framebuffer))-1;
|
||||
|
||||
if (ioctl(fd, FBIOGET_CON2FBMAP, &map) < 0) {
|
||||
fprintf(stderr, "%s: %s: %m\n", base, fb);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return map.framebuffer > FB_MAX;
|
||||
}
|
@ -1,6 +1,37 @@
|
||||
--- kbd-1.12/src/kdfontop.c.orig 2004-01-16 20:45:31.000000000 +0100
|
||||
--- kbd-1.12/man/man8/showconsolefont.8
|
||||
+++ kbd-1.12/man/man8/showconsolefont.8 2008-05-07 18:19:41.000000000 +0200
|
||||
@@ -13,15 +13,25 @@ showconsolefont \- Show the current EGA/
|
||||
.B \-C
|
||||
.I console
|
||||
]
|
||||
+[
|
||||
+.B \-i
|
||||
+]
|
||||
+
|
||||
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B showconsolefont
|
||||
command outputs the current console font to stdout.
|
||||
-The option \-v prints additional information, while
|
||||
-the option \-V prints the program version number.
|
||||
-On Linux 2.6.1 and later, the option \-C allows one
|
||||
+The option \fB\-v\fR prints additional information, while
|
||||
+the option \fB\-V\fR prints the program version number.
|
||||
+On Linux 2.6.1 and later, the option \fB\-C\fR allows one
|
||||
to indicate the console involved. Its argument is a pathname.
|
||||
+The option \fB\-i\fR cause
|
||||
+.B showconsolefont
|
||||
+not to show the font table but show the value of the
|
||||
+used ROWS, COLUMNS, and character COUNT of the current
|
||||
+font with the format
|
||||
+.BR ROWS x COLUMNS x COUNT .
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR setfont (8)
|
||||
--- kbd-1.12/src/kdfontop.c
|
||||
+++ kbd-1.12/src/kdfontop.c 2006-07-26 18:14:55.000000000 +0200
|
||||
@@ -142,8 +142,11 @@
|
||||
@@ -142,8 +142,11 @@ font_charheight(char *buf, int count, in
|
||||
return h;
|
||||
}
|
||||
|
||||
@ -14,7 +45,7 @@
|
||||
int
|
||||
getfont(int fd, char *buf, int *count, int *width, int *height) {
|
||||
struct consolefontdesc cfd;
|
||||
@@ -193,6 +196,11 @@
|
||||
@@ -193,6 +196,11 @@ getfont(int fd, char *buf, int *count, i
|
||||
fprintf(stderr, _("bug: getfont called with count<256\n"));
|
||||
return -1;
|
||||
}
|
||||
@ -26,7 +57,7 @@
|
||||
i = ioctl(fd, GIO_FONT, buf);
|
||||
if (i) {
|
||||
perror("getfont: GIO_FONT");
|
||||
@@ -208,11 +216,11 @@
|
||||
@@ -206,11 +214,11 @@ getfont(int fd, char *buf, int *count, i
|
||||
|
||||
int
|
||||
getfontsize(int fd) {
|
||||
@ -41,9 +72,9 @@
|
||||
return (i == 0) ? count : 256;
|
||||
}
|
||||
|
||||
--- kbd-1.12/src/showconsolefont.c.orig 2004-01-16 20:45:31.000000000 +0100
|
||||
+++ kbd-1.12/src/showconsolefont.c 2006-07-26 18:40:31.000000000 +0200
|
||||
@@ -101,8 +101,15 @@
|
||||
--- kbd-1.12/src/showconsolefont.c
|
||||
+++ kbd-1.12/src/showconsolefont.c 2008-05-07 18:27:36.130879445 +0200
|
||||
@@ -101,8 +101,15 @@ setnewunicodemap(int *list, int cnt) {
|
||||
static void
|
||||
usage(void) {
|
||||
fprintf(stderr,
|
||||
@ -61,7 +92,7 @@
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -110,7 +117,7 @@
|
||||
@@ -110,7 +117,7 @@ int
|
||||
main (int argc, char **argv) {
|
||||
int c, n, cols, rows, nr, i, j, k;
|
||||
char *sep, *console = NULL;
|
||||
@ -70,7 +101,7 @@
|
||||
|
||||
set_progname(argv[0]);
|
||||
|
||||
@@ -122,8 +129,11 @@
|
||||
@@ -122,8 +129,11 @@ main (int argc, char **argv) {
|
||||
(!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
|
||||
print_version_and_exit();
|
||||
|
||||
@ -83,7 +114,7 @@
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
break;
|
||||
@@ -135,9 +145,26 @@
|
||||
@@ -135,11 +145,28 @@ main (int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +122,9 @@
|
||||
+ if (optind != argc)
|
||||
usage();
|
||||
|
||||
+ if (info)
|
||||
fd = getfd(console);
|
||||
|
||||
+ if (info)
|
||||
+ {
|
||||
+ nr = rows = cols = 0;
|
||||
+ n = getfont(fd, NULL, &nr, &rows, &cols);
|
||||
@ -108,6 +141,6 @@
|
||||
+ leave(0);
|
||||
+ }
|
||||
+
|
||||
fd = getfd(console);
|
||||
|
||||
settrivialscreenmap();
|
||||
getoldunicodemap();
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed May 7 18:34:11 CEST 2008 - werner@suse.de
|
||||
|
||||
- Add description of option -i of showconsolefont (bnc#385200)
|
||||
- Make showconsolefont option -i work together with option -C
|
||||
- Add fbtest program and fbtest manual page
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 5 17:21:42 CEST 2008 - jw@suse.de
|
||||
|
||||
|
230
kbd.init
230
kbd.init
@ -43,7 +43,7 @@ LOCALE_CHARMAP=`locale charmap`
|
||||
LC_ALL=POSIX
|
||||
|
||||
MACHINE=`/bin/uname -m 2> /dev/null`
|
||||
if [ "$MACHINE" = "sparc" -o "$MACHINE" = "sparc64" ]; then
|
||||
if test "$MACHINE" = "sparc" -o "$MACHINE" = "sparc64" ; then
|
||||
# Test if we have a serial console.
|
||||
(test -c /dev/tty1 && > /dev/tty1 ) > /dev/null 2>&1 || exit 0
|
||||
fi
|
||||
@ -65,18 +65,18 @@ KTABLE=${KTABLE##*/}
|
||||
#
|
||||
# first search the wanted keytable.
|
||||
#
|
||||
if [ $MACHINE = ppc -o $MACHINE = ppc64 ]; then
|
||||
if test $MACHINE = ppc -o $MACHINE = ppc64 ; then
|
||||
test -f /proc/cpuinfo || mount -n -t proc proc /proc 2>/dev/null
|
||||
while read line; do
|
||||
case "$line" in
|
||||
*MacRISC*) MACHINE="mac"
|
||||
test -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes && \
|
||||
echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
|
||||
;;
|
||||
*CHRP*) MACHINE="chrp";;
|
||||
*PReP*) MACHINE="prep" ;;
|
||||
*PS3*) MACHINE="ps3" ;;
|
||||
*iSeries*) exit 0 ;;
|
||||
*MacRISC*) MACHINE="mac"
|
||||
test -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes && \
|
||||
echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
|
||||
;;
|
||||
*CHRP*) MACHINE="chrp";;
|
||||
*PReP*) MACHINE="prep" ;;
|
||||
*PS3*) MACHINE="ps3" ;;
|
||||
*iSeries*) exit 0 ;;
|
||||
esac
|
||||
done < /proc/cpuinfo
|
||||
fi
|
||||
@ -154,18 +154,18 @@ function set_kbdrate ()
|
||||
local line
|
||||
|
||||
if test "$MACHINE" != "mac" ; then
|
||||
KBDOPT=""
|
||||
if test -n "$KBD_RATE" ; then
|
||||
KBDOPT="${KBDOPT:+$KBDOPT }-r $KBD_RATE"
|
||||
fi
|
||||
if test -n "$KBD_DELAY"; then
|
||||
KBDOPT="${KBDOPT:+$KBDOPT }-d $KBD_DELAY"
|
||||
fi
|
||||
if test -n "$KBDOPT" ; then
|
||||
echo -n "Keyboard: "
|
||||
/bin/kbdrate $KBDOPT
|
||||
rc_status -v1
|
||||
fi
|
||||
KBDOPT=""
|
||||
if test -n "$KBD_RATE" ; then
|
||||
KBDOPT="${KBDOPT:+$KBDOPT }-r $KBD_RATE"
|
||||
fi
|
||||
if test -n "$KBD_DELAY"; then
|
||||
KBDOPT="${KBDOPT:+$KBDOPT }-d $KBD_DELAY"
|
||||
fi
|
||||
if test -n "$KBDOPT" ; then
|
||||
echo -n "Keyboard: "
|
||||
/bin/kbdrate $KBDOPT
|
||||
rc_status -v1
|
||||
fi
|
||||
fi
|
||||
|
||||
# setleds
|
||||
@ -175,23 +175,23 @@ function set_kbdrate ()
|
||||
# user even under X11
|
||||
#
|
||||
if test "$KBD_NUMLOCK" = "yes"; then
|
||||
touch /var/run/numlock-on
|
||||
touch /var/run/numlock-on
|
||||
elif test "$KBD_NUMLOCK" = "no"; then
|
||||
rm -f /var/run/numlock-on
|
||||
rm -f /var/run/numlock-on
|
||||
elif test "$KBD_NUMLOCK" = "bios"; then
|
||||
if test -x /usr/sbin/hwinfo ; then
|
||||
/usr/sbin/hwinfo --bios | \
|
||||
while read line ; do
|
||||
case "$line" in
|
||||
if test -x /usr/sbin/hwinfo ; then
|
||||
/usr/sbin/hwinfo --bios | \
|
||||
while read line ; do
|
||||
case "$line" in
|
||||
Num\ Lock:\ on) touch /var/run/numlock-on ;;
|
||||
Num\ Lock:\ off) rm -f /var/run/numlock-on ;;
|
||||
Caps\ Lock:) break
|
||||
esac
|
||||
done
|
||||
else
|
||||
echo "no /usr/sbin -> Numlock off."
|
||||
rm -f /var/run/numlock-on
|
||||
fi
|
||||
esac
|
||||
done
|
||||
else
|
||||
echo "no /usr/sbin -> Numlock off."
|
||||
rm -f /var/run/numlock-on
|
||||
fi
|
||||
fi
|
||||
unset line
|
||||
|
||||
@ -201,19 +201,19 @@ function set_kbdrate ()
|
||||
type -p setleds &> /dev/null || return
|
||||
|
||||
if test -e /var/run/numlock-on ; then
|
||||
LEDOPT="+num"
|
||||
LEDOPT="+num"
|
||||
else
|
||||
LEDOPT="-num"
|
||||
LEDOPT="-num"
|
||||
fi
|
||||
if test "$KBD_CAPSLOCK" = "yes"; then
|
||||
LEDOPT="$LEDOPT +caps"
|
||||
LEDOPT="$LEDOPT +caps"
|
||||
else
|
||||
LEDOPT="$LEDOPT -caps"
|
||||
LEDOPT="$LEDOPT -caps"
|
||||
fi
|
||||
if test "$KBD_SCRLOCK" = "yes"; then
|
||||
LEDOPT="$LEDOPT +scroll"
|
||||
LEDOPT="$LEDOPT +scroll"
|
||||
else
|
||||
LEDOPT="$LEDOPT -scroll"
|
||||
LEDOPT="$LEDOPT -scroll"
|
||||
fi
|
||||
|
||||
#
|
||||
@ -221,17 +221,31 @@ function set_kbdrate ()
|
||||
# on ... OR if they are switched on currently
|
||||
#
|
||||
if [[ $LEDOPT == *+* ]] ; then
|
||||
touch /var/run/setleds-on
|
||||
touch /var/run/setleds-on
|
||||
else
|
||||
test -e /var/run/setleds-on || return
|
||||
test -n "$LEDOPT" || return
|
||||
rm -f /var/run/setleds-on
|
||||
test -e /var/run/setleds-on || return
|
||||
test -n "$LEDOPT" || return
|
||||
rm -f /var/run/setleds-on
|
||||
fi
|
||||
|
||||
for tty in $KBD_TTY; do
|
||||
setleds -D $LEDOPT < $tty
|
||||
setleds -D $LEDOPT < $tty
|
||||
done
|
||||
}
|
||||
|
||||
function console_font_height ()
|
||||
{
|
||||
if test -x /sbin/fbtest && /sbin/fbtest -C $1 ; then
|
||||
echo 16
|
||||
else
|
||||
set -- $(IFS=x /bin/showconsolefont -i -C $1 2> /dev/null)
|
||||
if test -n "$2" ; then
|
||||
echo $2
|
||||
else
|
||||
echo 8
|
||||
fi
|
||||
fi
|
||||
}
|
||||
#
|
||||
rc_reset
|
||||
case "$1" in
|
||||
@ -284,8 +298,8 @@ case "$1" in
|
||||
echo "$KEYMAP" > /var/run/keymap
|
||||
else
|
||||
case "$RUNLEVEL" in
|
||||
S|N|1|\#) true ;;
|
||||
*) rc_failed ;;
|
||||
S|N|1|\#) true ;;
|
||||
*) rc_failed ;;
|
||||
esac
|
||||
fi
|
||||
echo "Loading keymap ${retmsg#Loading*${KBDBASE}/keymaps/}"
|
||||
@ -296,7 +310,7 @@ case "$1" in
|
||||
|
||||
# Disable CAPS LOCK key if wanted
|
||||
if test "$KBD_DISABLE_CAPS_LOCK" = "yes"; then
|
||||
loadkeys -C "$KBD_TTY" disable.capslock >/dev/null 2>&1 || echo "Could not disable Caps Lock"
|
||||
loadkeys -C "$KBD_TTY" disable.capslock >/dev/null 2>&1 || echo "Could not disable Caps Lock"
|
||||
fi
|
||||
|
||||
# Load compose tables
|
||||
@ -304,29 +318,29 @@ case "$1" in
|
||||
S|N|1|\#) COMPOSETABLE="" ;;
|
||||
esac
|
||||
if test ! -z "$COMPOSETABLE"; then
|
||||
unset COMPOSELOADED COMPOSECLEAR
|
||||
for name in $COMPOSETABLE; do
|
||||
# Test for compose clear flag
|
||||
if test "$name" = "-c" -o "$name" = "clear"; then
|
||||
COMPOSECLEAR=-c
|
||||
continue
|
||||
fi
|
||||
# Handle the first table differently ...
|
||||
if test -z "$COMPOSELOADED"; then
|
||||
echo -n "Loading compose table $name"
|
||||
loadkeys -C "$KBD_TTY" $COMPOSECLEAR compose.$name >/dev/null 2>&1
|
||||
rc_check
|
||||
#if test $name = clear; then rc_reset; fi
|
||||
COMPOSELOADED=1
|
||||
else
|
||||
echo -n " $name"
|
||||
loadkeys -C "$KBD_TTY" compose.$name >/dev/null 2>&1
|
||||
rc_check
|
||||
fi
|
||||
done
|
||||
if test ! -z "$COMPOSELOADED"; then
|
||||
rc_status -v
|
||||
unset COMPOSELOADED COMPOSECLEAR
|
||||
for name in $COMPOSETABLE; do
|
||||
# Test for compose clear flag
|
||||
if test "$name" = "-c" -o "$name" = "clear"; then
|
||||
COMPOSECLEAR=-c
|
||||
continue
|
||||
fi
|
||||
# Handle the first table differently ...
|
||||
if test -z "$COMPOSELOADED"; then
|
||||
echo -n "Loading compose table $name"
|
||||
loadkeys -C "$KBD_TTY" $COMPOSECLEAR compose.$name >/dev/null 2>&1
|
||||
rc_check
|
||||
#if test $name = clear; then rc_reset; fi
|
||||
COMPOSELOADED=1
|
||||
else
|
||||
echo -n " $name"
|
||||
loadkeys -C "$KBD_TTY" compose.$name >/dev/null 2>&1
|
||||
rc_check
|
||||
fi
|
||||
done
|
||||
if test ! -z "$COMPOSELOADED"; then
|
||||
rc_status -v
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@ -376,61 +390,37 @@ case "$1" in
|
||||
fi
|
||||
|
||||
if test "$MACHINE" = "ps3" ; then
|
||||
# do not mess up console
|
||||
unset CONSOLE_FONT
|
||||
fi
|
||||
|
||||
## bnc#164378
|
||||
if test "$CONSOLE_FONT" = "default"; then
|
||||
if test -z "$CONSOLE_FONT_HEIGHT" -o "$CONSOLE_FONT_HEIGHT" = "auto" ; then
|
||||
if test -x /sbin/fbset && /sbin/fbset -s > /dev/null 2>&1 ; then
|
||||
CONSOLE_FONT_HEIGHT=16
|
||||
else
|
||||
for tty in $KBD_TTY; do
|
||||
# Showconsolefont tries to open a device
|
||||
test "${tty##*/}" = "${tty}" && tty=/dev/$tty
|
||||
vidmode=$(/bin/showconsolefont -i < $tty 2> /dev/null)
|
||||
break
|
||||
done
|
||||
if test -z "$vidmode" ; then
|
||||
CONSOLE_FONT_HEIGHT=8
|
||||
else
|
||||
vidmode=${vidmode#*x}
|
||||
vidmode=${vidmode%x*}
|
||||
CONSOLE_FONT_HEIGHT=$vidmode
|
||||
fi
|
||||
unset vidmode
|
||||
fi
|
||||
fi
|
||||
# do not mess up console
|
||||
unset CONSOLE_FONT
|
||||
fi
|
||||
# setfont
|
||||
if test -d ${KBDBASE}/consolefonts -a \
|
||||
-n "$CONSOLE_FONT" -a "$CONSOLE_FONT" != "YAST_ASK"
|
||||
then
|
||||
if test ! -z "$CONSOLE_UNICODEMAP"; then
|
||||
UMAP="-u $CONSOLE_UNICODEMAP"
|
||||
UMAP="-u $CONSOLE_UNICODEMAP"
|
||||
fi
|
||||
if test ! -z "$CONSOLE_SCREENMAP"; then
|
||||
SMAP="-m $CONSOLE_SCREENMAP"
|
||||
SMAP="-m $CONSOLE_SCREENMAP"
|
||||
fi
|
||||
PRINTABLE_MAGIC="";
|
||||
if test -n "$CONSOLE_MAGIC" -a "$CONSOLE_MAGIC" != "none"; then
|
||||
case $CONSOLE_MAGIC in
|
||||
\(B) PRINTABLE_MAGIC="G0:iso8859-1" ;;
|
||||
\(0) PRINTABLE_MAGIC="G0:vt100" ;;
|
||||
\(U) PRINTABLE_MAGIC="G0:ROM" ;;
|
||||
\(K) PRINTABLE_MAGIC="G0:loadable" ;;
|
||||
\)B) PRINTABLE_MAGIC="G1:iso8859-1" ;;
|
||||
\)0) PRINTABLE_MAGIC="G1:vt100" ;;
|
||||
\)U) PRINTABLE_MAGIC="G1:ROM" ;;
|
||||
\)K) PRINTABLE_MAGIC="G1:loadable" ;;
|
||||
*) PRINTABLE_MAGIC="magic='$CONSOLE_MAGIC'" ;;
|
||||
esac
|
||||
CONSOLE_MAGIC="\033$CONSOLE_MAGIC"
|
||||
case $CONSOLE_MAGIC in
|
||||
\(B) PRINTABLE_MAGIC="G0:iso8859-1" ;;
|
||||
\(0) PRINTABLE_MAGIC="G0:vt100" ;;
|
||||
\(U) PRINTABLE_MAGIC="G0:ROM" ;;
|
||||
\(K) PRINTABLE_MAGIC="G0:loadable" ;;
|
||||
\)B) PRINTABLE_MAGIC="G1:iso8859-1" ;;
|
||||
\)0) PRINTABLE_MAGIC="G1:vt100" ;;
|
||||
\)U) PRINTABLE_MAGIC="G1:ROM" ;;
|
||||
\)K) PRINTABLE_MAGIC="G1:loadable" ;;
|
||||
*) PRINTABLE_MAGIC="magic='$CONSOLE_MAGIC'" ;;
|
||||
esac
|
||||
CONSOLE_MAGIC="\033$CONSOLE_MAGIC"
|
||||
else
|
||||
CONSOLE_MAGIC="";
|
||||
CONSOLE_MAGIC="";
|
||||
fi
|
||||
if test -x /bin/setfont ; then
|
||||
if test -x /bin/setfont -a -n "$CONSOLE_FONT" ; then
|
||||
echo "Loading console font $CONSOLE_FONT $UMAP $SMAP $PRINTABLE_MAGIC"
|
||||
for tty in $KBD_TTY; do
|
||||
# The chvt is not needed for SuSE kernels
|
||||
@ -440,7 +430,7 @@ case "$1" in
|
||||
test "${tty##*/}" = "${tty}" && tty=/dev/$tty
|
||||
|
||||
if test "$CONSOLE_FONT" = "default" ; then
|
||||
/bin/setfont -C $tty -$CONSOLE_FONT_HEIGHT $UMAP $SMAP
|
||||
/bin/setfont -C $tty -$(console_font_height $tty) $UMAP $SMAP
|
||||
else
|
||||
/bin/setfont -C $tty $CONSOLE_FONT $UMAP $SMAP
|
||||
fi
|
||||
@ -458,19 +448,19 @@ case "$1" in
|
||||
*)
|
||||
case $LOCALE_CHARMAP in
|
||||
UTF-8)
|
||||
# Change the keyboard mapping in such a way that the
|
||||
# non-ASCII keys produce UTF-8 encoded multibyte sequences
|
||||
# Change the keyboard mapping in such a way that the
|
||||
# non-ASCII keys produce UTF-8 encoded multibyte sequences
|
||||
# instead of single bytes >= 0x80 in a legacy 8-bit encoding.
|
||||
( dumpkeys | loadkeys -C "$KBD_TTY" --unicode ) > /dev/null 2>&1
|
||||
;;
|
||||
( dumpkeys | loadkeys -C "$KBD_TTY" --unicode ) > /dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
dumpkeys=yes
|
||||
if type -p cmp > /dev/null 2>&1 && \
|
||||
dumpkeys | cmp -s /etc/defkeymap.map
|
||||
dumpkeys | cmp -s /etc/defkeymap.map
|
||||
then
|
||||
dumpkeys=no
|
||||
dumpkeys=no
|
||||
fi
|
||||
|
||||
if test "$dumpkeys" = "yes" ; then
|
||||
|
15
kbd.spec
15
kbd.spec
@ -17,7 +17,7 @@ License: GPL v2 or later
|
||||
Group: System/Console
|
||||
AutoReqProv: on
|
||||
Version: 1.12
|
||||
Release: 176
|
||||
Release: 178
|
||||
Summary: Keyboard and Font Utilities
|
||||
Source: ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/kbd/%{name}-%{version}.tar.bz2
|
||||
Source1: kbd_fonts.tar.bz2
|
||||
@ -29,6 +29,8 @@ Source6: kbd.fillup.nonpc
|
||||
Source8: sysconfig.console
|
||||
Source9: sysconfig.keyboard
|
||||
Source10: testutf8.c
|
||||
Source11: fbtest.c
|
||||
Source12: fbtest.8
|
||||
Source42: convert-kbd-mac.sed
|
||||
Source43: repack_kbd.sh
|
||||
Patch: kbd-%{version}.diff
|
||||
@ -125,6 +127,7 @@ done
|
||||
./configure --prefix=/ --datadir=%{kbd} --mandir=%{_mandir}
|
||||
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Os"
|
||||
gcc $RPM_OPT_FLAGS -o testutf8 $RPM_SOURCE_DIR/testutf8.c
|
||||
gcc $RPM_OPT_FLAGS -o fbtest $RPM_SOURCE_DIR/fbtest.c
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/bin
|
||||
@ -237,7 +240,9 @@ cat %SOURCE6 >> $FILLUP_DIR/sysconfig.keyboard
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/getkeycodes.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/setkeycodes.8*
|
||||
%endif
|
||||
install -m 755 ./testutf8 $RPM_BUILD_ROOT/bin/
|
||||
install -m 755 testutf8 $RPM_BUILD_ROOT/bin/
|
||||
install -m 755 fbtest $RPM_BUILD_ROOT/sbin/
|
||||
install -m 644 %SOURCE12 $RPM_BUILD_ROOT/%{_mandir}/man8/
|
||||
%find_lang %{name}
|
||||
|
||||
%post
|
||||
@ -261,6 +266,7 @@ install -m 755 ./testutf8 $RPM_BUILD_ROOT/bin/
|
||||
%dir %{kbd}
|
||||
%{kbd}
|
||||
/sbin/rckbd
|
||||
/sbin/fbtest
|
||||
/bin/chvt
|
||||
/bin/openvt
|
||||
/bin/deallocvt
|
||||
@ -318,6 +324,7 @@ install -m 755 ./testutf8 $RPM_BUILD_ROOT/bin/
|
||||
%doc %{_mandir}/man8/resizecons.8.gz
|
||||
%endif
|
||||
%doc %{_mandir}/man8/setfont.8.gz
|
||||
%doc %{_mandir}/man8/fbtest.8.gz
|
||||
%doc %{_mandir}/man1/openvt.1.gz
|
||||
%doc %{_mandir}/man1/unicode_start.1.gz
|
||||
%doc %{_mandir}/man1/unicode_stop.1.gz
|
||||
@ -327,6 +334,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
#rm -rf $RPM_BUILD_DIR/kbd-%{version}
|
||||
|
||||
%changelog
|
||||
* Wed May 07 2008 werner@suse.de
|
||||
- Add description of option -i of showconsolefont (bnc#385200)
|
||||
- Make showconsolefont option -i work together with option -C
|
||||
- Add fbtest program and fbtest manual page
|
||||
* Mon May 05 2008 jw@suse.de
|
||||
- added fix for bnc#164378 from werner.
|
||||
* Fri Apr 25 2008 jw@suse.de
|
||||
|
Loading…
x
Reference in New Issue
Block a user