]> git.ozlabs.org Git - petitboot/log
petitboot
9 years agodiscover: status messages shouldn't have a trailing newline
Jeremy Kerr [Fri, 18 Sep 2015 02:47:33 +0000 (10:47 +0800)]
discover: status messages shouldn't have a trailing newline

Fix the status message, and remove the newline from our translations.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopo: Manual translation formatting fixes
Jeremy Kerr [Fri, 18 Sep 2015 02:42:43 +0000 (10:42 +0800)]
po: Manual translation formatting fixes

We have a few minor issues, mostly formatting, from the latest translation
drop.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopo: translation updates
Jeremy Kerr [Fri, 18 Sep 2015 01:34:28 +0000 (09:34 +0800)]
po: translation updates

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover: Add translation comments for status messages
Jeremy Kerr [Fri, 18 Sep 2015 01:13:24 +0000 (09:13 +0800)]
discover: Add translation comments for status messages

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopo: Update translation files
Samuel Mendoza-Jonas [Tue, 15 Sep 2015 06:25:04 +0000 (16:25 +1000)]
po: Update translation files

Add additional source files to POTFILES.in and update the *.po files
where able.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoFix certain calls to gettext
Samuel Mendoza-Jonas [Tue, 15 Sep 2015 06:24:24 +0000 (16:24 +1000)]
Fix certain calls to gettext

Properly call gettext for strings in discover/device-handler.c that are
user-visible, and fix the help string in ui/ncurses/nc-subset.c

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoMerge branch 'pb-plugin' into master
Samuel Mendoza-Jonas [Fri, 11 Sep 2015 05:56:18 +0000 (15:56 +1000)]
Merge branch 'pb-plugin' into master

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agopb-plugin: Don't execute metadata files
Jeremy Kerr [Fri, 11 Sep 2015 04:40:16 +0000 (12:40 +0800)]
pb-plugin: Don't execute metadata files

Rather than sourcing a plugin's metadata file, explicitly parse
variables.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoui/ncurses: Improve scrolling behaviour
Samuel Mendoza-Jonas [Wed, 9 Sep 2015 04:39:34 +0000 (14:39 +1000)]
ui/ncurses: Improve scrolling behaviour

The nc-config screen now includes several select options with a FIELD
height greater than one, but config_screen_widget_focus() will only
scroll down enough to see the first line of text.
Update config_screen_widget_focus() to try and make as much of the
focussed widget visible as possible.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Allow text wrapping in select widgets
Samuel Mendoza-Jonas [Tue, 8 Sep 2015 23:03:52 +0000 (09:03 +1000)]
ui/ncurses: Allow text wrapping in select widgets

Several string translations used in select widgets are longer than the
maximum possible width of the widget. Rather than associating several
FIELDs with a select option, use a fold_text callback to pad out
substrings of the original string such that the ncurses O_WRAP option
properly wraps strings within the field.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Allow fs recovery if snapshot available
Samuel Mendoza-Jonas [Tue, 25 Aug 2015 00:33:14 +0000 (10:33 +1000)]
discover: Allow fs recovery if snapshot available

If we have a device-mapper snapshot available we can now guarantee
filesystem recovery will not write back to a read-only mounted disk.
Allow recovery on those devices with the notable exception of XFS which
may fail to mount if the filesystem is the opposite endian of Petitboot.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Improve update handling in nested screens
Samuel Mendoza-Jonas [Wed, 2 Sep 2015 05:43:39 +0000 (15:43 +1000)]
ui/ncurses: Improve update handling in nested screens

Several screens in petitboot-nc require an update if a config or sysinfo
update is received. However if those screens exist but are not the
current screen they will incorrectly try to draw to the screen.

Where the currently active screen is a textscreen (eg. a help screen)
the update is delayed until after the screen is exited.

In the particular case of nc-config where the current screen can be an
nc-subset screen, the nc-subset screen is exited immediately so the
update can be performed, since the nc-subset screen depends on the
information in the previous screen.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Change arrangement of boot order buttons
Samuel Mendoza-Jonas [Fri, 4 Sep 2015 05:52:20 +0000 (15:52 +1000)]
ui/ncurses: Change arrangement of boot order buttons

The buttons 'Add Device', 'Clear', and 'Clear & Boot Any' are short
enough to be positioned horizontally, but several localisations have
strings as long as all three buttons combined.

Instead arrange the buttons vertically and allow longer strings to
resize the width of the button to fit the whole string.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Resize & adjust OK/Help/Cancel buttons
Samuel Mendoza-Jonas [Fri, 4 Sep 2015 05:47:42 +0000 (15:47 +1000)]
ui/ncurses: Resize & adjust OK/Help/Cancel buttons

The localisation of 'OK' is cut short in a few languages by a character
or two - adjust the buttons in each affected screen slightly to
accommodate.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agopb-plugin: Fix invalid command reference
Jeremy Kerr [Wed, 2 Sep 2015 15:10:50 +0000 (23:10 +0800)]
pb-plugin: Fix invalid command reference

