SHA256
1
0
forked from pool/kbd
OBS User unknown 2009-06-10 00:16:36 +00:00 committed by Git OBS Bridge
parent 0593934957
commit d031079ffd
5 changed files with 39 additions and 137 deletions

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue May 19 16:25:37 CEST 2009 - mmarek@suse.cz
- remove testutf8 (replace with a script that returns 2 in any
terminal), it's a hack that has a number of problems (bnc#436378,
bnc#334889). Users who don't want utf8 should adjust their locale
setting accordingly.
-------------------------------------------------------------------
Tue May 19 14:40:11 CEST 2009 - mmarek@suse.cz
- do not load any usb drivers, udev takes care of this (bnc#482316).
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Nov 10 12:10:09 CET 2008 - mmarek@suse.cz Mon Nov 10 12:10:09 CET 2008 - mmarek@suse.cz

View File

@ -101,37 +101,6 @@ done
KBD_TTY="$newkbd" KBD_TTY="$newkbd"
unset newkbd unset newkbd
#
# load usb drivers in runlevel S
#
case "${PREVLEVEL}${RUNLEVEL}" in
N1|NS)
test -f /proc/cpuinfo || mount -n -t proc proc /proc 2>/dev/null
# [bugzilla #46113]
# we come here although heading for runlevel 5.
# I'll comment out diabling hotplug for now. jw.
# test -f /proc/sys/kernel/hotplug && echo /bin/true > /proc/sys/kernel/hotplug 2>/dev/null
test -d /proc/bus/usb || modprobe usbcore >/dev/null 2>&1
mount -n -t usbfs usbfs /proc/bus/usb >/dev/null 2>&1
for mod in ehci-hcd ohci-hcd uhci-hcd usb-ohci usb-uhci ; do
echo -n $mod" "
modprobe $mod >/dev/null 2>&1
done
# [bugzilla #284348]
# sleep is no longer needed. horay!
#
# echo
# echo "wait 3 seconds for USB initialisation ..."
# sleep 3
for mod in usbhid input hid keybdev ; do
modprobe $mod >/dev/null 2>&1
done
;;
esac
KEYMAP=() KEYMAP=()
if test -e /$KEYTABLE ; then if test -e /$KEYTABLE ; then
KEYMAP=($KEYTABLE) KEYMAP=($KEYTABLE)

View File

