Grub2 error msg re: /boot/grub/locale/en.mo [Solved]

Discussions Regarding Software

Moderator: Moderators

Post Reply
sqlpython
Technological Hen
Posts: 386
Joined: Mon Jun 18, 2007 7:01
Location: If It Moves Compile It
Contact:

Grub2 error msg re: /boot/grub/locale/en.mo [Solved]

Post by sqlpython » Sun Jan 19, 2014 0:11

I noticed after my updates about 2 days or 4 days ago..
Seems the english adn spanish language modules are missing with the Grub2 install...

I have done extensive and reading and someone in the Arch forums corrected the problem by preforming this copy as root

Code: Select all

cp "/boot/grub/locale/[email protected] /boot/grub/locale/en_US.mo"
Problem being we don't have an [email protected] file either.
I downloaded the Grub2 tar from sourceforge and looked through for any .mo language files but could not find one.
I imagine they are created during the config..

Any ideas or solutions to rid me of this grub2 boot error...
Besides my last though which is to reinstall grub but that may not solve the issue either.
Thank You
Last edited by sqlpython on Sun Jan 19, 2014 17:28, edited 2 times in total.
Criticism accepted for Solutions that work. ;^)
Sabayon 13-DEBIAN 8- #! -Sid-Slackware 14-Calculate 13-Bridge

Fitzcarraldo
Sagely Hen
Posts: 8200
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: Grub2 error msg re: /boot/grub/locale/en.mo

Post by Fitzcarraldo » Sun Jan 19, 2014 1:17

I'm going to take a guess that the GRUB 2 source code has a file copy command in it that perhaps creates the .mo files, so my suggestion would be to try and re-install GRUB 2 (as opposed to re-installing/upgrading the Entropy package):

Code: Select all

grub2-install /dev/sda
(I'm assuming you are using drive sda and you have GRUB 2 installed in the MBR, so adjust the command to your actual situation.)

sqlpython
Technological Hen
Posts: 386
Joined: Mon Jun 18, 2007 7:01
Location: If It Moves Compile It
Contact:

Re: Grub2 error msg re: /boot/grub/locale/en.mo

Post by sqlpython » Sun Jan 19, 2014 17:26

@Fitzcarraldo Thanks for advice.. in this instance the reinstall to /dev/sda did not help or hurt..

I have solved the error (to be clear the error did not seem to hinder the boot process but is not neat to view..)
Here are my failures and solution.

1. grub2-install /dev/sda (did not correct the error)
2. Complete removal and Reinstall of Grub2 with RIGO (did not correct the error)
3. Again I grub2-install /dev/sda (did not correct the error)
4. Copied onto a USB thumb drive from wife's Kubuntu install in /boot/grub/locale
... en_CA.mo en_AU.mo en_GB.mo en_US.mo
... of course the CA = Canada, AU = Australia, GB = Great Britain, US = United States
Then I entered as root in a termial the locale dir
And copied these files from the USB drive to the /boot/grub/locale/ dir
You can also preform the copy with a Root file manager

Code: Select all

su
cd /boot/grub/locale
cp /run/media/sqlpython/USB20FD/en* /boot/grub/locale/
cp /boot/grub/locale/en_US.mo /boot/grub/locale/en.mo
Rebooted and Voila'
or as Inspector Clouseau said "The problem is Solve-ed "..
Also note that there are similar language modules in /usr/share/i18n/locales/
This have no .mo extensions plus they are text and the files in /boot/grub/locale
appear to be binary.. I didn't use them with the copy command but may work.

EDIT: I left out the copy command from USB corrected
Criticism accepted for Solutions that work. ;^)
Sabayon 13-DEBIAN 8- #! -Sid-Slackware 14-Calculate 13-Bridge

Fitzcarraldo
Sagely Hen
Posts: 8200
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: Grub2 error msg re: /boot/grub/locale/en.mo [Solved]

Post by Fitzcarraldo » Sun Jan 19, 2014 20:49

Yes, I've now seen the same problem and similar solution (depending on which locale the user wants) reported in the forums of several Linux distributions, so there must be a bug somewhere. It looks like it is a GRUB 2 bug that has been fixed upstream but not filtered down to Gentoo or SL yet because the ebuild is not pulling the live version:

http://git.savannah.gnu.org/cgit/grub.g ... 997379cbd2

https://bbs.archlinux.org/viewtopic.php?pid=1349940

https://bugzilla.redhat.com/show_bug.cgi?id=817187

On two of my laptops running pre-13.08 SL installations using OpenRC and which I don't upgrade (see Note 1 below), the contents of the GRUB 2 locale directory are:

Code: Select all

$ ls /boot/grub/locale/
ca.mo  da.mo  de.mo  eo.mo  fi.mo  fr.mo  hu.mo  it.mo  ja.mo  nl.mo  pa.mo  pl.mo  ru.mo  sv.mo  uk.mo  vi.mo  zh_CN.mo  zh_TW.mo
$
In my VirtualBox installations of SL installed from the 14.01 ISO and fully upgraded, the contents of the GRUB 2 locale directory are the same as above.

In all these cases, when I installed SL I selected the Installer options to install all the additional language files (including Asian).

Anyway, the bottom line is that the English-language GRUB locale files are missing when they shouldn't be, and I believe it's an upstream bug in the specific version of GRUB 2 that SL installs. I haven't looked at the contents of the /boot/grub/locale directory on my main laptop running Gentoo, but I'll check that later and, if it's different to the above, I'll post the contents of that directory. I have not noticed any error messages re GRUB, in any case.


Note 1: I know they will break if I upgrade them, because all the other pre-13.08 installations I upgraded broke, even though I am sure systemd was selected via 'eselect init', 'eselect sysvinit', 'eselect settingsd', etc.

