This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 483817

Summary: re-implement /usr/bin/fedora-setup-keyboard in C to speed up boot
Product: [Fedora] Fedora Reporter: Adel Gadllah <adel.gadllah>
Component: xorg-x11-serverAssignee: Peter Hutterer <peter.hutterer>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: harald, kad, peter.hutterer, petersen, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-03 20:50:49 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 486698    
Bug Blocks:    

Description Adel Gadllah 2009-02-03 13:43:49 EST
According to http://fedoraproject.org/wiki/Features/20SecondStartup and https://bugzilla.redhat.com/show_bug.cgi?id=476028 /usr/bin/fedora-setup-keyboard is the only thing started at boot that calls the python interpreter. 

In https://bugzilla.redhat.com/show_bug.cgi?id=478431 it has been rewritten in pure python instead of a shell script that calls python. Which is a cleaner solution but does not solve the problem that we start the python interpreter, only because of this callout during boot.

I have re implemented it again, this time in C, so python is only used at build time to generate the keyboard model database (because its stored inside rhpl), the script itself is replaced with a small C program that feeds the data into hal.

The program can be found here:
http://193.200.113.196/apache2-default/fsk.tar.bz2 

(including a sample Makefile and the python script that needs to be called during build).
Comment 1 Alexander Kanevskiy 2009-02-04 14:19:27 EST
At least one logical problem exists:
   if(!libhal_ctx_set_dbus_connection(hal_ctx, dbus_bus_get(DBUS_BUS_SYSTEM, NULL)))
 
you should be using direct hal connection instead of system bus if it's requested by hal.
(look at hal-set-property code for option --direct)

Second, having keyboards statically inserted in the code, not the best idea.
If it's worth to change, this DB should be split into separate file and used by both, system-config-keyboard and fedora-setup-keyboard.
Comment 2 Adel Gadllah 2009-02-05 08:58:19 EST
(In reply to comment #1)
> At least one logical problem exists:
>    if(!libhal_ctx_set_dbus_connection(hal_ctx, dbus_bus_get(DBUS_BUS_SYSTEM,
> NULL)))
> 
> you should be using direct hal connection instead of system bus if it's
> requested by hal.
> (look at hal-set-property code for option --direct)

OK, fixed this in a new version. (uploaded to same location)

> Second, having keyboards statically inserted in the code, not the best idea.
> If it's worth to change, this DB should be split into separate file and used by
> both, system-config-keyboard and fedora-setup-keyboard.

I agree with that, but it was static content in the rhpl source before, if someone pushes it out of rhpl to a generic database we can use it here too.
Comment 3 Fedora Update System 2009-02-06 00:22:55 EST
dbus-c++-0.5.0-0.4.20090203git13281b3.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dbus-c++'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-1407
Comment 4 Fedora Update System 2009-02-06 00:24:52 EST
dbus-c++-0.5.0-0.4.20090203git13281b3.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update dbus-c++'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2009-1430
Comment 5 Adel Gadllah 2009-02-06 03:45:24 EST
Just ignore the dbus-c++ messages, typed the wrong bug number in bodhi.
Comment 6 Peter Hutterer 2009-02-10 19:00:56 EST
*** Bug 478431 has been marked as a duplicate of this bug. ***
Comment 7 Adel Gadllah 2009-02-14 10:07:15 EST
> Second, having keyboards statically inserted in the code, not the best idea.
> If it's worth to change, this DB should be split into separate file and used by
> both, system-config-keyboard and fedora-setup-keyboard.

rhpl / system-config-keyboard stores all options (rather than just the layout name) in /etc/sysconfig/keyboard starting with F10, so the static database will only be used for legacy configs (people upgraded from older releases).
Comment 8 Peter Hutterer 2009-02-15 17:38:51 EST
Adel:
sorry about the delay, didn't get to review it until now. Can you please put this as a new project on fedorahosted.org and we can then ship it as a separate package, with the X server depending on it.
Comment 9 Adel Gadllah 2009-02-18 05:26:02 EST
(In reply to comment #8)
> Adel:
> sorry about the delay, didn't get to review it until now. Can you please put
> this as a new project on fedorahosted.org and we can then ship it as a separate
> package, with the X server depending on it.

OK, I filled an infrastructure ticket to create a new project on fedorahosted.
Comment 10 Adel Gadllah 2009-02-21 03:02:53 EST
(In reply to comment #8)
> Adel:
> sorry about the delay, didn't get to review it until now. Can you please put
> this as a new project on fedorahosted.org and we can then ship it as a separate
> package, with the X server depending on it.

Review request for the separate package:
https://bugzilla.redhat.com/show_bug.cgi?id=486698
Comment 11 Peter Hutterer 2009-03-03 20:50:49 EST
xorg-x11-server-1.6.0-5 now requires the fedora-setup-keyboard package.