We had the old code for using 'run'. Also, fix the error we see when
issuing an invalid command.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopb-console: Always add plugins directory to PATH
Jeremy Kerr [Wed, 2 Sep 2015 15:08:26 +0000 (23:08 +0800)]
pb-console: Always add plugins directory to PATH

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopb-plugin: Add lint command
Jeremy Kerr [Wed, 2 Sep 2015 14:54:58 +0000 (22:54 +0800)]
pb-plugin: Add lint command

This change adds a `lint` command, to do some basic checks on the plugin
structure and metadata.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopb-plugin: Implement plugin ABI versioning
Jeremy Kerr [Wed, 2 Sep 2015 09:13:27 +0000 (17:13 +0800)]
pb-plugin: Implement plugin ABI versioning

If a future update to plugins is not compatbile with the installed
plugin infrastructure, we want to abort the scan / install process.

This change adds an ABI version to the script, as well as version (and
minimum-supported version) to the plugin metadata. This means we can
check before plugin execution.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopb-plugin: Only require a fixed plugin extension, instead of full name
Jeremy Kerr [Wed, 2 Sep 2015 07:41:38 +0000 (15:41 +0800)]
pb-plugin: Only require a fixed plugin extension, instead of full name

Currently, the `pb-plugin scan` code requires a fixed archive name at
the root of distributed media. This means that vendors need to have a
fixed name, and can only ship one plugin per device.

This change shifts the requirement to just a filename extension
(.pb-plugin) instead.

To handle this, we now look for any plugin with a .pb-plugin extension,
and so may find multiple plugins on a device.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoConsolidate display string for optical devices
Samuel Mendoza-Jonas [Tue, 25 Aug 2015 01:08:09 +0000 (11:08 +1000)]
Consolidate display string for optical devices

Instead of using 'Optical' in some places and 'CD/DVD' in others, simply
use 'CD/DVD' for all cases.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoRecognise storage devices on USB bus
Samuel Mendoza-Jonas [Fri, 21 Aug 2015 05:18:48 +0000 (15:18 +1000)]
Recognise storage devices on USB bus

Users may want to prioritise USB-attached storage devices differently to
other devices. Detect if a device is USB-attached and add a new device
type to identify it.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Fix positioning of i18n strings in button labels
Samuel Mendoza-Jonas [Fri, 10 Jul 2015 05:57:48 +0000 (15:57 +1000)]
ui/ncurses: Fix positioning of i18n strings in button labels

Since the visual length of localised strings is not necessarily equal to
the number of chars in the array, button labels could 'finish' early.

For example:
'[確定]  ' and '[  說明  ]  '
vs the correct
'[ 確定 ]' and '[   說明   ]'

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agolib/i18n: Move strncols to i18n.c
Samuel Mendoza-Jonas [Thu, 9 Oct 2014 03:40:38 +0000 (14:40 +1100)]
lib/i18n: Move strncols to i18n.c

Make the strncols() helper available generally to i18n-concerned code.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agopb-plugin: Move plugin wrappers to a separate dir
Jeremy Kerr [Thu, 27 Aug 2015 08:33:32 +0000 (16:33 +0800)]
pb-plugin: Move plugin wrappers to a separate dir

Use /var/lib/pb-plugins/bin, to prevent overwriting system binaries.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoui/ncurses: Update nc-config help text for Disk R/W
Samuel Mendoza-Jonas [Wed, 19 Aug 2015 05:28:30 +0000 (15:28 +1000)]
ui/ncurses: Update nc-config help text for Disk R/W

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agolib/fold: Handle extra mbrtowc return case
Samuel Mendoza-Jonas [Thu, 20 Aug 2015 06:32:25 +0000 (16:32 +1000)]
lib/fold: Handle extra mbrtowc return case

Commit 9781a370 ("Handle mblen return code when n is zero.") in glibc
changes the return value for when the number of bytes ('n') is zero.
Add an extra condition to detect if we've reached the end of the buffer.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agopb-plugin: Keep chroot persistent, and create wrapper scripts
Jeremy Kerr [Fri, 21 Aug 2015 05:12:19 +0000 (13:12 +0800)]
pb-plugin: Keep chroot persistent, and create wrapper scripts

Rather than having to 'pb-plugin run' multiple times, we want users to
be able to execute multiple plugin binaries with more accessible
command-line statements.

This change reverts to the previous 'install' (rather than 'run')
behaviour, and creates wrapper scripts to call into the chroot.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agopo: Translation updates for all languages
Samuel Mendoza-Jonas [Wed, 19 Aug 2015 04:19:48 +0000 (14:19 +1000)]
po: Translation updates for all languages

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Add disable param for dm-snapshots
Samuel Mendoza-Jonas [Mon, 17 Aug 2015 04:33:25 +0000 (14:33 +1000)]
discover: Add disable param for dm-snapshots

Add a debug-style nvram parameter to disallow the use of device-mapper
snapshots.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover/udev: Additional checks in udev_handle_block_add
Samuel Mendoza-Jonas [Fri, 14 Aug 2015 05:57:55 +0000 (15:57 +1000)]
discover/udev: Additional checks in udev_handle_block_add

