Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 450156

Summary: media-gfx/splashutils-1.5.4.4-r2 unable to switch from silent mode to verbose using F2 with the 2nd keyboard
Product: Gentoo Linux Reporter: Asaf Gery <asaf.gery>
Component: Current packagesAssignee: Asaf Gery <asaf.gery>
Status: RESOLVED FIXED    
Severity: normal CC: aklhfex, proxy-maint
Priority: Normal    
Version: 10.1   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: splashutils-1.5.4.4-multi-keyboard.patch
splashutils-1.5.4.4-r3.ebuild

Description Asaf Gery 2013-01-04 10:14:04 UTC
For some time I am not able to switch between silent mode and verbose mode when using my USB keyboard. I am able to do so with my laptop's internal keyboard (which is probably not a USB keyboard). At first I thought it was an issue with kernel drivers being compiled as modules rather than statically, but changing to static doesn't help. I noticed from http://www.gentoo-wiki.info/Fbsplash that such a bug existsed in the past (http://bugs.gentoo.org/show_bug.cgi?id=200217)

I did my best to look for duplicates, however the search interface of Bugzilla is very limited. I would to apologize upfront in case I unintentionally made a duplicate of an existing bug.

Reproducible: Always

Steps to Reproduce:
1. Boot (with splashutils installed, etc.)
2. Press F2 key on an attached USB keyboard

Actual Results:  
Boot goes on in silent mode

Expected Results:  
Mode should be switched to verbose

$ lsusb | grep -i microsoft
Bus 001 Device 003: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0

$ emerge --info
Portage 2.1.11.31 (default/linux/amd64/10.0/desktop, gcc-4.5.4, glibc-2.15-r3, 3.6.11-gentoo x86_64)
=================================================================
System uname: Linux-3.6.11-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7500_@_2.20GHz-with-gentoo-2.1
Timestamp of tree: Thu, 03 Jan 2013 17:30:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.1.5, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13::<unknown repository>, 2.69
sys-devel/automake:       1.5-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo x-my_ebuilds
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 skype-eula PUEL AdobeFlash-10.3 Oracle-BCLA-JavaSE Nero-AAC-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe --stack-protector"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-march=nocona -O2 -pipe --stack-protector"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.hamakor.org.il/pub/mirrors/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://gentoo.tiscali.nl/ http://mirror.muntinternet.net/pub/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirror.jamit.de/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.first-world.info/ http://mirror.cambrium.nl/pub/os/linux/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/my_ebuilds"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi alsa amd64 bash-completion berkdb bidi bluetooth branding bzip2 cairo cdda cddb cdr cli consolekit cracklib crypt cups curl cxx dbus dri dts dvd dvdr emboss encode exif extensions extras fam fbcon fbcondecor firefox flac fortran gdbm gif gpm gtk hddtemp iconv icu ieee1394 ipv6 java jpeg kde laptop lcms ldap libnotify lm_sensors mad mmx mng modules mp3 mp4 mpeg mplayer mudflap mule multilib mysql ncurses nls nptl nsplugin ogg opengl openmp pam pango pcre pdf png policykit ppds pppd qt3support qt4 readline sdl semantic-desktop session sndfile spell sse sse2 ssl startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vdpau vorbis wxwidgets x264 xcb xemacs xml xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en he ar tr ru de" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="pixma" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Asaf Gery 2013-01-08 13:34:58 UTC
I checked the sources and I think that I found out the cause for this bug in libfbsplash.c.
The function "int fbsplash_set_evdev(void)" (lines 596 - 631) looks for the first keyboard device file it can open and then breaks the loop. The problem is that I have two keyboards - one is the laptop's own keyboard and the other one is my external USB keyboard. The internal keyboard shows firts, so the loop stops with this keyboard and set the evdev to the internal keyboard.

It probably has nothing to do with the fact that my external keyboard is a USB keyboard, since ALT + F1 does work with that keyboard.

Both libfbsplash.c and daemon.c should be modified in order to support multiple keyboards.

I am not an expert C programmer, but I will try my luck solving this bug and send a patch if I succeed :-)
Comment 2 Asaf Gery 2013-01-11 05:05:40 UTC
Created attachment 335138 [details, diff]
splashutils-1.5.4.4-multi-keyboard.patch

Without this patch, fbsplashd listens on the first keyboard it manages to open and ignores the other keyboards.

Currently once fbsplashd manages to open a keyboard input device, it gets out of the loop and start reading events from that keyboard.

The patch uses select in order to read from all the keyboards attached to the machine (I didn't touch the embedded scripts that search for keyboards).

I have a laptop with a docking station and an external keyboard connected to the docking station. Usually when the laptop is docked, I keep the lid closed and use only the external keyboard. It was really annoying to have to open the lid just to press F2 for verbose mode. The patch fixes this situation.

I would greatly appreciate if you could review it.

Asaf
Comment 3 Asaf Gery 2013-01-11 05:06:32 UTC
Created attachment 335140 [details]
splashutils-1.5.4.4-r3.ebuild

This is the ebuild that applies the patch.
Comment 4 Asaf Gery 2013-01-11 05:08:48 UTC
I managed to solve the bug.
I attached both the patch and the ebuild that applies the patch.
I don't know whether the patch would work on embedded device since I don't have access to one.

I would appreciate if one of you guys could review the patch.

Thanks,
Asaf
Comment 5 Pacho Ramos gentoo-dev 2013-06-16 17:35:25 UTC
+*splashutils-1.5.4.4-r3 (16 Jun 2013)
+
+  16 Jun 2013; Pacho Ramos <pacho@gentoo.org>
+  +files/splashutils-1.5.4.4-multi-keyboard.patch,
+  +splashutils-1.5.4.4-r3.ebuild, metadata.xml:
+  Support multiple keyboards (#450156), Asaf Gery will also proxy maintain this
+  package.
+