388 Commits
Author SHA1 Message Date
William Douglas 9d43a074b4 v3.0.0 release v3.0.0 2018-06-21 17:55:10 +00:00
Murilo Belluzzo b05a3f49b3 Increase maximum size of 'type' field
In practice, the filename limit was overly small, this change allows
us to better describe the content of some kernels currently in use.

Signed-off-by: Murilo Belluzzo <murilo.belluzzo@intel.com>
2018-06-21 10:53:02 -07:00
Brett T. Warden 531ab87256 Cleanup vmlinux file
Cleanup /usr/lib/vmlinux-(version) files in /usr/lib/kernel.

Fixes #114
2018-06-14 12:44:14 -07:00
Ikey Doherty d06406b438 Completely remove deprecated bootloaders from clr-boot-manager
gummiboot hasn't been supported upstream or by Clear Linux for an age,
and due to format bumps no compatibility is required with it, thus it
can be completely removed from source.

goofiboot, the fork of gummiboot, was initially created to address concerns
in systemd-boot in their tooling. However, the concerns were mitigated by
opting to entirely bypass their tooling, and clr-boot-manager absorbed all
safety and distribution support that was part of libnica and goofiboot.

At this point, both of the legacy bootloaders are safe to be nuked from
orbit and are no longer used in CBM-using distributions.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2018-05-28 10:15:35 -07:00
William Douglas 225e2258e0 v2.1.1 release v2.1.1 2018-05-18 21:01:53 +00:00
William Douglas 412558f6f4 libnica: Sync with git master for nc_rm_rf fix
Update libnica submodule to use the latest changes that resolve a bug
with nc_rm_rf not removing directories with valid symlinks in all
cases.
2018-05-18 13:58:48 -07:00
William Douglas 2aba4168f8 Do freestanding initrd update before kernel update
To align with image mode update (and for the same reasons) move the
freestanding initrd update to before the kernel update. This prevents
creating an invalid kernel bootloader entry if there was a problem
with installing a freestanding initrd.
2018-05-15 09:55:02 -07:00
William Douglas 3a8a7ee243 Test update fails when missing freestanding initrd
Validate that update fails and kernels aren't installed when a
freestanding initrd is missing. This test ensures that an invalid boot
menu entry (due to it listing initrd files that do not exist) are not
installed when update fails.
2018-05-15 09:55:02 -07:00
William Douglas da87cb5ff5 Copy freestanding initrds in image mode
Copy freestand initrd files when cbm is run in image mode. Note the
initrd installation call happens prior to kernel install. This is done
as failure to install/update an initrd is fatal and if kernel install
happens before initrd install then an installed kernel could exist
with a configuration file referencing initrds that won't be available.
2018-05-15 09:55:02 -07:00
William Douglas 3ffaf5a658 Add test for freestanding initrds in image mode
Verify that freestanding initrds are installed correctly in image
mode.
2018-05-15 09:55:02 -07:00
Josue David Hernandez ef77136fe1 clr-boot-manager: add support for non-lvm root encryption
cbm_get_luks_uuid get the uuid of the decrypted root partition when this
is in a LVM partition this mean looking for the device information here:
/sys/block/dm-1/slaves/dm-0/slaves/sdb1/dev
without LVM the path would be this:
/sys/block/dm-1/slaves/sdb1/dev

Signed-off-by: Josue David Hernandez <josue.d.hernandez.gutierrez@intel.com>
2018-05-02 09:41:39 -07:00
William Douglas b4b86f1a21 v2.1.0 release v2.1.0 2018-03-27 18:36:33 +00:00
Josue David Hernandez a75a4ff927 clr-boot-manager: add support freestanding multi-initrd
add suport for freestanding initrd in /usr/lib/initrd.d
for systemd-boot, grub2 and syslinux

Signed-off-by: Josue David Hernandez <josue.d.hernandez.gutierrez@intel.com>
2018-03-27 11:27:31 -07:00
Josue David Hernandez 8ff196388a clr-boot-manager: update meson and ninja
meson 0.42.1 -> 0.44.1
ninja 1.6.0  -> 1.8.2

Signed-off-by: Josue David Hernandez <josue.d.hernandez.gutierrez@intel.com>
2018-03-27 11:27:31 -07:00
Caio Marcelo de Oliveira Filho 50cc4ea5f9 Fix name of shim-systemd bootloader 2018-01-24 16:41:13 -08:00
William Douglas dd5da5edcf Add documentation to man page for kernel configuration
Update man page to describe the use of the kernel configuration files
that can be modified by the system administrator to set the kernel
commandline.
2018-01-09 20:13:12 -08:00
Patrick McCarty 8d50896fca Remove file descriptor leak check
When clr-boot-manager (CBM) is forked/exec'd via swupd-client, file
descriptor leak checks are performed first by CBM, and then by
swupd-client.

