Bug 483817 - re-implement /usr/bin/fedora-setup-keyboard in C to speed up boot
Summary: re-implement /usr/bin/fedora-setup-keyboard in C to speed up boot
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-server
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Peter Hutterer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 486698
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-03 18:43 UTC by Adel Gadllah
Modified: 2009-03-04 01:50 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-04 01:50:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Adel Gadllah 2009-02-03 18:43:49 UTC
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 19:19:27 UTC
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 13:58:19 UTC
(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 05:22:55 UTC
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 05:24:52 UTC
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 08:45:24 UTC
Just ignore the dbus-c++ messages, typed the wrong bug number in bodhi.

Comment 6 Peter Hutterer 2009-02-11 00:00:56 UTC
*** Bug 478431 has been marked as a duplicate of this bug. ***

Comment 7 Adel Gadllah 2009-02-14 15:07:15 UTC
> 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 22:38:51 UTC
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 10:26:02 UTC
(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 08:02:53 UTC
(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-04 01:50:49 UTC
xorg-x11-server-1.6.0-5 now requires the fedora-setup-keyboard package.


Note You need to log in before you can comment on or make changes to this bug.