@ -1,7 +1,7 @@
# #
# spec file for package kbd (Version 1.14.1) # spec file for package kbd (Version 1.14.1)
# #
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -24,7 +24,7 @@ License: GPL v2 or later
Group: System/Console Group: System/Console
AutoReqProv: on AutoReqProv: on
Version: 1.14.1 Version: 1.14.1
Release: 16 Release: 17
Summary: Keyboard and Font Utilities Summary: Keyboard and Font Utilities
Source: kbd-%{version}.tar.bz2 Source: kbd-%{version}.tar.bz2
Source1: kbd_fonts.tar.bz2 Source1: kbd_fonts.tar.bz2
@ -35,7 +35,7 @@ Source5: kbd.fillup
Source6: kbd.fillup.nonpc Source6: kbd.fillup.nonpc
Source8: sysconfig.console Source8: sysconfig.console
Source9: sysconfig.keyboard Source9: sysconfig.keyboard
Source10: testutf8.c Source10: testutf8
Source11: fbtest.c Source11: fbtest.c
Source12: fbtest.8 Source12: fbtest.8
Source42: convert-kbd-mac.sed Source42: convert-kbd-mac.sed
@ -105,7 +105,6 @@ popd
--enable-nls \ --enable-nls \
--localedir=/usr/share/locale --localedir=/usr/share/locale
make CFLAGS="$RPM_OPT_FLAGS -Os" make CFLAGS="$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 gcc $RPM_OPT_FLAGS -o fbtest $RPM_SOURCE_DIR/fbtest.c
# fix lat2-16.psfu (bnc#340579) # fix lat2-16.psfu (bnc#340579)
font=data/consolefonts/lat2a-16.psfu font=data/consolefonts/lat2a-16.psfu
@ -227,7 +226,7 @@ cat %SOURCE6 >> $FILLUP_DIR/sysconfig.keyboard
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/getkeycodes.8* rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/getkeycodes.8*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/setkeycodes.8* rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/setkeycodes.8*
%endif %endif
install -m 755 testutf8 $RPM_BUILD_ROOT/bin/ install -m 755 %_sourcedir/testutf8 $RPM_BUILD_ROOT/bin/
install -m 755 fbtest $RPM_BUILD_ROOT/sbin/ install -m 755 fbtest $RPM_BUILD_ROOT/sbin/
install -m 644 %SOURCE12 $RPM_BUILD_ROOT/%{_mandir}/man8/ install -m 644 %SOURCE12 $RPM_BUILD_ROOT/%{_mandir}/man8/
%find_lang %{name} %find_lang %{name}
@ -308,6 +307,13 @@ install -m 644 %SOURCE12 $RPM_BUILD_ROOT/%{_mandir}/man8/
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Tue May 19 2009 mmarek@suse.cz
- remove testutf8 (replace with a script that returns 2 in any
terminal), it's a hack that has a number of problems (bnc#436378,
bnc#334889). Users who don't want utf8 should adjust their locale
setting accordingly.
* Tue May 19 2009 mmarek@suse.cz
- do not load any usb drivers, udev takes care of this (bnc#482316).
* Mon Nov 10 2008 mmarek@suse.cz * Mon Nov 10 2008 mmarek@suse.cz
- rename Spanish keymap for olpc to es-olpc to avoid ambiguity - rename Spanish keymap for olpc to es-olpc to avoid ambiguity
(bnc#435121) (bnc#435121)
@ -640,7 +646,7 @@ rm -rf $RPM_BUILD_ROOT
* Thu Aug 15 2002 olh@suse.de * Thu Aug 15 2002 olh@suse.de
- fix some keys with kbd-1.06-mac-dk.diff - fix some keys with kbd-1.06-mac-dk.diff
do the symlinks in mac/all instead of mac/ do the symlinks in mac/all instead of mac/
* Sun Aug 04 2002 olh@suse.de * Mon Aug 05 2002 olh@suse.de
- merge boot.setup into rckbd (#16476) - merge boot.setup into rckbd (#16476)
* Fri Jul 26 2002 garloff@suse.de * Fri Jul 26 2002 garloff@suse.de
- Don't wait infinitely long for bit 1 of port 0x64 being 0. - Don't wait infinitely long for bit 1 of port 0x64 being 0.
@ -674,11 +680,11 @@ rm -rf $RPM_BUILD_ROOT
* Thu Jun 06 2002 garloff@suse.de * Thu Jun 06 2002 garloff@suse.de
- Add kbd rate and delay report (#16050). - Add kbd rate and delay report (#16050).
- Move fbset to X-SuSE-Should-Start. - Move fbset to X-SuSE-Should-Start.
* Sun Mar 17 2002 garloff@suse.de * Mon Mar 18 2002 garloff@suse.de
- Fixed all i386 keymaps with 99(PtrScr) = Control_backslash - Fixed all i386 keymaps with 99(PtrScr) = Control_backslash
to VoidSymbol (but keeping the old meaning with Control) to VoidSymbol (but keeping the old meaning with Control)
Fixes bug #8380. Fixes bug #8380.
* Sun Mar 17 2002 garloff@suse.de * Mon Mar 18 2002 garloff@suse.de
- Changed init script to accept a keymap that is specified by - Changed init script to accept a keymap that is specified by
absolute path. (Bug #14997) absolute path. (Bug #14997)
* Sun Mar 17 2002 garloff@suse.de * Sun Mar 17 2002 garloff@suse.de
@ -751,7 +757,7 @@ rm -rf $RPM_BUILD_ROOT
- handle the ppc64 in machine detection - handle the ppc64 in machine detection
* Mon Sep 17 2001 garloff@suse.de * Mon Sep 17 2001 garloff@suse.de
- Add loadkezs->loadkeys symlink (#10752) - Add loadkezs->loadkeys symlink (#10752)
* Fri Aug 31 2001 olh@suse.de * Sat Sep 01 2001 olh@suse.de
- no keyboard on iSeries available - no keyboard on iSeries available
* Wed Aug 29 2001 olh@suse.de * Wed Aug 29 2001 olh@suse.de
- allow querty/us.map.gz as KEYTABLE, fix mac-dk map - allow querty/us.map.gz as KEYTABLE, fix mac-dk map
@ -852,7 +858,7 @@ rm -rf $RPM_BUILD_ROOT
problems with some keytables (bug #4275). problems with some keytables (bug #4275).
* Tue Dec 05 2000 olh@suse.de * Tue Dec 05 2000 olh@suse.de
- add mac-fr_CH.map - add mac-fr_CH.map
* Mon Dec 04 2000 garloff@suse.de * Tue Dec 05 2000 garloff@suse.de
- New startup script: Separate KEYMAP from COMPOSE maps. Add new - New startup script: Separate KEYMAP from COMPOSE maps. Add new
rc.config variable COMPOSEMAP to allow setting of compose combi- rc.config variable COMPOSEMAP to allow setting of compose combi-
nations defaulting to "latin1 latin1.add" nations defaulting to "latin1 latin1.add"

10
testutf8 Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# testutf8 will be soon removed completely, it's kept only not to break
# /etc/profile currently
if tty -s; then
exit 2
else
exit 0
fi

View File

@ -1,96 +0,0 @@
/*
* Copyright Gerd Knorr <kraxel@suse.de>, 2003
*
* small tool to figure whenever a tty runs in utf8 mode or not.
* writes a utf-8 multibyte sequence and then checks how far the
* cursor has been moved.
*
* return codes:
* 0 - don't know (stdin isn't a terminal, timeout, some error, ...)
* 1 - not in utf8
* 2 - utf-8
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <termios.h>
struct termios saved_attributes;
int saved_fl;
void
tty_raw()
{
struct termios tattr;
fcntl(0,F_GETFL,&saved_fl);
tcgetattr (0, &saved_attributes);
fcntl(0,F_SETFL,O_NONBLOCK);
memcpy(&tattr,&saved_attributes,sizeof(struct termios));
tattr.c_lflag &= ~(ICANON|ECHO);
tattr.c_cc[VMIN] = 1;
tattr.c_cc[VTIME] = 0;
tcsetattr (0, TCSAFLUSH, &tattr);
}
void
tty_restore()
{
fcntl(0,F_SETFL,saved_fl);
tcsetattr (0, TCSANOW, &saved_attributes);
}
int
select_wait()
{
struct timeval tv;
fd_set se;
FD_ZERO(&se);
FD_SET(0,&se);
tv.tv_sec = 3;
tv.tv_usec = 0;
return select(1,&se,NULL,NULL,&tv);
}
int
main(int argc, char **argv)
{
static char *teststr = "\r\xc3\xb6";
static char *cleanup = "\r \r";
static char *getpos = "\033[6n";
char retstr[16];
int pos,rc,row,col,verbose;
verbose = 0;
if (argc > 1 && 0 == strcmp(argv[1],"-v"))
verbose = 1;
if (!isatty(0) || !isatty(1)) {
if (verbose)
fprintf(stderr,"Not a tty.\n");
exit(0);
}
tty_raw();
write(1,teststr,strlen(teststr));
write(1,getpos,strlen(getpos));
for (pos = 0; pos < sizeof(retstr)-1;) {
if (0 == select_wait())
break;
if (-1 == (rc = read(0,retstr+pos,sizeof(retstr)-1-pos))) {
perror("read");
exit(0);
}
pos += rc;
if (retstr[pos-1] == 'R')
break;
}
retstr[pos] = 0;
write(1,cleanup,strlen(cleanup));
tty_restore();
rc = sscanf(retstr,"\033[%d;%dR",&row,&col);
if (2 == rc && 2 == col) {
if (verbose)
fprintf(stderr,"Terminal is in UTF-8 mode.\n");
exit(2);
} else {
if (verbose)
fprintf(stderr,"Terminal is in byte mode.\n");
exit(1);
}
}