Ask your questions here.
Post a reply
felleg

- felleg
- Posts: 3
- Joined: Mon Feb 20, 2017 2:10 am

## Refracta with GRUB2. Locales, keyboard boot options problem

Mon Feb 20, 2017 4:03 am

Hello! I have heard about Refracta only one day ago but now I am already writing from this OS. In general everything is fine, except some little and bigger problems...
The little: Need to do this:

Code:
  `# mount -o remount,rw /lib/live/mount/medium/`

to be able to write the partition containing the boot medium. When issue this command make sure there is not open any Thunar window. Write access was a problem also in Debian Live once. But now they maneged somehow the live-media partition be writable.
The bigger one: The boot options from this page:
https://sourceforge.net/projects/refrac ... isohybrid/

Code:
  `config=refracta-lang,tzdata lang=de_DE`

are not working.
I have tried every possible combination of these and those for Debian. This works for Debian:

Code:
  `boot=live config live-config live-config.locales=hu_HU.UTF-8 live-config.keyboard-layouts=hu`

but not for Refracta. Nor this:

Code:
  `boot=live config=locales,keyboard-configuration,refracta-lang locales=hu_HU.UTF-8 keyboard-layouts=hu lang=hu_HU`

The locales always remains en_US with us keyboard.
I use only live systems launched with manually installed and manually edited GRUB2, grub.cfg. So, I need help for why are not working the boot options for setting the locales and keyboard. Please do not advice me to install language pack, reconfigure locales, etc. Since I do not want to install the OS. Thanks.
Copying Refracta into boot directory:

Code:
  `[email protected]
  :/home/user# mount /home/user/refracta8_xfce_i386-20170218_2229.iso /mnt/1
  mount: /dev/loop2 is write-protected, mounting read-only
  [email protected]
  :/home/user# cp -a /mnt/1/* /lib/live/mount/fromiso/boot/refracta8_xfce_i386-20170218_2229/`

My edited grub.cfg file:

Code:
  `menuentry 'refracta8_xfce_i386-20170218_2229 hu london (accessibility)' {
  set OS=refracta8_xfce_i386-20170218_2229
  linux /boot/$OS/live/vmlinuz bootfrom=/dev/sda1 live-media-path=/boot/$OS/live/ \
  boot=live config=locales,keyboard-configuration,refracta-lang,tzdata locales=hu_HU.UTF-8 \
  keyboard-layouts=hu lang=hu_HU timezone=Europe/London noeject noprompt quiet access=HC
  initrd /boot/$OS/live/initrd.img
  }`

Last edited by felleg on Tue Feb 21, 2017 2:31 pm, edited 1 time in total.
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Mon Feb 20, 2017 11:54 am

Try this, and tell me what you get. I didn't think it would work, because of #3 below, but I have something other than US keyboard, and menus are not English.

Code:
  `boot=live lang=hu_HU`

Error messages in the terminal are still in English.
(Still drinking my first cup of coffee. I may have other ideas later.)
1. "config" should be "components". That changed between wheezy and jessie. Thanks for pointing out my error. I forgot to change it in the release notes.
2. You probably don't want to use the word, components. If you do, you only get those components you name.
3. Only a few languages are pre-configured, and I'm sorry to say that yours isn't one of them. I purged most locales to make the iso small enough to fit on a CD. See this discussion about missing locales -
to-use-the-refracta-in-your-native-language-t645.html
4. refracta-lang gives you an easier way to get the locale and keyboard. You should be able to add just "lang=hu_HU" (I just tried this and added the suggestion at the beginning of this post.)
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Mon Feb 20, 2017 1:36 pm

I believe I can fix this and make new isos that will have all locales available and will still fit on a CD. I should be able to get it done in the next couple of days, or possibly today. I'll start with i386.
See this discussion about booting iso from hard drive using grub.
boot-refracta-or-other-debian-live-iso-from-grub2-menu-t367.html
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Mon Feb 20, 2017 6:49 pm

