Refracta Development, Scripts, etc.
Post a reply
dzz

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

## Re: Uploaded daily (weekly?) build

Mon Dec 12, 2011 12:43 pm

Re locales, some observations.
Testing this using (latest) snapshot-20111209_1211.iso on usb with default initrd, bootopts, no other modifications (except locales=wy_YZ.UTF-8)
We have worked out how to set system locale (and keyboard, if required) from the boot prompt and verified that that locale will be generated and used as system default regardless of what is preconfigured in the build.
There is however one problem with the latest build (I don't remember this on other builds) the file ~/.dmrc is set to en_US.UTF-8
That file sets the XFCE session locale, for that specific user, which is not necessarily the same as the system locale.

Code:
  `[Desktop]
  Session=default
  Language=en_US.UTF-8`

This will change, for the user session, only if another locale is selected from the list at the gdm login or .dmrc is altered manually (The gdm login screen itself should still use the system locale)
If .dmrc is like this however the user session will use the system locale:

Code:
  `[Desktop]
  Session=default`

If .dmrc does not exist at all, it gets autogenerated at login as above (Session=default). It will use the system default, i.e. US, unless another is specified at cmdline.
So .dmrc needs editing (or removing) in the build. There is another file, ~/.config/user-dirs.locale which also specifies en_US, I can't see what it does, seems to make no difference without it.
BTW: minor changes like this are easily tested using a simple live-hook script placed in the usb root, without having to rebuild the iso
Regarding preconfigured locales in the build, maybe all that's needed is a small number of the most common ones else the list in gdm gets awkward. Whatever was selected at boot prompt should show. Any which don't work are likely unsupported by the system. gdm or xfce
dzz

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

## Re: Uploaded daily (weekly?) build

Wed Dec 14, 2011 11:15 am

The files
~/.config/user-dirs.dirs
~/.config/user-dirs.locales
are to do with xdg-user-dirs http://www.freedesktop.org/wiki/Software/xdg-user-dirs
As this is globally disabled in latest Refracta build they serve no purpose unless a user manually enables xdg-user-dirs
fsmithred

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

## Re: Uploaded daily (weekly?) build

Fri Dec 16, 2011 6:59 pm

Uploading snapshot-20111216_1346
Edited ~/.dmrc
Removed ~/.config/user-dirs.locales
Added /lib/live/config/107-refracta-configs
Added instructions in boot help:
boot: live live-config=locales,keyboard-configuration locales=de_DE.UTF-8 keyboard-layouts=de
dzz

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

## Re: Uploaded daily (weekly?) build

Sat Dec 17, 2011 12:56 am

New build up and running here, fast with zsync.
For now, booting it from a grub-legacy menu pointing to a directory /dev/sdc3/refracta-boot/, containing initrd, vmlinuz and filesystem.squashfs (it's fast, my flash drive is full, cdburner fried, virtualbox crawls) This method (like the old Knoppix "poor man's install") is probably adaptable to grub2 or sys/isolinux

Code:
  `title refracta from squash new2
  root (hd2,2)
  kernel (hd2,2)/refracta-boot/vmlinuz boot=live noprompt live-config=locales,refracta-configs union=aufs quiet vga=791 locales=en_GB.UTF-8 live-media-path=/refracta-boot
  initrd (hd2,2)/refracta-boot/initrd.img`

As expected, en_GB.UTF-8 locale and gb keyboard are all set up for user, root, X and console
Re 107-refracta-configs; it's a live-config script to automatically set the keyboard (X and console) according to the specified locale (a convenient alternative to keyboard-configuration) It will only work for a 2-letter keyboard layout (e.g. gb,de,fr) and can't do variants (in which case use instead keyboard-configuration=whatever) That script would actually be better showing only 3 in the xfce panel-list, leaving an option to add another. In fact it shows 4 (the maximum possible for xfce switcher) so in case it doesn't work right, a user must delete one to add another,.
fsmithred

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

## Re: Uploaded daily (weekly?) build

Sat Dec 17, 2011 4:51 am

I'm confused. Why are you seeing four locales in the panel applet? I only see three (us,gb,de) even when I set French on the boot line.
Future project - I don't know if it's possible, but it might be nice if we could make it so you only had to type a word or two on the boot line to set locale and keyboard.
If this build is working properly, and I sure hope it is, then this is the official Refracta-6.0.6.
dzz

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

## Re: Uploaded daily (weekly?) build

Sat Dec 17, 2011 1:40 pm

Why do I get 4 keyboards in the switcher?
Because, in my example options line in my previous post, is appended "live-config=locales,refracta-configs locales=en_GB.UTF-8" so (only) those live-config scripts will run.
That's exactly what 107-refracta-configs does (you don't use the 107- in the cmdline append), sets the current keyboard for console *and* XFCE automatically from the specified locale, adding 3 alts from a shortlist
The whole point of 107-refracta-configs actually is less typing on cmdline and no clicking required when X is up. It is not fully tested but seems to work.
keyboard-configuration (the official Debian-Live script) does console (system) keyboard but XFCE will not use it, at least with the current Refracta user setup. You have to switch manually or, if the one you want is not in the switcher, add another
BTW (experimental) Still no sign of problems allowing *all* live-config scripts (but using "noautologin") In that case, the clock will be UTC unless you tell it otherwise
Three points re the F5 menu:
1. "live-config=locales, locales=de_DE.UTF-8" should not have the comma
2. If (107-)refracta-configs will be included, there is no mention in F5
3. It would be good to add one space following the default line, for less risk of typing error
And yes, that aside, this version is very usable indeed, although I haven't tested snapshot or installer lately.
fsmithred

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

## Re: Uploaded daily (weekly?) build

Sat Dec 17, 2011 2:12 pm

Ah, ok, I didn't realize I was supposed to add "refracta-configs" on the boot line. I was getting the instructions from IRC logs, and I must have missed something. I'll have to play with it tomorrow, when I have some time.
Extra space at the end of the line - yeah, good idea, and I'll do that.
Comma - oops. I was going to put 'keyboard-configuration' there, and I changed my mind. I guess all I have to do for the next build is edit f5.txt and the boot line in live.cfg.
dzz

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

## Re: Uploaded daily (weekly?) build

Sat Dec 17, 2011 3:55 pm

That's a problem with irc, things move quickly, no time to evaluate, things can get mis-typed and/or misread, multiple threads going on at once. But it's all valuable.
The refracta-configs script is somewhat experimental, probably could be tidied up and improved, but I'm finding it basically works. And no, you don't have to rebuild the whole system to refine the boot menu. It's all looking good
BTW it is an official recommendation (but not essential) to do such custom scripts as deb packages, helps keep a clean apt/dpkg-trackable system
One point with live-config scripts generally, is the order matters. this might not be automatic when they are invoked selectively (e.g.. "(004-)locales" "(005-)tzdata" "(107-)refracta-configs" in that order)

> (man live-config)
> live-config=SCRIPT1,SCRIPT2, ... SCRIPTn | config=SCRIPT1,SCRIPT2, ... SCRIPTn
> Only the specified scripts are run. Note that the order matters, e.g. 'live-con‐
> fig=sudo,user-setup' would not work since the user needs to be added before it can be
> configured for sudo. Look at the filenames of the scripts in /lib/live/config for their
> ordering number.

fsmithred

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

## Re: Uploaded daily (weekly?) build

Sun Dec 18, 2011 9:36 pm

I guess line 89 of 107-refracta-configs needs to be revised. Here's the full list of supported languages with the locale codes. I think I'll include this in the boot help text (maybe F6) or else in the release notes or in the Refracta directory in the root of the iso.

Code:
  `Arabic ar_SA.UTF-8 Italian it_IT.UTF-8
  Armenian hy_AM UTF-8 Latvian lv_LV.UTF-8
  Dutch nl_NL.UTF-8 Lithuanian lt_LT.UTF-8
  English (UK) en_GB.UTF-8 Norwegian (Bokm) nb_NO.UTF-8
  English (US) en_US.UTF-8 Norwegian (nynorsk) nn_NO.UTF-8
  Estonian et_EE.UTF-8 Polish pl_PL.UTF-8
  Finnish fi_FI.UTF-8 Portugese pt_PT.UTF-8
  French fr_FR.UTF-8 Romanian ro_RO.UTF-8
  German de_DE.UTF-8 Russian ru_RU.UTF-8
  Hebrew he_IL.UTF-8 Spanish es_ES.UTF-8
  Hindi hi_IN UTF-8 Swedish sv_SE.UTF-8
  Icelandic is_IS.UTF-8 Turkish tr_TR.UTF-8
  `

If we could meet in irc and you walk me through the script, it would help a lot. Right now, I don't want to mess with it, because I'm not sure what all the parts are doing.
dzz

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

## Re: Uploaded daily (weekly?) build

Mon Dec 19, 2011 3:16 am

The "full list of supported languages" means only the build's preconfigured locales. What you select at boot does not have to be preconfigured in the live build, it can be autogenerated in addition as part of the live-boot process.

Code:
  `live-config=locales,refracta-configs locales=ga_IE.UTF-8`

Yes, Irish Gaelic is running here on unmodified, multilingual Refracta Live
Re refracta-configs :
The comment on line 88 explains line 89, maybe not clearly enough.
The script has already detected (lines 63 and 64), whether a keyboard and/or locale was set at the cmdline (i.e. typed in manually) and if so what
lines 66-84 :
If a keyboard (or keyboards) was selected, that is what will be written to the relevant xfce config files. We don't need to add more to the switcher because the user has already chosen. The console keyboard will be sorted by keyboard-configuration. Of course, locale and keyboard might be different (I have a French laptop)
lines 84-122 :
If the user has selected a locale but not a keyboard, and has invoked this script, we will do the job automatically.
Example: de_DE.UTF-8
Line 33 and 36 have already taken the bit we want for the keyboard from the locale ("de_DE.UTF-8" to "de", no quotes, the 2 letters after the underscore in lowercase)
That, de, will be what xfce will use.
Line 89 will set 3 alts to the panel switcher, from a shortlist of 8. Of those 8 we will exclude the one chosen already (de) get rid of any leading or tailing commas and pick the first 3 in the list.

Code:
  `awk -F , '{print $1","$2","$3}'`

picks the first 3, comma-seperated (","$3 would be better removed to leave a spare for manual addition), in case the automatic main selection is not right. For example if a user actually needs a variant. Xfce offers a choice of 4 variants for Irish for example, including every possible variant gets complex for a basically simple script.
us,gb,de,fr,es,nl,pt,it
will become (for our alts)
us,gb,fr
The final layout (line 90) will be:
de,us,gb,fr
It doesn't matter if the user's choice is in the shortlist or not, that's only for the alts! The alts are simply a few of the probaby-most-common ones, to set in the switcher.
The script will then, if it was not done by keyboard-configuration, set the console (system) keyboard to "de" (line 108)
Almost there. Sort ~/.dmrc so the user session starts in the right language (probably unnecessary now because ~/.dmrc was changed in the last build and wlll now use system default anyway) GDM will use system default unless the user sets it otherwise at login screen.
Finally, sort permissions in ~ and write a state file for itself to /lib/live/config like the others do
That's it !
If you want any more explanation, I can do irc early this week, evenings gmt and/or feel free to use email.
EDIT I edited this a few times to clarify more.
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.