- Several filesystem types can appear that we won't be able to mount.
Instead of waiting to fail mounting them in device_handler_discover(),
skip processing them at all.

- Do not create dm-snapshots on top of raid arrays until we have a
reliable way of determining the sector count for a md raid device.

- Turn down the verbosity on skipping dm-devices.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover/devmapper: Disable libdm udev sync support
Samuel Mendoza-Jonas [Fri, 14 Aug 2015 05:25:14 +0000 (15:25 +1000)]
discover/devmapper: Disable libdm udev sync support

Certain userspace environments that Petitboot is packaged with include
a libdm built with udev sync support which hung with the previous approach.
Relying on udev to properly process dm device creation makes some
assumptions about the flavour of udev available - until that is certain
disable udev sync support and have device-mapper control device creation
itself.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agopb-plugin: Update to chroot-style plugins
Jeremy Kerr [Fri, 7 Aug 2015 04:14:42 +0000 (12:14 +0800)]
pb-plugin: Update to chroot-style plugins

This change uses a chroot for all plugins, so that plugins have complete
flexibility with their libraries, dependencies and configuration.

We remove the 'install' action, as we simply run the plugin once.
Running involves extracting the archive, setting up a root filesystem,
and running a chroot.

To simplify plugin discovery behaviour, we standardise the plugin file
to be at pb-plugin.conf of attached devices, and read the metadatafile
straight out of the archive.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoMake read-only guarantee user-settable
Samuel Mendoza-Jonas [Wed, 6 May 2015 07:03:30 +0000 (17:03 +1000)]
Make read-only guarantee user-settable

Create a new Petitboot option 'petitboot,write?' that specifies whether
the system is allowed to mount devices read-write. The option can be
toggled by the user in the nc-config screen.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Mount snapshots for all eligible disk devices
Samuel Mendoza-Jonas [Wed, 13 May 2015 07:06:01 +0000 (17:06 +1000)]
discover: Mount snapshots for all eligible disk devices

Device-mapper snapshots are created for all disk devices prior to
being mounted. If explicit writes are made to the snapshot they are
merged back to the disk once write access is released.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Support creation of device-mapper devices
Samuel Mendoza-Jonas [Wed, 13 May 2015 06:46:08 +0000 (16:46 +1000)]
discover: Support creation of device-mapper devices

Add discover/dm-snapshot that allows the creation of device-mapper
snapshots that support merging changes back to disk.

Device-mapper snapshots are a CoW device backed by a ramdisk, mirroring
the contents of a source device. No changes are made to the original
disk unless an explicit merge action is performed. This guarantees
read-only mounting of host disks even when writes could implicitly
occur, eg. when performing recovering a journaled filesystem.

In the event that writing back to the disk is desired, such as when
updating grubenv, the changes made to the snapshot can be merged back to
the source disk.

This patch adds support but does not change functionality.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Keep track of available ramdisk devices
Samuel Mendoza-Jonas [Wed, 13 May 2015 06:45:42 +0000 (16:45 +1000)]
discover: Keep track of available ramdisk devices

Store information on available ramdisk devices when they are recognised
by udev, and add functions to 'reserve' and 'release' these devices.

This will be used to associate device-mapper snapshots with a backing
ramdisk in a following patch.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Ensure destroy_device is called on reinit
Samuel Mendoza-Jonas [Thu, 21 May 2015 06:30:07 +0000 (16:30 +1000)]
discover: Ensure destroy_device is called on reinit

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agopo: Translation updates for autoboot/ipmi changes
Samuel Mendoza-Jonas [Tue, 28 Jul 2015 04:56:07 +0000 (14:56 +1000)]
po: Translation updates for autoboot/ipmi changes

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Layout tweaks for boot order interface
Jeremy Kerr [Fri, 26 Jun 2015 04:06:33 +0000 (12:06 +0800)]
ui/ncurses: Layout tweaks for boot order interface

This change implements a few minor tweaks for the bootorder layout
interface:

 - make the verical spacing of widgets more consistent (we have
   a couple of 3-line gaps)

 - use a consistent 2-space gap between buttons on the same line

 - clarify the title text for the subset widget instance, and
   move the select widget closer to the title

 - use consistent title-case for widget labels

 - left-align the select & button widgets on the subset screen, for
   consistency with other screens

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover: Fix raw string argument to talloc_asprintf_append
Jeremy Kerr [Fri, 26 Jun 2015 03:41:46 +0000 (11:41 +0800)]
discover: Fix raw string argument to talloc_asprintf_append

Current builds give a warning:

  ../discover/platform-powerpc.c: In function ‘update_bootdev_config’:
  ../discover/platform-powerpc.c:667:4: warning: format not a string
  literal and no format arguments [-Wformat-security]
      tmp = val = talloc_asprintf_append(val, boot_str);
          ^

This change uses "%s" for the format string.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoMerge remote-tracking rbanch sammj/master
Jeremy Kerr [Fri, 26 Jun 2015 03:36:19 +0000 (11:36 +0800)]
Merge remote-tracking rbanch sammj/master