Fixed: https://sourceforge.net/projects/refrac ... o/download
I can only get the short version of the locale option to work. Just add

Code:
  `lang=hu_HU`

to the boot command, without all the locales, keyboard_blah stuff. That should set language, keyboard and I think time zone, too.
Looks like the iso is 707MB (675MiB). Hope nobody has problems because of that.
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Mon Feb 20, 2017 7:54 pm

Code:
  `# mount -o remount,rw /lib/live/mount/medium/`

Welcome fellag to Refracta forum. . and thanks for that tip, didn't know you could do that after bootup. It works also using "findiso", when the partition is mounted to /lib/live/mount/findiso.
I also use grub to boot iso's and require (unsupported in live-boot) write access to the live-media partition. I can also chmod the mount dir for user write permissions (my iso's are on an ext4 general "data" partition).
We did a patch for rw access which goes in the initrd (details somewhere in this forum). To remount later is simpler and could be done manually or with a custom live-hook. However you still can't use a persistence file on the same partition without the patched initrd.
fsmithred, I'm curious if a live-config script could be used to parse the cmdline and generate one (or more) locales automatically, to avoid iso bloat. EDIT: the existing refracta-lang script could be used.
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Mon Feb 20, 2017 11:50 pm

I don't know if we can generate locales at boot. Don't know enough about the process. Oh. Edit /etc/locale.gen and then run locale-gen. I know we can make a live-config script to parse the command-line and do something with it. We should experiment with that.
Just uploaded the amd64 iso for refracta-8.2. This one is even bigger than the i386, but I'm not so concerned about it. The locales issue has already affected a few people.
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Tue Feb 21, 2017 2:19 am

Something like this might work, in 1065-refracta-lang. Immediately after line 65, LOCALESELECTED="$LANGSELECTED.UTF-8"

Code:
  `### generate it if not configured
  if ! (grep "^$LOCALESELECTED UTF-8" /etc/locale.gen); then
  sed -i -e "s/# $LOCALESELECTED UTF-8/$LOCALESELECTED UTF-8/" /etc/locale.gen
  dpkg-reconfigure --frontend=noninteractive locales
  fi`

I'll try it in a hook later. That script is quite old an scrappy anyway, works but could do with an update and a tidy-up.
felleg

- felleg
- Posts: 3
- Joined: Mon Feb 20, 2017 2:10 am

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Tue Feb 21, 2017 3:15 am

Thanks for the replies. I am learning Refracta, and the more I know it the more I can't leave it.
Yes, "lang=hu_HU" is the solution. And to not apply other cheatcodes...
Refracta in Hungarian language, Hungarian keyboard, custom timezone:

Code:
  `menuentry 'refracta8_xfce_i386-20170218_2229 hu-lang london' {
  set OS=refracta8_xfce_i386-20170218_2229
  linux /boot/$OS/live/vmlinuz bootfrom=/dev/sda1 live-media-path=/boot/$OS/live/ \
  boot=live lang=hu_HU timezone=Europe/London noeject noprompt quiet
  initrd /boot/$OS/live/initrd.img
  }`

Actually, except the main menu everything is in English, because the applications do not have Hungarian translations in Refracta. But despite this, it is very good to have my locales set. There are a lot of cases when this matters.
It was said that this is to keep the distro small. Yes, the localizations need a lot of space. But I have a proposal: let be two versions of Refracta, with identical package list: one with English, and one bigger with foreign localizations in plus. And everyone can decide which they need.
Refracta in Hungarian language, Hungarian keyboard, custom timezone, without X:

Code:
  `menuentry 'refracta8_xfce_i386-20170218_2229 nox hu-lang london' {
  set OS=refracta8_xfce_i386-20170218_2229
  linux /boot/$OS/live/vmlinuz bootfrom=/dev/sda1 live-media-path=/boot/$OS/live/ 3 \
  boot=live lang=hu_HU timezone=Europe/London noeject noprompt quiet
  initrd /boot/$OS/live/initrd.img
  }`