However, not all file descriptors opened by swupd-client will be closed
during the exec of CBM, leading to CBM falsely reporting leaks for file
descriptors inherited from the parent process. In cases when CBM reports
valid leaks, swupd-client will later report them as well, making the CBM
reports extraneous.

Arguably, swupd-client should try to mark its open file descriptors
O_CLOEXEC, but at least one of the descriptors is managed by libcurl,
and no API exists to set O_CLOEXEC on it (as far as I know).

So, for now, remove the file descriptor leak here. Perhaps reintroduce
it later when more testing is implemented to ensure that relevant file
descriptors opened by CBM are not leaked.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-01-09 20:12:57 -08:00
Ikey Doherty 8ac564a8a8 Use the correct limits.h header
We should never directly include the linux headers, as the libc headers
should always suffice for this. For glibc, the headers should forward to
the linux kernel headers, however musl provides a self contained set of
headers that do not rely on the glibc-enabling linux headers.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-17 15:27:15 -08:00
Ikey Doherty cb5a213c51 libnica: Sync with git master for portability fixes
This change is required to allow portability changes for libnica, as
required to allow building against musl for static compilation.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-17 15:27:15 -08:00
Ikey Doherty 4e16afc05a Update gitmodules to point to the correct libnica origin
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-17 15:27:15 -08:00
William Douglas 1484ecbb70 v2.0.0 release v2.0.0 2017-11-09 18:27:41 +00:00
William Douglas 69fcff593a Whitespace fixup 2017-11-09 18:27:41 +00:00
Arzhan Kinzhalin de12c11965 Centralize version management. 2017-11-03 13:52:15 -07:00
Arzhan Kinzhalin 9903bea409 Drop kernel subdir from shim-systemd layout. 2017-11-03 12:12:05 -07:00
Arzhan Kinzhalin af90cbb10e Fix FAT/ESP name resolution in EFI bootloaders. 2017-11-03 11:33:10 -07:00
Arzhan Kinzhalin beeeadea78 Restore EFI paths in tests.
These paths are intentionally using incorrect/unexpected case. This
reverts the change made in 6cbfdbab.
2017-11-03 11:33:10 -07:00
Ikey Doherty cba2f74c8c Convert build system to meson
This change is designed to make it simpler to maintain clr-boot-manager
by switching to the much easier meson build system. Care is taken to
preserve the original functionality, but this will allow us to avoid
repeated issues of "failed distcheck", etc.

Additionally, a new test entry point is now included for Travis, to ensure
all relevant codepaths are properly tested. This now enables us to trivially
merge multiple runs into a single coverage report so that we can test the
code base in various "deployments".

To alleviate the issue of distributing without a `make distcheck` target,
this change vendors the `git-archive-all.sh` script into `scripts/` and
provides a port of the `budgie-desktop` `mkrelease.sh` script to quickly
and easily create a signed distribution tarball straight from git, along
with the submodules (i.e. nica).

Lastly, we'll only build the bootvar support + systemd-shim when we've
actually selected this bootloader, to ensure the project can still be built
without needing gnu-efi/efivar.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-11-01 13:09:31 -07:00
Arzhan Kinzhalin 6cbfdbab29 Fix kernel destination dir in systemd-boot.
kernel.c no longer creates any layout, but systemd-class was not
creating/ensuring kernel target directory either. This fixes the issue.

Also, tests are fixed to use proper ESP standard names throughout.
2017-11-01 00:05:43 -07:00
William Douglas b69f616cbe Remove clang-format use from travis
clang-format changes its output too much between versions to block
commits so go back to users being on their own for format following
the style rules.
2017-10-31 14:38:02 -07:00
Arzhan Kinzhalin 66f175587a Fix mem mgmt issues introduced by shim-systemd.
Refactor the API slightly to reflect the intended use of
get_kernel_destination() function of the bootloader.

Fix plain memory management issues.
2017-10-31 14:36:03 -07:00
William Douglas aba771b51c Update code syle documentation
Add details for if statement bracket use and function and variable
names.
2017-10-31 11:43:35 -07:00
Arzhan "kai" Kinzhalin c025f7178e Support for 2-stage loading via shim and systemd-boot
This change allows the installation of a shim when using systemd-boot as
the bootloader. It also enables the management of EFI variables to
manage the default boot device.

The shim will eventually become a required piece for secure-boot enabled
booting.
2017-10-31 11:42:17 -07:00
Brett T. Warden 75c8501c07 Fix spelling, punctuation
Fix error messages, including a misspelling, and inconsistent use of periods within individual messages.
2017-10-25 11:07:25 -07:00
William Douglas 81da1324fa v1.5.5 release v1.5.5 2017-10-18 17:30:37 +00:00
William Douglas ee88f6e6aa README fixups for repo move 2017-10-18 17:18:21 +00:00
Ikey Doherty 5a1f9d261b lib: Address upstream util-linux partlist regression
This fixes a segfault occuring within clr-boot-manager's usage of the
`blkid_partlist_numof_partitions` function that will now segfault when
passed a NULL blkid_partlist, as of util-linux 2.30.x series.

