summaryrefslogtreecommitdiffstats
path: root/discover/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* Add support for GPG signature enforcement on bootedtpearson@raptorengineering.com2016-08-261-1/+2
| | | | | | | | | | | | | kernels and related blobs This can be used to implement a form of organization-controlled secure boot, whereby kernels may be loaded from a variety of sources but they will only boot if a valid signature file is found for each component, and only if the signature is listed in the /etc/pb-lockdown file. Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> (Minor build fixes and gpgme.m4, comment on secure boot in gpg.c)
* configure.ac: Add checks for libflash and libdevmapperSamuel Mendoza-Jonas2016-04-051-1/+1
| | | | | | | | | libdevmapper is a hard dependency since snapshots were introduced, so add an unconditional configure-time check for it. Also add a check for libflash library and headers if --enable-mtd is set. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Display VERSION partition info on BMC machinesSamuel Mendoza-Jonas2016-02-091-0/+14
| | | | | | | | | | On supported platforms read the VERSION partition on startup and display the available versions strings in the System Information screen. This adds a skeleton hostboot.c to support possible additional BMC platform support. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* discover: Support creation of device-mapper devicesSamuel Mendoza-Jonas2015-08-061-0/+6
| | | | | | | | | | | | | | | | | | | 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>
* discover/platform-powerpc: Set IPMI OS boot sensorJoel Stanley2015-04-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* discover: Add ipmi moduleJeremy Kerr2014-12-151-0/+2
| | | | | | | | 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>
* lib: Move generic file-handling code to lib/Jeremy Kerr2014-08-051-5/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Move platform config to a .roJeremy Kerr2014-08-051-3/+10
| | | | | | | We want to allow an external utility to use the platform config code, so build it into a .ro, which is then linked to the discover code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Don't link udev into everythingJeremy Kerr2014-08-051-3/+2
| | | | | | | | By default, AC_CHECK_LIB will append to $LIBS, which is used for all link stages. Intstead, we should popuate $UDEV_LIBS, and just use that for the single pb-discover link stage. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Use non-recursive makeJeremy Kerr2014-08-011-60/+54
| | | | | | | | | | | | 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>
* discover: Add setlocale calls in discover serverJeremy Kerr2014-07-281-1/+3
| | | | | | | | We want the discover server to respect the configured language, so we'll need to add appropriate setlocale() calls. We use the config->lang setting to use any previously-saved language. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pb-config: Move config storage modules to "platform" modules in discover codeJeremy Kerr2014-01-301-0/+3
| | | | | | | | | | | | | | | | | | There's no need to include the config storage code in lib/ as only the discover server should be using it. This change moves the config-storage code to discover/, with the platform-specific parts moved to a 'struct platform'. Each platform has a probe function, which is called during init. The first probe function to return a platform is used. At present we only have the one platform, but it's now non-intrusive to add others. We keep an array of platform pointers in a separate ("platforms") section, to allow the test module to drop-in its own test "platform". Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Fix CDROM handlingJeremy Kerr2013-12-021-0/+2
| | | | | | | | | | | | | Currently, we don't handle CDROM devices well; we'll try to mount on boot, and not detect any media changes. Also, the default rules shipping with udev will put the CDROM tray into a locked state, blocking eject from working. This change adds a set of cdrom utility functions, which the udev code can use to properly initialise cdrom devices and handle eject and media change requests. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/sysinfo: Add helper script to populate sysinfo identifiersJeremy Kerr2013-10-091-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add system info messagesJeremy Kerr2013-10-091-0/+2
| | | | | | | | Add a little infrastructure for communicating information about the system to the petitboot UIs. We just send some identifying info (type and identifier), as well as the interfaces. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Hook up flex/bison parser to discover serverJeremy Kerr2013-09-241-2/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Remove unnecessary event passingJeremy Kerr2013-09-191-1/+0
| | | | | | | | | | | | | | | Currently, we pass "events" between the udev, user-event and device-handler layers. These events all get sent through device_handler_event, then de-multiplexed to an appropriate handler, depending on their source. Instead, just export relevant device_handler functions, and have the (old) event sources call these functions directly. This also means we can include a lot more of the device hander code in the parser tests. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: separate file-reading code into file.cJeremy Kerr2013-08-081-0/+2
| | | | | | | We'll need to read files in the network config code, so add a 'file' object, containing the read_file function. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: remove libparser objectJeremy Kerr2013-08-081-21/+14
| | | | | | | | There's no real need for a separate libparser object. Our tests pull-in the parsers directly, and the discover server is the only thing that actually links to libparser.ro. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* automake: Add $(EXEEXT) to .ro objectsGeoff Levand2013-07-231-1/+1
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Fix automake warningsGeoff Levand2013-06-301-4/+4
| | | | | | | | | | | | | Change the Makfile.am relocatable output files from automake _LIBRARIES to automake _PROGRAMS. Also, change the output file name extension from .o to .ro to better show these are relocatable files. Fixes automake warnings like these: discover/Makefile.am: `libparser.o' is not a standard library name discover/Makefile.am: did you mean `libparser.a'? Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add pkgsysconfdirJeremy Kerr2013-06-241-0/+3
| | | | | | We'll need a sysconf dir to store the boot hooks. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add network handlingJeremy Kerr2013-06-241-0/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Update udev routines to use libudevGeoff Levand2013-05-031-0/+2
| | | | | | | Support for 'RUN+="socket:' in udev rules files has been removed in udev version 183. Update the discover server to use libudev. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Add PXE parserJeremy Kerr2013-04-291-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsers: dynamically register parsersJeremy Kerr2013-04-291-7/+8
| | | | | | | | | | | | | | | Currently, we require all parsers to be defined in an array in parsers.c. This change removes this requirement, by introducting a register_parser() macro, which adds a constructor to register the parser with the core parser infrastructure. Because each parser no longer resolves an undefined symbol, we need to use a `ld -r` object for libparser, instead of using libtool, which creates a .a (and hence has no parsers included). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to emit resources rather than filenamesJeremy Kerr2013-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This change switches the parsers over to populate the resources in discover_boot_option, rather than the string parameters in boot_option. To do this, we need a few things: * Add struct resources to discover_boot_option for the boot_image, initrd and icon data. * Have the parsers populate the resources, rather than the strings. Currently, parsers can all use the devpath resource type. * Add a resolve_resource callback to parsers; this is how the device handler will attempt to resolve resources. * Change load_file to load_url, as we should be only accessing (resolved) resources by URLs. This then allows us to remove the mount map, and associated lookup code, as well as the UUID and label links to devices. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add devpath resourcesJeremy Kerr2013-04-291-0/+1
| | | | | | | | | Add a generic resource type, to handle "dev:path"-style file references. This creates a duplicate of is_prefix_ignorecase, which we'll switch over to later. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add struct resourceJeremy Kerr2013-04-291-0/+1
| | | | | | | | | | | | Introduce a new type, struct resource, for handling resources such as kernels and initrds. This allows the parsers to better describe resources that are required for booting. Firstly, we enforce all resources to be URLs, rather than local paths. Also, resources allow us to describe files devices that have not-yet been hotplugged. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Implement device handler boot pathJeremy Kerr2013-04-151-0/+2
| | | | | | | | | | This change adds a funtion, device_handler_boot, which processes the boot command message from the discover server. We add a new file, discover/boot.c (and a corresponding header) with a skeleton for the final kexec code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: remove unused message.h fileJeremy Kerr2013-03-051-1/+0
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add grub2 conf file parserGeoff Levand2012-03-181-0/+1
| | | | | | | | Add grub2 parser and sample config file. Reorder parser priorities: From (yaboot -> kboot) to (kboot -> grub2 -> yaboot). Signed-off-by: Geoff Levand <geoff@infradead.org>
* Convert test to automakeGeoff Levand2012-03-161-5/+9
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Move installed programs from bin to sbinGeoff Levand2012-02-241-1/+1
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Convert build to use automakeGeoff Levand2012-02-121-0/+58
Signed-off-by: Geoff Levand <geoff@infradead.org>
OpenPOWER on IntegriCloud