sqlpython
Technological Hen
Posts: 386
Joined: Mon Jun 18, 2007 7:01
Location: If It Moves Compile It
Contact:

Re: Grub2 error msg re: /boot/grub/locale/en.mo [Solved]

Post by sqlpython » Mon Jan 20, 2014 4:14

^ Yes, all your info matches my research.
Not a Gentoo nor a Sabayon Bug.
The Grub2 dev site admits to the oversite of the missing .mo files.

All your examples are just as mine were. I did see the examples of the Bug posted on a number of Linux forums i.e. SuSE, Arch, Fedora and now here. Also as you say, an Upgrade here will break a 13.xx..
So, for now dragging in the needed english language .mo files from another source is the best option.
I attempted to find them in the grub2.tar.gz but got eyestrain and gave up...
..Also I continue to wonder if the text language files in /usr/share/locale will work .. :?:
Criticism accepted for Solutions that work. ;^)
Sabayon 13-DEBIAN 8- #! -Sid-Slackware 14-Calculate 13-Bridge

Fitzcarraldo
Sagely Hen
Posts: 8200
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: Grub2 error msg re: /boot/grub/locale/en.mo [Solved]

Post by Fitzcarraldo » Mon Jan 20, 2014 4:29

sqlpython wrote:Also I continue to wonder if the text language files in /usr/share/locale will work .. :?:
It seems they could! For example:

Code: Select all

[email protected] ~ $ ls /boot/grub/locale/de*
/boot/grub/locale/de.mo
[email protected] ~ $ ls /usr/share/locale/de/LC_MESSAGES/grub*
/usr/share/locale/de/LC_MESSAGES/grub.mo
[email protected] ~ $ diff -s /usr/share/locale/de/LC_MESSAGES/grub.mo /boot/grub/locale/de.mo 
Files /usr/share/locale/de/LC_MESSAGES/grub.mo and /boot/grub/locale/de.mo are identical
[email protected] ~ $

Fitzcarraldo
Sagely Hen
Posts: 8200
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: Grub2 error msg re: /boot/grub/locale/en.mo [Solved]

Post by Fitzcarraldo » Mon Jan 20, 2014 16:08

OK, I've now been able to look on my main laptop, which runs Gentoo. The contents of the /boot/grub/locale directory are:

Code: Select all

meshedgedx fitzcarraldo # ls /boot/grub/locale/
es.mo  pt_BR.mo
meshedgedx fitzcarraldo #
Note that my Gentoo /etc/make.conf file contains LINGUAS="en en_GB pt_BR es_ES". It seems it is not necessary to have en.mo or en_GB.mo in the /boot/grub/locale directory -- see the link to the GRUB 2 code commit that I posted earlier -- which I also give further on in this post -- which adds the following code to GRUB 2 to make it ignore the absence of en*.mo:

Code: Select all

if (locale[0] == 'e' && locale[1] == 'n'
&& (locale[2] == '\0' || locale[2] == '_'))
grub_errno = err = GRUB_ERR_NONE;
Note also that the GRUB 2 that SL uses is built from an ebuild by lxnay in the sabayon-distro overlay, and at present its version is 2.00-r5:

https://github.com/Sabayon/sabayon-dist ... -boot/grub

and the Entropy package is built using that ebuild:

https://packages.sabayon.org/quicksearch?q=grub

Note also that the latest GRUB 2 ebuild in the Portage main tree is a different ebuild and is at version 2.02_beta2, which is what I have got installed in my Gentoo installation:

Code: Select all

meshedgedx fitzcarraldo # eix -I sys-boot/grub
[I] sys-boot/grub
     Available versions:  
     (0)    *0.92-r1 0.94-r1 0.96-r1 0.96-r2 (~)0.96-r3 (~)0.97 0.97-r2 0.97-r3 0.97-r4 0.97-r5 0.97-r6 (~)0.97-r8 0.97-r9 0.97-r10 (~)0.97-r11 0.97-r12 (~)0.97-r13
     (2)    (**)1.99-r2 (~)2.00-r4^t (~)2.00_p5107^t 2.00_p5107-r2^t (~)2.02_beta1-r1^t (~)2.02_beta2^t [m](**)9999-r1^t
       {custom-cflags debug device-mapper doc efiemu libzfs mount +multislot ncurses netboot nls sdl static test truetype GRUB_PLATFORMS="coreboot efi-32 efi-64 emu ieee1275 multiboot pc qemu qemu-mips yeeloong"}
     Installed versions:  2.02_beta2(2)^t(02:00:31 30/12/13)(multislot nls sdl truetype -debug -device-mapper -doc -efiemu -libzfs -mount -static -test GRUB_PLATFORMS="pc -coreboot -efi-32 -efi-64 -emu -ieee1275 -multiboot -qemu -qemu-mips -yeeloong")
     Homepage:            http://www.gnu.org/software/grub/
     Description:         GNU GRUB boot loader

meshedgedx fitzcarraldo #
Now, I don't experience the boot error message you reported in your first post, so I assume that the aforementioned fix by GRUB 2 developer Vladimir Serbinenko is included in the Gentoo sys-boot/grub-2.02_beta2. Below I repeat the link I gave in an earlier post, showing the precise commit to the GRUB 2 source code:

grub-core/gettext/gettext.c (grub_gettext_init_ext): Ignore errors if language is English.

So, if you wished to do so, I believe you could file a bug report in the SL Bugzilla requesting lxnay to incorporate that fix for SL. Alternatively, you could just wait until it filters down to SL when lxnay next bumps his grub ebuild in the sabayon-distro overlay in future at some point.

Post Reply