This change will ensure all consumers of the cbm_blkid API will continue to
function as before, but safe guard against the util-linux internal changes
that broke the counter function to determine how many partitions are present.

Note that this behaviour only manifested on LVM installations, which have
a more advanced probing scheme within clr-boot-manager.

Solus Issue: https://dev.solus-project.com/T4763

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-10-18 14:56:00 +01:00
Brett T. Warden e8c7070064 Fix typo in error message
Fix dermine->determine
2017-10-10 17:20:07 -07:00
Ikey Doherty 9bdd68d4c5 cmdline: Support vendor provided stateless fragments
This change introduces support for vendor kernel configuration fragments,
which typically live within the /usr/share/kernel/cmdline.d directory.
These are useful to vendors and OEMs to pre-enable some hardware quirks
such as acpi_os, i8042 tweaks, etc.

These files take a higher precedence than the /etc/ files, however to
ensure we abide by a proper stateless policy we allow the concept of masking
and disabling in the style of systemd. The files in the "vendor config"
directory are considered masked when a file with the same base name lives
within the "system config" (/etc/kernel/cmdline.d) tree. The vendor file
will be skipped regardless of system config validity in this instance.

To allow disabling entirely of the vendor config file, the local system
administrator may follow the masking approach as described as above, but
instead of creating a override, symlink this file to /dev/null. This will
cause the file to be removed entirely from any kind of parsing. This link
logic is only valid within the context of the system config directory.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-09-13 12:42:46 -07:00
Arzhan Kinzhalin a4048569a7 Fix the end of string condition. 2017-07-26 06:14:54 -07:00
Arzhan Kinzhalin f6630a2389 Get rid of ar(chiver) warning.
Using automake default modifiers ('cru') makes ar warn about
meaningless 'u':

/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')

Instead of using the defaults, specify all the modifiers explicitly:
'crD'.
2017-07-26 06:14:54 -07:00
Ikey Doherty d8b17d7af4 Bump version to 1.5.4 for release
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
v1.5.4
2017-06-16 16:00:34 +01:00
Ikey Doherty c8268601c8 tests: Run clang-format to deduplicate header includes
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-06-16 15:08:48 +01:00
Ikey Doherty 6c0a383788 cli: Return the correct value when set_timeout works
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-06-16 15:08:33 +01:00
Ikey Doherty c44abcba98 Fix the ordering of UEFI vs legacy probing
The first and most important change is to ensure that we never try to
grab the host ESP when we're operating in image mode. This alone causes
issues when producing images using "--path", i.e. VHD imagery.

Secondly, we ensure that we *always* set image mode *before* we set the
prefix, as this prefix is only ever set once. This is the part where we
inspect the root of the system we're looking at, and determine whether
we're dealing with legacy or UEFI, or legacy+gpt (i.e. Azure images).

Lastly, we make sure that update_image follows the lead of update_native
by re-initialising the bootloader prior to using it, with the current
root + boot directory settings, ensuring we're always using fresh
values and world view.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-06-16 15:06:03 +01:00
Ikey Doherty d4d32bbb6e tests: Add a new set of tests around kernels without modules
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-05-30 11:51:40 -07:00
Ikey Doherty 349301473f kernel: Allow lack of modules to be non-fatal
The lack of kernel modules during install isn't necessarily fatal, and
some kernel configurations might be without modules entirely. Notably,
given that kernel modules are to be marked as resident on disk, even if
we have multiple packages compromising a kernel and separate modules, those
old modules will be removed at the time of the kernel change, and at no
other time, ensuring an atomic update.

This resolves #67.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-05-30 11:51:40 -07:00
Ikey Doherty cac98846ba Bump v1.5.3
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
v1.5.3
2017-05-02 18:55:03 +01:00
Ikey Doherty 567adab339 Ensure to include sysmacros.h for major/minor usage
As of glibc 2.25, warnings will be emitted at compile time to state
that you must explicitly include the header now, due to libraries
tending to have their own definitions.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-05-02 10:51:27 -07:00
Ikey Doherty 1fdb5aa6aa bootman: Ensure that we use the full namespace for EFI assets
Prior to this change, the kernel and initrd paths were not using the
namespace directory during kernel removal, leading to assets being left
on the disk and filling up the ESP with junk that could not be reclaimed.

This change introduces the simple fix, as well as the UEFI specific test
to ensure that the files are being removed.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-05-02 10:23:59 -07:00
Ikey Doherty f39aec33a2 Bump v1.5.2
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
v1.5.2
2017-04-07 17:37:12 +01:00