Conflicts:
discover/platform-powerpc.c
discover/ipmi.h

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoui/ncurses: Properly reposition cursor after menu update
Samuel Mendoza-Jonas [Mon, 20 Apr 2015 07:12:04 +0000 (17:12 +1000)]
ui/ncurses: Properly reposition cursor after menu update

The currently selected item in the main menu can be set to an item off
the visible portion of the menu after the additional or removal of a
boot option. Update the currently selected item and/or the current view
such that the item remains in the visible area.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Toggle visibility of timeout help label
Samuel Mendoza-Jonas [Fri, 8 May 2015 03:42:00 +0000 (13:42 +1000)]
ui/ncurses: Toggle visibility of timeout help label

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Fix whitespace in discover_handler_conf
Samuel Mendoza-Jonas [Thu, 30 Apr 2015 06:38:31 +0000 (16:38 +1000)]
discover: Fix whitespace in discover_handler_conf

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Display devices currently being parsed
Samuel Mendoza-Jonas [Thu, 30 Apr 2015 04:38:43 +0000 (14:38 +1000)]
discover: Display devices currently being parsed

Send a short message to the UI to inform the user a device is being
parsed for boot options. This helps slightly in environments when the UI
appears well before devices are available for parsing, giving the user
an indication that work is still being done.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Clear default-boot-device when invalidated
Samuel Mendoza-Jonas [Thu, 9 Apr 2015 05:27:01 +0000 (15:27 +1000)]
discover: Clear default-boot-device when invalidated

Update the clear_ipmi_bootdev functions to optionally invalidate the
next- or default-boot-device for their respective machines.
If a client invalidates the ipmi_bootdev in the config, invalidate the
respective bootdev.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Display current ipmi bootdev settings
Samuel Mendoza-Jonas [Tue, 6 Jan 2015 02:35:11 +0000 (13:35 +1100)]
ui/ncurses: Display current ipmi bootdev settings

Display the current IPMI bootdev override if it exists, and allow the
user to clear it from the configuration screen.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agolib: Move ipmi_bootdev enum to types.h
Samuel Mendoza-Jonas [Tue, 7 Apr 2015 23:45:43 +0000 (09:45 +1000)]
lib: Move ipmi_bootdev enum to types.h

Move the ipmi_bootdev definition to types.h to support returning
descriptive strings to the system configuration UI.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Update config screen help text
Samuel Mendoza-Jonas [Thu, 29 Jan 2015 05:06:38 +0000 (16:06 +1100)]
ui/ncurses: Update config screen help text

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agopetitboot: Implement ordered boot options
Samuel Mendoza-Jonas [Wed, 21 Jan 2015 05:12:14 +0000 (16:12 +1100)]
petitboot: Implement ordered boot options

Move petitboot to a more familiar 'boot-order' based autoboot system.
The discover server now reads multiple values from the petitboot,bootdev
parameter and adds them in order to config->autoboot_opts. Boot priority
is determined by the options' position in the list.
On the client, nc-config now recognises the new boot order, and allows
the user to add, remove, and reorder the devices in the list.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Use sorted field navigation
Samuel Mendoza-Jonas [Wed, 21 Jan 2015 04:25:15 +0000 (15:25 +1100)]
ui/ncurses: Use sorted field navigation

Changing the visual order of widgets will cause their associated fields to be
out of order relative to the widgetset field array. Rather than manually
resorting the array, use sorted navigation to move according to a field's
visual positon

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Add nc-subset selection screen
Samuel Mendoza-Jonas [Wed, 21 Jan 2015 03:48:38 +0000 (14:48 +1100)]
ui/ncurses: Add nc-subset selection screen

The nc-subset screen is intended to be used as a sub-screen from the
current screen (eg. nc-config) which passes a pointer to a
nc_widget_subset struct. The nc-subset screen allows the user to select
an option from a list of 'inactive' options, before returning control
back to the current screen.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Add nc_widget_subset
Samuel Mendoza-Jonas [Wed, 21 Jan 2015 03:45:47 +0000 (14:45 +1100)]
ui/ncurses: Add nc_widget_subset

The new nc_widget_subset is similar to nc_widget_select, but hides added
options until they are made active. This allows the widget to have
multiple options selected and ordered without cluttering the screen.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Add support for multiple bootdev arguments
Samuel Mendoza-Jonas [Wed, 21 Jan 2015 04:30:20 +0000 (15:30 +1100)]
discover: Add support for multiple bootdev arguments

To support multiple autoboot options while retaining backwards
compatability, interpret the petitboot,bootdev parameter as
optionally having several space-separated values.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agolib: Define autoboot_options, device_type helpers
Samuel Mendoza-Jonas [Mon, 15 Dec 2014 03:57:35 +0000 (14:57 +1100)]
lib: Define autoboot_options, device_type helpers

Add the new autoboot_option struct, and helper functions for working
with device_type enums. device_type_name() returns exact strings as used
by platform code to read/write nvram params, so
device_type_display_name() is added for use in user-visible strings.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Set OS Boot sensor with 0xa9
Joel Stanley [Thu, 30 Apr 2015 06:02:03 +0000 (16:02 +1000)]
discover: Set OS Boot sensor with 0xa9

If we don't set all the things, we only get an assertion event, without
the state being asserted.

Despite the IPMI spec suggesting we only needed to set 0x10, aka the
assertion bits, testing reveals we want to set all of the things to
cause the BMC to assert the state.

Tested-by: Nick Bofferding <bofferdn@us.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover: Set OS Boot sensor with 0xa9
Joel Stanley [Thu, 30 Apr 2015 06:02:03 +0000 (16:02 +1000)]
discover: Set OS Boot sensor with 0xa9

If we don't set all the things, we only get an assertion event, without
the state being asserted.

Despite the IPMI spec suggesting we only needed to set 0x10, aka the
assertion bits, testing reveals we want to set all of the things to
cause the BMC to assert the state.

Tested-by: Nick Bofferding <bofferdn@us.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover/platform-powerpc: Set IPMI OS boot sensor
Joel Stanley [Tue, 21 Apr 2015 06:17:57 +0000 (16:17 +1000)]
discover/platform-powerpc: Set IPMI OS boot sensor

This is to indicate to a BMC that we have initiated OS boot.

This patch manually parses the device tree for the sensor information.
In the future this could be replaced by libfdt or similar.

Discover the id of your OS Boot sensor:

$ sudo ipmitool sensor get "OS Boot"
Locating sensor record...
Sensor ID              : OS Boot (0x5a)
 Entity ID             : 35.0 (Operating System)
 Sensor Type (Discrete): OS Boot (0x1f)
 Sensor Reading        : 0h
 Event Message Control : Per-threshold
 Assertion Events      : OS Boot
                         [boot completed - device not specified]
 Assertions Enabled    : OS Boot
                         [A: boot completed]
                         [C: boot completed]
                         [PXE boot completed]
                         [Diagnostic boot completed]
                         [CD-ROM boot completed]
                         [ROM boot completed]
                         [boot completed - device not specified]
                         [Installation started]
                         [Installation completed]
                         [Installation aborted]
                         [Installation failed]
 OEM                   : 0

In this case it is 0x1f. Note that the sesnor is currently asserted iwth boot
completed - device not specified.

Test by clearing all assertions in the OS Boot sensor:

$ sudo ipmitool raw 0x04 0x30 0x5a 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
$ sudo ipmitool sensor get "OS Boot"
Locating sensor record...
Sensor ID              : OS Boot (0x5a)
 Entity ID             : 35.0 (Operating System)
 Sensor Type (Discrete): OS Boot (0x1f)
 Sensor Reading        : 0h
 Event Message Control : Per-threshold
 Assertions Enabled    : OS Boot
                         [A: boot completed]
                         [C: boot completed]
                         [PXE boot completed]
                         [Diagnostic boot completed]
                         [CD-ROM boot completed]
                         [ROM boot completed]
                         [boot completed - device not specified]
                         [Installation started]
                         [Installation completed]
                         [Installation aborted]
                         [Installation failed]
 OEM                   : 0

Then reboot your system. The assertion event should once more say "boot
completed - device not specified".

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoui/ncurses: Define Home, End, and Page Up/Down keys
Samuel Mendoza-Jonas [Thu, 16 Apr 2015 01:53:20 +0000 (11:53 +1000)]
ui/ncurses: Define Home, End, and Page Up/Down keys

9 years agodiscover/platform-powerpc: Set IPMI OS boot sensor
Joel Stanley [Tue, 21 Apr 2015 06:17:57 +0000 (16:17 +1000)]
discover/platform-powerpc: Set IPMI OS boot sensor

This is to indicate to a BMC that we have initiated OS boot.

This patch manually parses the device tree for the sensor information.
In the future this could be replaced by libfdt or similar.

Discover the id of your OS Boot sensor:

$ sudo ipmitool sensor get "OS Boot"
Locating sensor record...
Sensor ID              : OS Boot (0x5a)
 Entity ID             : 35.0 (Operating System)
 Sensor Type (Discrete): OS Boot (0x1f)
 Sensor Reading        : 0h
 Event Message Control : Per-threshold
 Assertion Events      : OS Boot
                         [boot completed - device not specified]
 Assertions Enabled    : OS Boot
                         [A: boot completed]
                         [C: boot completed]
                         [PXE boot completed]
                         [Diagnostic boot completed]
                         [CD-ROM boot completed]
                         [ROM boot completed]
                         [boot completed - device not specified]
                         [Installation started]
                         [Installation completed]
                         [Installation aborted]
                         [Installation failed]
 OEM                   : 0

In this case it is 0x1f. Note that the sesnor is currently asserted iwth boot
completed - device not specified.

Test by clearing all assertions in the OS Boot sensor:

$ sudo ipmitool raw 0x04 0x30 0x5a 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
$ sudo ipmitool sensor get "OS Boot"
Locating sensor record...
Sensor ID              : OS Boot (0x5a)
 Entity ID             : 35.0 (Operating System)
 Sensor Type (Discrete): OS Boot (0x1f)
 Sensor Reading        : 0h
 Event Message Control : Per-threshold
 Assertions Enabled    : OS Boot
                         [A: boot completed]
                         [C: boot completed]
                         [PXE boot completed]
                         [Diagnostic boot completed]
                         [CD-ROM boot completed]
                         [ROM boot completed]
                         [boot completed - device not specified]
                         [Installation started]
                         [Installation completed]
                         [Installation aborted]
                         [Installation failed]
 OEM                   : 0

