Bug 545499 - system-config-language does not fixup /boot/grub/grub.conf for dracut
Summary: system-config-language does not fixup /boot/grub/grub.conf for dracut
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-language
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Naveen Kumar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-08 17:40 UTC by Odin Trisk
Modified: 2010-08-24 01:34 UTC (History)
5 users (show)

Fixed In Version: system-config-language-1.3.4-6.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-24 01:34:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
executes /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r) after writing to /etc/sysconfig/i18n (736 bytes, patch)
2010-06-22 12:47 UTC, Naveen Kumar
no flags Details | Diff
patches bug #445796, leftout parts of bug #545499 & some enhancement req by Pravin S (64 bytes, text/plain)
2010-08-06 11:42 UTC, Naveen Kumar
no flags Details

Description Odin Trisk 2009-12-08 17:40:10 UTC
Description of problem:

Since there is no proper selection of locale during install (sure you can pick English, but you can't pick the correct country, you just get forced into en_US which you can then correct once installed).

The tool system-config-language does not fixup grub.conf to use the changed locale.


THIS REPORT IS MADE TO PROVIDE FEEDBACK TO CONCERNS MADE DURING A FEDORA12 INSTALLATION.

Comment 1 Pravin Satpute 2009-12-09 04:20:46 UTC
system-config-language not come into picture while installation process, and s-c-l is not related anyway with grub.conf

i am really not understanding what you want exactly, i guess you wanna request something to anaconda

please update this with steps, actual result and expected result, so it will be little bit easy to resolve

Comment 2 Hans de Goede 2009-12-09 09:22:25 UTC
(In reply to comment #1)
> system-config-language not come into picture while installation process, and
> s-c-l is not related anyway with grub.conf
> 

This bug is about how changing the language post install with system-config-language, does not update grub.conf to reflect the new language.

Now that we are using dracut for the initrd, grub.conf contains something like:
kernel /vmlinuz-2.6.31.6-151.fc12.x86_64 ro root=LABEL=root SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=ko rhgb quiet

(on one line)

dracut needs the SYSFONT, LANG and KEYTABLE information for things like showing
the correct translated messages while scanning storage, and more importantly
for proper unlocking of crypted disks.

mkinitrd use to hardcode the language inside the initrd, so after running
system-config-language, one needed to rerun mkinitrd to get this updated propagated to the initrd.

dracut is more flexible wrt this. This does mean that system-config-language
will need to modify grub.conf when the system language is changed.

Comment 3 Hans de Goede 2009-12-09 09:26:07 UTC
p.s.

Note that SYSFONTACM and UNIMAP also need to be specified on the kernel cmdline where applicable.

Comment 4 Odin Trisk 2009-12-09 10:42:11 UTC
Further thoughts on this.  Hans de Goede has understood the point being made.


Can GRUB be modified to allow a per image option "append-from-file locale.opts"


Making for something like (please excuse the specifics this is an FC4 example grub.conf not an FC12) :

title Linux (2.6.y.z)
        root (hd0,0)
        kernel /zmlinuz-2.6.x.y.fc12.x86_64 ro root=LABEL=root rhgb quiet
        append-from-file locale.opts
        initrd /initrd-2.6.x.y.img

==== BEGIN /boot/grub/locale.opts ====
SYSFONT=latarcyrheb-sun16
LANG=en_US.UTF-8
KEYTABLE=ko
==== END ====

What GRUB would then do is load up additional options from a file and then perform an "options merge".  If the same option name already exists in the grub.conf (on the "kernel" command line) it will always have priority (and the one from locale.opts is ignored/discarded).  All the options from locale.opts would be appended to the end of the existing command line.

Existance of the file /boot/grub/locale.opts is optional.  IT SHOULD NEVER CAUSE FAILURE TO BOOT.

If there is a parse error with /boot/grub/locale.opts the kernel should continue to boot on a best-efforts basis.  The parse can be made so simple that a parse error should  never occur, one option per line, first "=" delimits name/value pair, leading white-space is removed, white-space around first "=" is removed, name or value part can be wrapped in quotations marks (which if found as first and last character are removed from data), the rest is take literally.  A PARSE RROR SHOULD NEVER CAUSE FAILURE TO BOOT.


This would then mean applications like system-config-language would be editing a much simpler text file and be spared the headache of future bugs relating to "I used system-config-language" but my system no longer boots!  Which would be a major failure (in design).

I don't see why the system-config-language people should have the headache of having to edit such an important system config file (grub.conf) themselves.  They require protection from problems, changes and lack of knowledge.

So GRUB either provides a tool to edit grub.conf or it provide a mechanism (such as described above) to contain/encapsulate the potential for problems occurring.

Comment 5 Hans de Goede 2009-12-09 11:05:14 UTC
I see your point about parsing /etc/grub.conf is something
system-config-language does not want to do, and this is not necessary,
after writing the relevant /etc/sysconfig files, all that
system-config-language needs to do is call (as root):

/sbin/new-kernel-pkg --package <package-name> --dracut --install <uname -r>

For all installed kernels, so for example on my system:
[hans@localhost ~]$ rpm -q kernel kernel-PAE
kernel-2.6.31.5-106.fc12.x86_64
kernel-2.6.31.5-127.fc12.x86_64
kernel-2.6.31.6-151.fc12.x86_64
package kernel-PAE is not installed
[hans@localhost ~]$ 

It would need to call:
/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.31.5-106.fc12.x86_64
/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.31.5-127.fc12.x86_64
/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.31.6-151.fc12.x86_64

(this should be 3 lines)

But on a system which has
kernel-PAE-2.6.31.6-151.fc12.i686

It would need to call:
/sbin/new-kernel-pkg --package kernel-PAE --dracut --install 2.6.31.6-151.fc12.i686.PAE

Notice the PAE is in there now (2 times!)

Comment 6 Naveen Kumar 2010-06-21 10:23:17 UTC
(In reply to comment #5)
> I see your point about parsing /etc/grub.conf is something
> system-config-language does not want to do, and this is not necessary,
> after writing the relevant /etc/sysconfig files, all that
> system-config-language needs to do is call (as root):
> 
> /sbin/new-kernel-pkg --package <package-name> --dracut --install <uname -r>
> 
> For all installed kernels, so for example on my system:
> [hans@localhost ~]$ rpm -q kernel kernel-PAE
> kernel-2.6.31.5-106.fc12.x86_64
> kernel-2.6.31.5-127.fc12.x86_64
> kernel-2.6.31.6-151.fc12.x86_64
> package kernel-PAE is not installed
> [hans@localhost ~]$ 
> 
> It would need to call:
> /sbin/new-kernel-pkg --package kernel --dracut --install
> 2.6.31.5-106.fc12.x86_64
> /sbin/new-kernel-pkg --package kernel --dracut --install
> 2.6.31.5-127.fc12.x86_64
> /sbin/new-kernel-pkg --package kernel --dracut --install
> 2.6.31.6-151.fc12.x86_64
> 
> (this should be 3 lines)
> 
> But on a system which has
> kernel-PAE-2.6.31.6-151.fc12.i686
> 
> It would need to call:
> /sbin/new-kernel-pkg --package kernel-PAE --dracut --install
> 2.6.31.6-151.fc12.i686.PAE
> 
> Notice the PAE is in there now (2 times!)    

After running these commands I still do not see any change in /etc/grub.conf. Is this command correct or is there anything else that needs to be done.

Comment 7 Hans de Goede 2010-06-21 12:00:01 UTC
(In reply to comment #6)
> After running these commands I still do not see any change in /etc/grub.conf.
> Is this command correct or is there anything else that needs to be done.    

I just did the following:
edit /etc/sysconfig/i18n, change LANG
run:
/sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
check grub.conf entry for currently running kernel, the LANG= argument
is changed.

So no there is not anything else that needs to be done. Perhaps you are running these commands before writing the new config files ?

Comment 8 Hans de Goede 2010-06-21 12:01:15 UTC
Needed info added, go clear the flag already BZ.

Comment 9 Naveen Kumar 2010-06-21 12:21:49 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > After running these commands I still do not see any change in /etc/grub.conf.
> > Is this command correct or is there anything else that needs to be done.    
> 
> I just did the following:
> edit /etc/sysconfig/i18n, change LANG
> run:
> /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
> check grub.conf entry for currently running kernel, the LANG= argument
> is changed.
> 
> So no there is not anything else that needs to be done. Perhaps you are running
> these commands before writing the new config files ?    

Thanks :), Would try and incorporate the changes in the next build.

Comment 10 Pravin Satpute 2010-06-22 04:03:20 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > After running these commands I still do not see any change in /etc/grub.conf.
> > Is this command correct or is there anything else that needs to be done.    
> 
> I just did the following:
> edit /etc/sysconfig/i18n, change LANG
> run:
> /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
> check grub.conf entry for currently running kernel, the LANG= argument
> is changed.
> 

tried this, working fine
i ran system-config-language checked grub.conf
after running 
$/sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)

changes in the /etc/sysconfig/i18n updated in grub.conf

Comment 11 Naveen Kumar 2010-06-22 12:47:22 UTC
Created attachment 425910 [details]
executes /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r) after writing to /etc/sysconfig/i18n

Comment 12 Hans de Goede 2010-06-22 12:55:29 UTC
(In reply to comment #11)
> Created an attachment (id=425910) [details]
> executes /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
> after writing to /etc/sysconfig/i18n    

I'm afraid that that is not really enough, as explained in the original report
system-config-language ought to do this for all installed kernels, not just for the currently running one.

Comment 13 Fedora Update System 2010-06-22 13:05:36 UTC
system-config-language-1.3.4-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/system-config-language-1.3.4-4.fc13

Comment 14 Naveen Kumar 2010-06-22 13:13:33 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Created an attachment (id=425910) [details] [details]
> > executes /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
> > after writing to /etc/sysconfig/i18n    
> 
> I'm afraid that that is not really enough, as explained in the original report
> system-config-language ought to do this for all installed kernels, not just for
> the currently running one.    

Give me the exact commands and I will do it because after "rpm -q kernel kernel-PAE" the command /sbin/new-kernel-pkg --package kernel --dracut --install kernel-* does not write the file /etc/grub.conf.

Comment 15 Naveen Kumar 2010-06-22 13:14:52 UTC
(In reply to comment #14)
> (In reply to comment #12)
> > (In reply to comment #11)
> > > Created an attachment (id=425910) [details] [details] [details]
> > > executes /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
> > > after writing to /etc/sysconfig/i18n    
> > 
> > I'm afraid that that is not really enough, as explained in the original report
> > system-config-language ought to do this for all installed kernels, not just for
> > the currently running one.    
> 
> Give me the exact commands and I will do it because after "rpm -q kernel
> kernel-PAE" the command /sbin/new-kernel-pkg --package kernel --dracut
> --install kernel-* does not write the file /etc/grub.conf.    

only the command /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r) seems to work...

Comment 16 Hans de Goede 2010-06-22 17:57:55 UTC
(In reply to comment #15)

> only the command /sbin/new-kernel-pkg --package kernel --dracut --install
> $(uname -r) seems to work...    

There is no single magic commandline you will need to either parse the output of rpm -q kernel + rpm -q kernel-PAE, or better us the rpm python bindings to get the versions of the installed kernels your self and then for each version run:
/sbin/new-kernel-pkg --package kernel --dracut --install <version>

For example on my system "rpm -q kernel" gives:
kernel-2.6.33-0.48.rc8.git4.local.fc13.x86_64
kernel-2.6.33-0.52.rc8.git6.fc13.x86_64
kernel-2.6.33-9.local.fc13.x86_64
kernel-2.6.33-9.local2.fc13.x86_64
kernel-2.6.33.1-13.local3.fc13.x86_64
kernel-2.6.34-0.11.rc1.git1.local3.fc14.x86_64
kernel-2.6.33.1-13.local4.fc13.x86_64
kernel-2.6.33.1-26.fc13.x86_64

(yeah I need to cleanup a bit I guess)

So you should run:
/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.33-0.48.rc8.git4.local.fc13.x86_64
/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.33-0.52.rc8.git6.fc13.x86_64
/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.33-9.local.fc13.x86_64
<etc>

I'm sure I can whip up a bash script doing what you need, but there is little point in that as you should be able to do the parsing and looping just fine in python.

Comment 17 Naveen Kumar 2010-06-22 19:42:46 UTC
(In reply to comment #16)
> (In reply to comment #15)
> 
> > only the command /sbin/new-kernel-pkg --package kernel --dracut --install
> > $(uname -r) seems to work...    
> 
> There is no single magic commandline you will need to either parse the output
> of rpm -q kernel + rpm -q kernel-PAE, or better us the rpm python bindings to
> get the versions of the installed kernels your self and then for each version
> run:
> /sbin/new-kernel-pkg --package kernel --dracut --install <version>
> 
> For example on my system "rpm -q kernel" gives:
> kernel-2.6.33-0.48.rc8.git4.local.fc13.x86_64
> kernel-2.6.33-0.52.rc8.git6.fc13.x86_64
> kernel-2.6.33-9.local.fc13.x86_64
> kernel-2.6.33-9.local2.fc13.x86_64
> kernel-2.6.33.1-13.local3.fc13.x86_64
> kernel-2.6.34-0.11.rc1.git1.local3.fc14.x86_64
> kernel-2.6.33.1-13.local4.fc13.x86_64
> kernel-2.6.33.1-26.fc13.x86_64
> 
> (yeah I need to cleanup a bit I guess)
> 
> So you should run:
> /sbin/new-kernel-pkg --package kernel --dracut --install
> 2.6.33-0.48.rc8.git4.local.fc13.x86_64
> /sbin/new-kernel-pkg --package kernel --dracut --install
> 2.6.33-0.52.rc8.git6.fc13.x86_64
> /sbin/new-kernel-pkg --package kernel --dracut --install
> 2.6.33-9.local.fc13.x86_64
> <etc>
> 
> I'm sure I can whip up a bash script doing what you need, but there is little
> point in that as you should be able to do the parsing and looping just fine in
> python.    

Ah! you completely misunderstood me. The problem is not with parsing command line, what I am saying is that command 

/sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)

is working but other commands like 

/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.33-0.48.rc8.git4.local.fc13.x86_64

 are not working. They do not write anything in /etc/grub.conf.

Comment 18 Hans de Goede 2010-06-23 09:03:04 UTC
(In reply to comment #17)
> Ah! you completely misunderstood me. The problem is not with parsing command
> line, what I am saying is that command 
> 
> /sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
> 
> is working but other commands like 
> 
> /sbin/new-kernel-pkg --package kernel --dracut --install
> 2.6.33-0.48.rc8.git4.local.fc13.x86_64
> 
>  are not working. They do not write anything in /etc/grub.conf.    

All that $(uname -r) does is run "uname -r" and put the output on the cmdline, so on my system, where uname -r gives:
[hans@localhost ~]$ uname -r
2.6.33.1-13.local4.fc13.x86_64

Doing:
/sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)
Is *exactly* the same as doing:
/sbin/new-kernel-pkg --package kernel --dracut --install 2.6.33.1-13.local4.fc13.x86_64

Note that rpm -q kernel gives:
[hans@localhost ~]$ rpm -q kernel
kernel-2.6.33-0.48.rc8.git4.local.fc13.x86_64
<snip>
kernel-2.6.33.1-13.local4.fc13.x86_64
kernel-2.6.33.1-26.fc13.x86_64

You can make the parsing of the output somewhat more easier by doing:
rpm --queryformat "%{VERSION}-%{RELEASE}.%{ARCH}\n" -q kernel
rpm --queryformat "%{VERSION}-%{RELEASE}.%{ARCH}.PAE\n" -q kernel-PAE

Note that normally one of these 2 commands will output:
package kernel is not installed
resp:
package kernel-PAE is not installed

The other command will give a list of all version strings to pass to
new-kernel-pkg (one by one)

Comment 19 Fedora Update System 2010-06-23 17:52:34 UTC
system-config-language-1.3.4-4.fc13 has been pushed to the Fedora 13 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 system-config-language'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/system-config-language-1.3.4-4.fc13

Comment 20 Fedora Update System 2010-07-09 10:32:31 UTC
system-config-language-1.3.4-5.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/system-config-language-1.3.4-5.fc13

Comment 21 Naveen Kumar 2010-08-06 11:42:47 UTC
Created attachment 437119 [details]
patches bug #445796, leftout parts of bug #545499 & some enhancement req by Pravin S

@Hans de Goede: Will this work... 

N.B: Must be applied in order to already applied patches.

Comment 22 Naveen Kumar 2010-08-09 10:50:52 UTC
Koji Build Available for devel branch: http://koji.fedoraproject.org/koji/taskinfo?taskID=2389000

Please test it.

Comment 23 Fedora Update System 2010-08-09 11:24:24 UTC
system-config-language-1.3.4-6.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/system-config-language-1.3.4-6.fc14

Comment 24 Fedora Update System 2010-08-10 01:29:50 UTC
system-config-language-1.3.4-6.fc14 has been pushed to the Fedora 14 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 system-config-language'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/system-config-language-1.3.4-6.fc14

Comment 25 Hans de Goede 2010-08-10 12:29:07 UTC
(In reply to comment #21)
> Created an attachment (id=437119) [details]
> patches bug #445796, leftout parts of bug #545499 & some enhancement req by
> Pravin S
> 
> @Hans de Goede: Will this work... 
> 

You need to remove these 2 lines now:
        (cmdstatus, cmdout)= commands.getstatusoutput('/sbin/new-kernel-pkg --package kernel --dracut --install $(uname -r)')

As those are redundant, since the same is done by the loop you've added.

Other then that I think this will work, but only testing on path i686-PAE and other systems will tell for sure.

Comment 26 Fedora Update System 2010-08-24 01:34:25 UTC
system-config-language-1.3.4-6.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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