summaryrefslogtreecommitdiffstats
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
* hooks/add-offb: Add leading slash to HVC node pathsJeremy Kerr2016-08-081-1/+1
| | | | | | | | | | We need an absolute path to the serial@N device. It looks like some kernels aren't reading the current path correctly, leading to no console output. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Add 'sync' user eventSamuel Mendoza-Jonas2016-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | Add a user event named 'sync' that causes the discover server to merge the devicemapper snapshots of mounted devices. This is particularly useful as a debug aid (for example, when copying logs to a USB device), as the server will otherwise only sync changes to mounted devices in response to parser actions. The command can be called as pb-event sync@device to sync a particular device, or as pb-event sync@all to sync all devices with snapshots. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* utils/hooks: Set linux,stdout-path for primary consolev1.2.0Samuel Mendoza-Jonas2016-06-291-0/+120
| | | | | | | | If the boot_tty environment variable is set, determine which device path to set in the linux,stdout-path property, which will instruct the next kernel to use it as the primary console. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* utils: Add diagnostic scriptv1.1.0Samuel Mendoza-Jonas2016-05-243-1/+78
| | | | | | | | | | | | | | | | Add a simple script to gather up useful information in the unlikely event a user runs into trouble. Usage: pb-sos [-v] [-f file] [-d user@host:/path] Options -v verbose output -f file Supply filename for tar archive (default pb-sos.tar) -d host Supply user, hostname, and path to transfer archive to a remote host Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* pb-event: Add 'boot' user eventSamuel Mendoza-Jonas2016-05-061-1/+1
| | | | | | | | | | | Add a user event to send a boot command to the discover server. The format of the boot command is similar to the add command, eg: pb-event boot@eth0 image="http://host/image" initrd="http://host/initrd" and also recognises "id", "dtb", and "args" arguments. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* pb-console: Reduce kernel log output before starting UISamuel Mendoza-Jonas2016-05-061-0/+4
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* utils/hooks: Write offb device address to device treeSam Mendoza-Jonas2016-02-252-0/+501
| | | | | | | | | | | On OpenPOWER machines, kernels missing the AST video driver can use the existing 'Open Firmware' framebuffer device code to inherit an existing framebuffer from Petitboot. This requires us to translate the 64-bit address of the framebuffer 'back' into a PCI address and write it into an assigned-addresses property in the device tree. Bootstrapped-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* Merge branch 'pb-plugin' into masterSamuel Mendoza-Jonas2015-09-112-123/+453
|\ | | | | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
| * pb-plugin: Don't execute metadata filesJeremy Kerr2015-09-111-7/+25
| | | | | | | | | | | | | | Rather than sourcing a plugin's metadata file, explicitly parse variables. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Fix invalid command referenceJeremy Kerr2015-09-021-2/+2
| | | | | | | | | | | | | | 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>
| * pb-console: Always add plugins directory to PATHJeremy Kerr2015-09-021-1/+2
| | | | | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Add lint commandJeremy Kerr2015-09-021-41/+140
| | | | | | | | | | | | | | 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>
| * pb-plugin: Implement plugin ABI versioningJeremy Kerr2015-09-021-1/+84
| | | | | | | | | | | | | | | | | | | | | | 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>
| * pb-plugin: Only require a fixed plugin extension, instead of full nameJeremy Kerr2015-09-021-51/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * pb-plugin: Move plugin wrappers to a separate dirJeremy Kerr2015-08-272-2/+4
| | | | | | | | | | | | Use /var/lib/pb-plugins/bin, to prevent overwriting system binaries. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * pb-plugin: Keep chroot persistent, and create wrapper scriptsJeremy Kerr2015-08-211-40/+54
| | | | | | | | | | | | | | | | | | | | | | 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>
| * pb-plugin: Update to chroot-style pluginsJeremy Kerr2015-08-071-93/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | discover: Add disable param for dm-snapshotsSamuel Mendoza-Jonas2015-08-181-0/+2
|/ | | | | | | 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>
* petitboot: Implement ordered boot optionsSamuel Mendoza-Jonas2015-05-051-1/+10
| | | | | | | | | | | 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>
* utils/pb-console: establish PATH before running pb-configJeremy Kerr2015-04-141-0/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-plugin: Add pb-plugin scriptJeremy Kerr2015-03-272-1/+514
| | | | | | | Add a little script for downloading and/or extracting a plugin into a petitboot environment Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add debug flag to configJeremy Kerr2014-08-054-13/+5
| | | | | | | | | | This change adds a debug flag to the config, and groups it under not-user-modifiable parts of struct config. This means we no longer need the pb-sysinfo helper, as the last remaining function (--debug-enabled) can be implemented with pb-config. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Use platform code to read sysinfo type and identifierJeremy Kerr2014-08-051-6/+0
| | | | | | | | | | | | | | | | This change uses the platform-specific code to read the system type and identifier, rather than the pb-sysinfo utility. We introduce a new callback for struct platform: int (*get_sysinfo)(struct platform *, struct system_info *); - which populates struct system_info with appropriate information. This means that the system-specific code is kept in one place; rather than having powerpc-specific device-tree-reading code in the pb-sysinfo shell script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils: Add pb-config utilityJeremy Kerr2014-08-052-2/+124
| | | | | | A simple tool to query platform configuration. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Use non-recursive makeJeremy Kerr2014-08-011-22/+11
| | | | | | | | | | | | With the current testing infrastructure, we don't have a strictly hierarchical set of dependencies. This causes problems with a recursive make, and means we have to hack around some of the dependencies. This change generates a single, top-level makefile from all of the Makefile.am fragments. We still need the po/ directory as a separate SUBDIR, but all others can be converted to non-recursive. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-console: use a linux termcap entry for local consolesJeremy Kerr2014-05-191-0/+7
| | | | | | For local consoles, we always want a TERM=linux. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* log: Allow runtime selection of 'debug' log levelJeremy Kerr2014-04-072-1/+14
| | | | | | | | | | | | | | | | | Currently, we need to compile with -DDEBUG to implement debug-level logging in the UIs and discover server. Since we may not be able to easily replace a system's petitboot binaries, this change introduces a -v|--verbose option to the discver server and ncurses UI, which enables debug at runtime. We also move some of the udev debug code out of an #ifdef DEBUG block. Since petitboot is generally started on boot, we also add a little infrastructure to pass -v to petitboot on certain system contitions: either petitboot.debug on the kernel command line, or a petitboot,debug? NVRAM property containing the value 'true'. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils: Add all hooks to MakefileJeremy Kerr2014-02-141-1/+3
| | | | | | We were missing a couple of the later hooks from the Makefile. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/hooks: Add dtb-sort hookJeremy Kerr2014-01-211-0/+12
| | | | | | | The boot hooks may have altered the DTB in various ways, so add a final (90-) boot hook to re-sort the dtb with `dtc -s`. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-udhcpc: Unify references to DHCP bootfile parameterJeremy Kerr2014-01-211-8/+10
| | | | | | | | | | | | | | udhcpc may pass the bootfile parameter as either $bootfile or $boot_file, depending on whether the option is present in the BOOTP header, or as a DHCP vendor option. We have code in pb-udhcpc to unify this to $bootfile, but we only use the unified value in one of the user events. This change uses the correct value of bootfile, and fixes the check to conditionally generate the explicit add event. We also need to update the user-event code to use the right event parameter name. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-udhcpc: Fix incorrect reference to $interfaceJeremy Kerr2014-01-201-2/+2
| | | | | | | | We have a typo in the udhcpc hook, where we're not referncing the interface variable correctly. This means we'll get the same device identifier for all netboot options. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-udhcpc: remove bashism when reading mac addressJeremy Kerr2014-01-201-1/+1
| | | | | | | The $(< FILE) syntax we use to read an interface's MAC address doesn't work in dash or busybox sh. Instead, use cat. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Support DHCP "pathprefix" configuration optionJeremy Kerr2014-01-171-1/+2
| | | | | | | | | | | | | | | | | This change implements support for the DHCP "pathprefix" option. We use the following logic: - If pathprefix is present and a full URL, we base the config file location on pathprefix + conffile - If pathprefix is present but not a full URL, we use it as the path component of the URL, and pick up the host from other parameters in the DHCP response - If no pathprefix is present, we determine the configuration prefix from the DHCP bootfile parameter. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils: Add boot hook to set stdout property on DT machinesJeremy Kerr2014-01-151-0/+23
| | | | | | | | | On machines that use device-tree boot, they'll often set an early console, defined by the linux,stdout property in the /chosen/ device tree node. This hook adds a facility for petitboot to set this, based on an NVRAM setting.
* configure: Use AC_GNU_SOURCEJeremy Kerr2013-12-181-1/+0
| | | | | | | Rather than #defining _GNU_SOURCE in our .c files, we can define this from config.h instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Use pxeconffile for udhcpc option nameJeremy Kerr2013-11-221-1/+1
| | | | | | | | | | | | The patch that went upstream for udhcpc's option 209 handling uses the option name 'pxeconffile' rather than 'conffile', and it was added as a non-default option: http://git.busybox.net/busybox/commit/?id=d3092c99ae90f This change uses the new name, and explicilty requests this option. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-console: Exit after running getty in detached stateJeremy Kerr2013-11-221-0/+1
| | | | | | ... otherwise we'll try and bring the UI up on the current tty too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-console: reset after UI exitJeremy Kerr2013-11-141-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to explicitly request configuration filesNeelesh Gupta2013-11-061-78/+25
| | | | | | | | | | | | | | | | | | | Add a new function parser_request_url() to read the data from configuration files present remotely. We deprecate iterate_parser_files() and download_config() functions along with the 'filenames' and 'method' members of the 'parser' structure so that individual parsers would now require to request the configuration files data from the parser code and doesn't necessarily export the list of configuration files. Add the support to handle incoming DHCP event, done by passing all the relevant environment variables of the udhcpc to the discover code. Also, update the pxe parser code to populate the list of configuration file names as per PXELINUX convention of fallback names using mac and ip addresses of the booting machine. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/sysinfo: Add helper script to populate sysinfo identifiersJeremy Kerr2013-10-092-1/+11
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-udhcp: Don't add a new option on renewJeremy Kerr2013-10-091-1/+1
| | | | | | Otherwise we'll keep collecting new options every $lease_time period. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-udhcpc: use plain kernel names for dhcp eventsJeremy Kerr2013-09-241-5/+5
| | | | | | No need to prefix with /net/ Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-udhcpc: Fix string returned from resolve_urlJeremy Kerr2013-09-061-0/+1
| | | | | | In the 'as-is' case, we were echoing both URLs. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-udhcp: Fix MAC-address-based configuration file locationJeremy Kerr2013-07-231-2/+2
| | | | | | | | We're currently requesting a colon-separated MAC address. Instead, we need it to be hypen-separated, and prefixed with the ethernet type ("01-"). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-udhcp: PXE fixesJeremy Kerr2013-07-231-5/+5
| | | | | | Fix a couple of bugs in the udhcp script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-console: Read /etc/environment and /etc/localeJeremy Kerr2013-07-231-0/+8
| | | | | | | Since we're starting from no environment on the consoles, allow specifying an initial environment. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/hooks: Add sample update-dtb hook.Jeremy Kerr2013-06-242-1/+24
| | | | | | Provide an example for writing a pre-boot hook to update the dtb. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/hooks: Add create-dtb hookJeremy Kerr2013-06-242-1/+13
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils: Add busybox reboot scriptJeremy Kerr2013-06-242-0/+4
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-console: use getty rather than execJeremy Kerr2013-05-201-31/+58
| | | | | | exec is a bit flaky for starting on consoles, so use getty instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud