Bug 815265 - cannot change locale to .UTF-8 on firstboot
cannot change locale to .UTF-8 on firstboot
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE 12.3
Classification: openSUSE
Component: YaST2
Final
Other Other
: P4 - Low : Normal (vote)
: ---
Assigned To: Jiří Suchomel
Jiri Srain
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-15 14:12 UTC by Jordi Massaguer
Modified: 2021-03-09 12:14 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
screenshot after selecting german and logging in as root (18.38 KB, image/png)
2013-04-25 16:50 UTC, Tim Hardeck
Details
y2start.log (9.13 KB, text/plain)
2013-04-26 08:46 UTC, Tim Hardeck
Details
logs.tar.bz2 (44.23 KB, application/x-bzip)
2013-04-26 09:06 UTC, Tim Hardeck
Details
/etc/sysconfig/keyboard (2.89 KB, text/plain)
2013-04-26 09:37 UTC, Tim Hardeck
Details
/etc/sysconfig/language (3.07 KB, text/plain)
2013-04-26 11:34 UTC, Tim Hardeck
Details
patch for /usr/share/YaST2/modules/Language.ycp (1.14 KB, patch)
2013-04-26 14:35 UTC, Jiří Suchomel
Details | Diff
screenshot with applied patch (19.06 KB, image/png)
2013-04-26 15:12 UTC, Tim Hardeck
Details
logs after using the patch (43.56 KB, application/x-bzip)
2013-04-26 15:13 UTC, Tim Hardeck
Details
patch for language.sh (515 bytes, patch)
2013-04-30 07:29 UTC, Jiří Suchomel
Details | Diff
logs after updated language.sh (44.28 KB, application/x-bzip)
2013-04-30 08:43 UTC, Tim Hardeck
Details
screenshot after updating language.sh (19.28 KB, image/png)
2013-04-30 08:44 UTC, Tim Hardeck
Details
new patch for /usr/share/YaST2/modules/Language.ycp (509 bytes, patch)
2013-05-02 07:49 UTC, Jiří Suchomel
Details | Diff
logfiles of appliance with patched language.sh and Language.ycp (44.17 KB, application/x-bzip)
2013-05-06 12:41 UTC, Tim Hardeck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jordi Massaguer 2013-04-15 14:12:45 UTC
How to reproduce:
1- set "Language" and "Keyboard Layout" to "Set during boot" mode.

On the boot after Lang selecting you can see: "LC_CTYPE: cannot change locale (.UTF-8)"

2- after booting, open a console:

$ locale  -->   ru_RU   (instead ru_RU.UTF-8!!!)

If you set the appliance parameters "Language" and "Keyboard Layout" to "Russian", it works correctly after boot and has locale "ru_RU.UTF-8".
Comment 1 Tim Hardeck 2013-04-25 16:50:18 UTC
Created attachment 536914 [details]
screenshot after selecting german and logging in as root
Comment 2 Tim Hardeck 2013-04-25 16:50:44 UTC
This seems to be a bug in the package yast2-firstboot. Jiří, is this a known issue?
Comment 3 Jiří Suchomel 2013-04-26 08:17:49 UTC
So, firstboot sequence wasn't started at all? If so, do you have the log files?
Comment 4 Tim Hardeck 2013-04-26 08:46:50 UTC
Created attachment 537003 [details]
y2start.log
Comment 5 Tim Hardeck 2013-04-26 08:47:18 UTC
It was started and I selected German as language and keyboard layout.
Comment 6 Jiří Suchomel 2013-04-26 09:02:31 UTC
Please attach whole logs directory
Comment 7 Tim Hardeck 2013-04-26 09:06:45 UTC
Created attachment 537007 [details]
logs.tar.bz2
Comment 8 Jiří Suchomel 2013-04-26 09:22:14 UTC
Do you know what did your /etc/sysconfig/keyboard look like _before_ starting firstboot?
Comment 9 Tim Hardeck 2013-04-26 09:37:49 UTC
Created attachment 537019 [details]
/etc/sysconfig/keyboard
Comment 10 Jiří Suchomel 2013-04-26 10:10:33 UTC
Ouch, sorry, I meant /etc/sysconfig/language...
Comment 11 Tim Hardeck 2013-04-26 11:34:31 UTC
Created attachment 537039 [details]
/etc/sysconfig/language
Comment 12 Tim Hardeck 2013-04-26 12:39:27 UTC
We still use some static sysconfig files and keyboard is one of them. There is already a patch to update the default sysconfig files with the appropriate values but this wasn't deployed yet.

If this is caused by a faulty value in /etc/sysconfig/language please reassign.
Comment 13 Jiří Suchomel 2013-04-26 13:55:28 UTC
RC_LANG is set to "" in /etc/sysconfig/language, I really think we've talked about this before.

Could you produce /etc/sysconfig/language with "en_US.UTF-8" if nothing other was selected by user in studio?
Comment 14 Tim Hardeck 2013-04-26 14:01:12 UTC
We have an option to ask on firstboot in which case language seems to be set to "".

The problem is that the user can select en_US.UTF-8 too, so we probably wouldn't know how to distinguish it.

We might be able to manually overwrite this option during file/settings generation if "" is set but this would be kind of hacky.

Would this be a big issue to fix in yast2-firstboot? I mean RC_LANG="" is not really a faulty option.
Comment 15 Jiří Suchomel 2013-04-26 14:35:01 UTC
Created attachment 537073 [details]
patch for /usr/share/YaST2/modules/Language.ycp

Tim, could you patch Language.ycp with this and try if it helps?

Language.ycp is part of yast2-country package. It is also needed to include new Language.ybc, which you get by calling 'ycpc -c Language.ycp'.
Comment 16 Tim Hardeck 2013-04-26 15:12:47 UTC
Created attachment 537085 [details]
screenshot with applied patch

This patch doesn't fix the issue.
Comment 17 Tim Hardeck 2013-04-26 15:13:17 UTC
Created attachment 537086 [details]
logs after using the patch
Comment 18 Jiří Suchomel 2013-04-29 08:56:06 UTC
Hm, I think some of those messages about broken locales are coming from the gettext support in YaST which is started before Language.ycp can step in.

Thomas, do you know about this component? What does translation mechanism need as a prerequisite, regarding LC_ variables?

Tim, do I assume correctly that after next reboot, the messages are not shown and language is actually switched correctly? 

Another question - when did you start putting empty string into sysconfig/language's RC_LANG? I really think I discussed this with someone before with the result that studio should not do it. Or, does this new error occur suddenly in recent time, without changes on studio side?
Comment 19 Tim Hardeck 2013-04-29 09:40:12 UTC
(In reply to comment #18)
> Tim, do I assume correctly that after next reboot, the messages are not shown
> and language is actually switched correctly? 
No, the messages are there after a reboot. There doesn't seem to be an de_DE@euro encoding anymore.
Comment 20 Jiří Suchomel 2013-04-29 10:09:29 UTC
(In reply to comment #18)


What about this?

> Another question - when did you start putting empty string into
> sysconfig/language's RC_LANG? I really think I discussed this with someone
> before with the result that studio should not do it. Or, does this new error
> occur suddenly in recent time, without changes on studio side?
Comment 21 Tim Hardeck 2013-04-29 10:15:40 UTC
I am not sure if it occurred suddenly but isn't the whole point of yast2-firstboot to set these values which are undefined?

We probably could integrate a workaround to save something in this variable if nothing is defined but it would be kind of hacky.

And isn't one of the problems that @euro is selected instead of UTF-8?
Comment 22 Jiří Suchomel 2013-04-29 12:48:25 UTC
(In reply to comment #21)
> I am not sure if it occurred suddenly but isn't the whole point of
> yast2-firstboot to set these values which are undefined?

Well, yes and no. YaSt firstboot is not triggered by missing some of undefined values and the system must be in reasonable state even before this.

> And isn't one of the problems that @euro is selected instead of UTF-8?

No.

Actually, the problem is not with YaST firstboot module, problematic part occurs before starting YaST:

in startup scripts (Firstboot-Stage/S03-language or Second-Stage/S04-language), there's a function which sets the locale variables based on values in /etc/sysconfig/language.

Arvin, what do you think: should we consider missing RC_LANG in /etc/sysconfig/language to be broken configuration, or should we implement backup in set_language_cont function?
Comment 23 Arvin Schnell 2013-04-29 15:31:59 UTC
Since setting LANG=.UTF-8 is never correct I don't mind if we change
set_language_cont to do e.g. nothing if RC_LANG is empty.
Comment 24 Jiří Suchomel 2013-04-30 07:29:08 UTC
Created attachment 537387 [details]
patch for language.sh

OK, new approach: patch language.sh which is part of yast2-installation package.
Comment 25 Tim Hardeck 2013-04-30 08:43:57 UTC
Created attachment 537401 [details]
logs after updated language.sh
Comment 26 Tim Hardeck 2013-04-30 08:44:52 UTC
Created attachment 537402 [details]
screenshot after updating language.sh

It doesn't work, at least the error messages after login are not gone.
Comment 27 Jiří Suchomel 2013-04-30 08:55:23 UTC
Hm, for me it seemed to work..
Comment 28 Jiří Suchomel 2013-04-30 09:26:32 UTC
And what did you choose in firstboot language dialog? Was /etc/sysconfig/language saved with some value?
Comment 29 Tim Hardeck 2013-04-30 15:37:00 UTC
German and the saved value is "de_DE@euro" which according to the error message doesn't exist.
Comment 30 Jiří Suchomel 2013-05-02 07:49:00 UTC
Created attachment 537632 [details]
new patch for /usr/share/YaST2/modules/Language.ycp

OK, let's add also this patch for Language.ycp fix the 'detection' of UTF environment.

You need both: patch for language.sh (part of yast2-installation) and this one for Language.ycp (including new Language.ybc, part of yast2-country)
Comment 31 Tim Hardeck 2013-05-06 12:41:36 UTC
Created attachment 538023 [details]
logfiles of appliance with patched language.sh and Language.ycp

The errors are still shown although there instead of @euro .UTF-8 is used but it was also not found.
Comment 32 Jiří Suchomel 2013-05-06 12:53:28 UTC
Can I test with your image?
Comment 35 Jiří Suchomel 2013-05-07 07:27:32 UTC
Well, YaST is responsible for setting that @euro suffux - this should be fixed by the patch in Language.ycp

Than the patch for language.sh should fix initial locale environment for YaST (firstboot).

But the messages shown after console login... I don't know what's missing and who's responsible for them.

Arvin, don't you know? Or who could know about errors from comment 26? Or maybe the patch from comment 24 is not enough?
Comment 36 Thomas Fehr 2013-05-07 09:42:27 UTC
Arvin is on vacation until 21.5. 

For me this looks as if there is something missing in the system itself.
On my system here "de_DE@euro" and "de_DE.UTF-8" all works.
Please make sure the locales in question do exist in the system at all:

grange:~ # ls -d /usr/lib/locale/en_US* /usr/lib/locale/de_DE*
/usr/lib/locale/de_DE       /usr/lib/locale/de_DE@euro  /usr/lib/locale/en_US.iso885915
/usr/lib/locale/de_DE.utf8  /usr/lib/locale/en_US       /usr/lib/locale/en_US.utf8
Lagrange:~ #
Comment 37 Thomas Fehr 2013-05-07 09:58:49 UTC
Meanwhile I managed to look into that qcow2 image.
The directory /usr/lib/locale is empty so there cannot be set any locale at all.
File below /usr/lib/locale are in glibc-locale,rpm.

Please use an image with locales present and the error messages about not 
settable locale should be gone.

Nevertheless the patches seem valid to me "@euro" is outdated and having
a fallback in language.sh make sense.
Comment 38 Jiří Suchomel 2013-05-07 10:02:16 UTC
(In reply to comment #37)
> Meanwhile I managed to look into that qcow2 image.
> The directory /usr/lib/locale is empty so there cannot be set any locale at
> all.
> File below /usr/lib/locale are in glibc-locale,rpm.

Good point, thanks Thomas!

Tim?
Comment 39 Tim Hardeck 2013-05-07 10:13:00 UTC
Ok, thanks for your debugging. If I select the language before build time I don't get this error but maybe we don't install glibc-locale if the user selects "Ask on Firstboot". I am going to look into it.
Comment 40 Tim Hardeck 2013-05-13 10:35:19 UTC
The glibc-locale package was installed but the fix for bnc#803092 wasn't yet active in my testing appliance so all language files were removed.

After removing the baseStripLocales function the error messages were gone.

So if your changes are incorporated in a maintenance update it should work fine in new Studio appliances.

Thanks for your help.
Comment 41 Bernhard Wiedemann 2013-05-13 14:00:31 UTC
This is an autogenerated message for OBS integration:
This bug (815265) was mentioned in
https://build.opensuse.org/request/show/175283 Factory / yast2-country
Comment 42 Bernhard Wiedemann 2013-05-13 16:00:26 UTC
This is an autogenerated message for OBS integration:
This bug (815265) was mentioned in
https://build.opensuse.org/request/show/175301 Factory / yast2-installation
Comment 43 Jiří Suchomel 2013-05-15 06:51:24 UTC
(In reply to comment #40)

> So if your changes are incorporated in a maintenance update it should work fine
> in new Studio appliances.

The fix went to factory, where else do you need it?
Comment 44 Jiří Suchomel 2013-05-15 07:06:40 UTC
Well, I've created requests for SP3 (26284, 26285), I hope that should be enough.
Comment 45 Tim Hardeck 2013-05-15 07:37:50 UTC
Thanks, having a maintenance update for 12.3 would be great too so all our current and future appliances don't have this issue.
Comment 47 Bernhard Wiedemann 2013-05-16 15:00:14 UTC
This is an autogenerated message for OBS integration:
This bug (815265) was mentioned in
https://build.opensuse.org/request/show/175884 Maintenance / 
https://build.opensuse.org/request/show/175885 Maintenance /
Comment 48 Swamp Workflow Management 2013-06-10 10:29:36 UTC
openSUSE-RU-2013:0986-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 815265
CVE References: 
Sources used:
openSUSE 12.3 (src):    yast2-country-2.23.2-1.4.1, yast2-installation-2.23.15-1.12.2