Then reboot your system. The assertion event should once more say "boot
completed - device not specified".

Signed-off-by: Joel Stanley <joel@jms.id.au>
9 years agoutils/pb-console: establish PATH before running pb-config
Jeremy Kerr [Tue, 14 Apr 2015 06:23:36 +0000 (16:23 +1000)]
utils/pb-console: establish PATH before running pb-config

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover: Initialise strtok_r saveptr to NULL
Samuel Mendoza-Jonas [Fri, 10 Apr 2015 05:57:34 +0000 (15:57 +1000)]
discover: Initialise strtok_r saveptr to NULL

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoMerge remote-tracking branch 'sammj/master'
Jeremy Kerr [Tue, 14 Apr 2015 05:36:38 +0000 (15:36 +1000)]
Merge remote-tracking branch 'sammj/master'

9 years agodiscover/platform-powerpc: Fix logic for persistent IPMI boot settings
Jeremy Kerr [Thu, 2 Apr 2015 09:59:30 +0000 (17:59 +0800)]
discover/platform-powerpc: Fix logic for persistent IPMI boot settings

We should only clear the IPMI bootdev if the setting *isn't* persistent.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agoutils/pb-plugin: Add pb-plugin script
Jeremy Kerr [Mon, 23 Mar 2015 05:58:57 +0000 (13:58 +0800)]
utils/pb-plugin: Add pb-plugin script

Add a little script for downloading and/or extracting a plugin into a
petitboot environment

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover: Mount with norecovery, avoid rw mount of XFS filesystems
Samuel Mendoza-Jonas [Mon, 23 Mar 2015 05:54:45 +0000 (16:54 +1100)]
discover: Mount with norecovery, avoid rw mount of XFS filesystems

Journaled filesytems may still write to their disk even if the disk is
mounted read only. Petitboot should avoid modifying any disks
automatically, and in mixed-endian systems this can also cause journal
operations to fail. Use the 'norecovery' option on filesystems that
support it to skip the journal replay.

Additionally, mounting an XFS filesystem as read-write in such a case
will cause the call to mount to hang indefinitely. Avoid this generally
by explicitly unmounting and (re)mounting when mounting read-write.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover: Recognise renamed network interfaces
Samuel Mendoza-Jonas [Wed, 4 Mar 2015 02:40:05 +0000 (13:40 +1100)]
discover: Recognise renamed network interfaces

Udev may change the name of network interfaces if persistent interface
naming is used. It is important to recognise this since udev may re-use
the old name for a different interface.
If we receive an RTM_NEWLINK message for an existing interface, check if
the name has been updated.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Reduce unnecessary calls to redrawwin
Samuel Mendoza-Jonas [Wed, 4 Feb 2015 01:02:23 +0000 (12:02 +1100)]
ui/ncurses: Reduce unnecessary calls to redrawwin

All current *_post() methods in ui/ncurses call redrawwin() and
wrefresh() together. wrefresh() updates any lines on the screen that
have been marked as changed or invalid. However redrawwin() marks the
entire screen as invalid unconditionally. We can reduce the amount of
data written to the screen by avoiding calls to redrawwin().

Screen transitions are the primary use case of redrawwin(), where the
whole screen must be invalidated to avoid stale data remaining on
screen. All other 'in-screen' updates such as changes to widgets or
changing focus do not require a call to redrawwin(). The most noticeable
performance improvement is in nc-menu, which makes an unnecssary call to
redrawwin() after every addition to the boot option menu.

eg. The number of bytes written to STDOUT in the main menu:
# Boot options | Before | After
--------------------------------
8 | 5488   | 1149
133 | 422454 | 4652

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agoui/ncurses: Prevent creation of empty boot entry
Samuel Mendoza-Jonas [Mon, 2 Feb 2015 05:50:13 +0000 (16:50 +1100)]
ui/ncurses: Prevent creation of empty boot entry

A boot option requires an image path at minimum. If an option is
created without an image, trying to edit the resulting user item causes
a segfault. Prevent the user from creating a boot option without at
least an image path.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
9 years agodiscover/platform: rename finalise_config hook
Jeremy Kerr [Tue, 27 Jan 2015 06:38:55 +0000 (14:38 +0800)]
discover/platform: rename finalise_config hook

We want to expand the finalise_config hook to cover generic pre-boot
functionality, so rename to pre_boot.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover/platform-powerpc: Implement direct IPMI interface
Jeremy Kerr [Mon, 15 Dec 2014 01:47:39 +0000 (09:47 +0800)]
discover/platform-powerpc: Implement direct IPMI interface

This change adds a direct IPMI interface to the /dev/ipmi0 device node,
which is present on OpenPower machines.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover: Integrate ipmi bootdev settings into the priority system
Jeremy Kerr [Thu, 11 Dec 2014 08:38:21 +0000 (16:38 +0800)]
discover: Integrate ipmi bootdev settings into the priority system