In this case, the keyboard was set to Hungarian, too. Except 2 letters (ő, ű) I could enter every Hungarian characters.
Refracta in English, US keyboard, UTC:

Code:
  `menuentry 'refracta8_xfce_i386-20170218_2229 utc' {
  set OS=refracta8_xfce_i386-20170218_2229
  linux /boot/$OS/live/vmlinuz bootfrom=/dev/sda1 live-media-path=/boot/$OS/live/ \
  boot=live noeject noprompt quiet
  initrd /boot/$OS/live/initrd.img
  }`

I still couldn't manage to resolve to run Refracta in English but with Hungarian keyboard.
With GRUB2 I could have run Refracta direct from ISO image. I unpacked it only to ease my CPU's load.
Refracta in English, US keyboard, UTC, using ISO image:

Code:
  `menuentry 'refracta8_xfce_i386-20170218_2229 utc' {
  set ISO=boot-isos/refracta8_xfce_i386-20170218_2229.iso
  loopback loop /$ISO
  linux (loop)/live/vmlinuz fromiso=/dev/sda1/$ISO \
  boot=live noeject noprompt quiet
  initrd (loop)/live/initrd.img
  }`

"components": When I applied it instead of "config" I got a login screen. In the upper-right part of the screen I could choose from those locales shipped in Refracta. I tried Finnish and Romanian, but after logging in everything was in English, even the keyboard.
In my opinion Refracte should have its own cheatcodes for locales, keyboard, timezone. Like in Knoppix. In Knoppix they are clear and always work.
I have again a proposal. To include into /etc/rc.local file (or in any other file, that ensures the command will be executed at the end of the boot process but before X starts) this:
IF refracta is in live mode AND exists ISO_NAME.sh in live-media partition (where it is located the refracta iso image, directory... ); THEN execute ISO_NAME.sh
ISO_NAME: the name of the actual refracta iso image; for example: refracta8_xfce_i386-20170218_2229
This would be very handy to define custom configurations for the system and applications, to set the net, etc., without remastering the ISO image, and still using a true, always fresh live system.
Last edited by felleg on Tue Feb 21, 2017 2:39 pm, edited 1 time in total.
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Tue Feb 21, 2017 4:46 am

The previous refracta iso (no HU locale configured), with "lang=hu_HU hooks=file:////lib/live/mount/findiso/hookscript" on cmdline, boots here to HU language and keyboard. I noticed not all was translated, probably a valid bug report for the package maintainers.
The hookscript, placed in the directory containing the live iso and called as described, is a modified (as suggested) /lib/live/config/1095-refracta-lang. Therefore it should work for the actual config script (without the hook) but need to rebuild the iso to be certain.
So far can only the "wx_YZ.UTF-8" type locales can be processed this way. Some are different but there might be a way to sort them also.
felleg, is not your proposal (using rc.local) already possible using the live-hook mechanism?
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Refracta with GRUB2. Locales, keyboard boot options prob

Tue Feb 21, 2017 1:51 pm

> lightdm language selector broken
> Postby fsmithred » Sun Sep 18, 2016 11:33 am
> If you select a language at the graphical login screen, your choice does not take effect on login. Your choice will take effect after the display manager is restarted, or after you reboot. This is apparently an old problem that was allegedly fixed in an earlier version. It might be a problem with lightdm-gtk-greeter or with lightdm itself.
> If you don't want to reboot, run this command in a root terminal:
> Code:
>   `service lightdm stop && service lightdm start &`

Not related to the above, if I use lang=xx_XX and boot to desktop, open a terminal, type a command that gives an error message, that message is in the language I selected. If I drop to console or boot to console, I still have the non-US keyboard, but the system messages are in English. This was not the case with the October isos, so I obviously broke something. But I think it's still better than it was. The desktop is not limited to the 20 languages I picked by throwing darts at a map.
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.