Currently, we expose the boot device priorities through an array in
struct config, which will either be the default (network -> disk), or a
single device type specified by the IPMI code.

Rather than hide the implementation details in this array, we'd like to
expose the details of the machine configuration instead. This allows
user visibility of the real boot configuration (for example, if an IPMI
boot preference is set).

This change removes the priority array, and replaces it with the
ipmi_bootdev data (and a persistent flag). We update the
default-conflict-resolution code to reflect the priorities between IPMI
and UUID preferences.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover/powerpc: Separate ipmi bootdev handling into separate functions
Jeremy Kerr [Tue, 2 Dec 2014 07:04:38 +0000 (15:04 +0800)]
discover/powerpc: Separate ipmi bootdev handling into separate functions

We'd like to add a new backend to the bootdev storage, so move the
common bootdev-handling code into separate functions, moving
ipmi_bootdev_is_valid to ipmi.c.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover: Add ipmi module
Jeremy Kerr [Mon, 8 Dec 2014 06:39:14 +0000 (14:39 +0800)]
discover: Add ipmi module

Move our IPMI-specific definitions to a separate header, and a
mostly-empty ipmi.c file. We'll populate this with IPMI functionality in
later changes.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover/grub2: Allow unset and invalid defaults
Jeremy Kerr [Thu, 11 Dec 2014 01:42:58 +0000 (09:42 +0800)]
discover/grub2: Allow unset and invalid defaults

If the default environment variable is unset or invalid (i.e.,
references a non-existent boot option), then GRUB2 will fallback to the
first boot option present. This is preventing petitboot from autobooting
where no default is explicitly set, or is stale.

This change adds this fallback behaviour to petitboot. Because we don't
know if the first option will be a default at parse time (as no other
options matched the default env var), we need to keep options in a list,
and register them with the discover server once the parse is complete.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover/pxe: Format IPAPPEND mac addresses correctly
Samuel Mendoza-Jonas [Wed, 3 Dec 2014 04:08:23 +0000 (15:08 +1100)]
discover/pxe: Format IPAPPEND mac addresses correctly

The SYSAPPEND/IPAPPEND option 2 in PXE configs requires
the MAC address of the booting interface to be appended
to the boot options. Previously we formatted this as

"BOOTIF=01:02:03:04:05:06",

but syslinux/pxelinux implementation use this format:

"BOOTIF=01-01-02-03-04-05-06",

where the leading '01' represents the hardware type.

The relevant part of the pxelinux doc is at:

http://www.syslinux.org/wiki/index.php/SYSLINUX#SYSAPPEND_bitmask

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotest/parser: Add SLES btrfs snapshot stanza
Jeremy Kerr [Mon, 1 Dec 2014 03:59:20 +0000 (11:59 +0800)]
test/parser: Add SLES btrfs snapshot stanza

This has caused problems with the old delimiter code, add a test to
ensure we don't regress.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover/grub2: improve handling of word & delimiter tokens
Jeremy Kerr [Mon, 1 Dec 2014 03:47:16 +0000 (11:47 +0800)]
discover/grub2: improve handling of word & delimiter tokens

Currently, the delimiter token handling is a little fragile: we try to
ignore non-inter-word delimiters in the lexer with a selective set of
regexes on the possible delimiter characters.

This means we don't need to handle potential delimiters in every grammar
rule, but there are other situations (not regex-able) where we may see
delimters, and this will cause a parse error.

Instead of relying on the regex behaviour, we have an 'inter_word' flag,
which is set when we see the first word token, and cleared when we see
an end-of-line token. We only emit TOKEN_DELIM when this flag is set.

This means that we only get the delim tokens when they're required -
when we're looking for word separators (becuase WORD DELIM WORD is
distinct from WORD WORD - eg "linux /vmlinux" and "x$var").

We add a few new tests for the "menuentry" and "if" syntax, with
different delimiter configurations.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agotest/parser: Add dependency on libpbcore.la
Jeremy Kerr [Fri, 28 Nov 2014 03:44:03 +0000 (11:44 +0800)]
test/parser: Add dependency on libpbcore.la

Currently, build only a test object will fail:

  [jk@pablo obj]$ make ./test/parser/test-grub2-single

    CCLD     test/parser/test-grub2-single
  libtool: link: cannot find the library `lib/libpbcore.la' or unhandled argument `lib/libpbcore.la'

We're adding this to the link argument, but not as a dependency. This
change adds the dependency.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agolib/fold: fix warning with -DDEBUG
Jeremy Kerr [Fri, 28 Nov 2014 03:42:06 +0000 (11:42 +0800)]
lib/fold: fix warning with -DDEBUG

When compiling the fold code with DEBUG defined, we get:

../lib/fold/fold.c: In function 'fold_text':
../lib/fold/fold.c:37:3: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
   assert(bytes >= 0);
   ^

We should be comparing with != (size_t)-1, not >= 0

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
9 years agodiscover/grub2: fix incorrect prototype in yyerror
Jeremy Kerr [Fri, 28 Nov 2014 03:40:05 +0000 (11:40 +0800)]
discover/grub2: fix incorrect prototype in yyerror

Because we're using two parse-params, we need to add the scanner
argument to yyerror.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoui/ncurses: Properly size buttons in boot option editor
Samuel Mendoza-Jonas [Sun, 12 Oct 2014 22:45:04 +0000 (09:45 +1100)]
ui/ncurses: Properly size buttons in boot option editor

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agopo: Translation Updates
Samuel Mendoza-Jonas [Mon, 13 Oct 2014 00:04:58 +0000 (11:04 +1100)]
po: Translation Updates

Including "Network Interfaces", "up" and "down", and other minor updates

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agoui/ncurses: Expand width of pad
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 03:03:49 +0000 (14:03 +1100)]
ui/ncurses: Expand width of pad

Widgets running over the horizontal width of the pad will cause the
screen to blank. Expand the (non-viewable) size of the pad to prevent
blanking until shorter translations are available for nc-config.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agoui/ncurses: Warn if widget runs over horizontal pad width
Samuel Mendoza-Jonas [Fri, 3 Oct 2014 04:37:20 +0000 (14:37 +1000)]
ui/ncurses: Warn if widget runs over horizontal pad width

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agoui/ncurses: Properly size cancel and help buttons
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 02:49:30 +0000 (13:49 +1100)]
ui/ncurses: Properly size cancel and help buttons

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agoui/ncurses: Dynamically align text fields in nc-config
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 02:40:47 +0000 (13:40 +1100)]
ui/ncurses: Dynamically align text fields in nc-config

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agopo: Minor Russian translation updates
Samuel Mendoza-Jonas [Wed, 8 Oct 2014 00:56:06 +0000 (11:56 +1100)]
po: Minor Russian translation updates

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agodiscover/platform: Add finalise_config_hook
Jeremy Kerr [Mon, 29 Sep 2014 23:23:22 +0000 (09:23 +1000)]
discover/platform: Add finalise_config_hook

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agopo: French translation updates
Samuel Mendoza-Jonas [Tue, 30 Sep 2014 00:20:40 +0000 (10:20 +1000)]
po: French translation updates

Shorten strings in labels and help text for nc-config.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agoui/ncurses: Adjust position of add-url field to fit translated label
Samuel Mendoza-Jonas [Mon, 22 Sep 2014 06:05:07 +0000 (16:05 +1000)]
ui/ncurses: Adjust position of add-url field to fit translated label

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agoui/ncurses: Expand cancel & help button width
Samuel Mendoza-Jonas [Tue, 23 Sep 2014 07:32:35 +0000 (17:32 +1000)]
ui/ncurses: Expand cancel & help button width

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agopo: translation updates
Samuel Mendoza-Jonas [Tue, 23 Sep 2014 07:25:33 +0000 (17:25 +1000)]
po: translation updates

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
10 years agotests/lib/test-fold: Add mbs test with separators
Jeremy Kerr [Tue, 23 Sep 2014 07:07:14 +0000 (15:07 +0800)]
tests/lib/test-fold: Add mbs test with separators

Ensure we're doing the correct thing with mbs + separators in the fold
code.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agolib/fold: Add support for multibyte strings
Jeremy Kerr [Tue, 23 Sep 2014 06:46:06 +0000 (14:46 +0800)]
lib/fold: Add support for multibyte strings

Currently, the fold_text function doesn't understand multibyte strings,
so may break a line in the middle of a multibyte sequence.

This change adds multibyte-awareness to the fold code, and uses proper
width calculations for the contents of the folded string.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoui/ncurses: Fix unstranslated strings in sysinfo screen
Jeremy Kerr [Fri, 19 Sep 2014 01:07:36 +0000 (09:07 +0800)]
ui/ncurses: Fix unstranslated strings in sysinfo screen

We have a couple of strings that are missing the gettext call.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodiscover/platform-powerpc: Read language configuration from NVRAM
Jeremy Kerr [Thu, 18 Sep 2014 14:13:27 +0000 (22:13 +0800)]
discover/platform-powerpc: Read language configuration from NVRAM

Implement load & save of the petitboot language configuration.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agoui/ncurses: Fix clearing a boot device UUID
Jeremy Kerr [Thu, 18 Sep 2014 11:21:00 +0000 (19:21 +0800)]
ui/ncurses: Fix clearing a boot device UUID

Currently, we have a bug where we can't clear a boot device UUID, as we
only update config->boot_device if we're in AUTOBOOT_ONE state. This
means that the config UI can't be used to change out of "autoboot from a
single device" mode.

This sets the autoboot device unconditionally, allowing it to be
cleared.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agodiscover/platform: Add boot device to config dump
Jeremy Kerr [Thu, 18 Sep 2014 11:18:32 +0000 (19:18 +0800)]
discover/platform: Add boot device to config dump

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10 years agopo: Add initial translations
Jeremy Kerr [Fri, 29 Aug 2014 08:33:51 +0000 (16:33 +0800)]
po: Add initial translations

Add the initial translation set for de, en, es, fr, it, ja, ko, pt_BR,
ru, zh_CN and zh_TW languages.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>