-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sysroot: Support customising /boot on root for syslinux and u-boot #2145
sysroot: Support customising /boot on root for syslinux and u-boot #2145
Conversation
I think this may affect bindings too.
In preparation for enhancing `_ostree_sysroot_query_bootloader`
It's easier to extend and it centralises the config parsing. In other places we will no longer need to use `g_str_equal` to match these values, a `switch` statement will be sufficient.
...with the `sysroot.bootloader` configuration option. This can be useful when converting a system to use `ostree` which doesn't currently have a bootloader configuration that `ostree` can automatically detect, and is also useful in combination with the `--sysroot` option when provisioning a rootfs for systems other than the one you're running `ostree admin deploy` on.
In preparation for adding another function that will need these `AUTOPTR_CLEANUP_FUNC`s.
This introduces a new config value "sysroot.boot_path_on_disk": > Tell ostree where the bootloader will be looking for the kernel. This is > the location of `/boot` relative to the root of the boot partition. > > This allows explicitly telling ostree that the boot partition is or is > not separate from the root partition. If `/boot` is on root set this to > `/boot`. If it's on seperate partition this should be set to `/`. > > This must be either an absolute path (starting with `/`) or `auto`. > Defaults to `auto`. > > This setting currently only respected by the u-boot and syslinux > bootloaders. This commit is based on an original by Colin Walters (ostreedev#215), but takes a different tack. ostreedev#215 attempts to determine automatically whether `/boot` is on root or not, but there are always situations where this isn't possible so I'm adding a config option here so the user can make it explicit. Future commits can add the automatic detection in, but this means that we don't need to be completely general with the auto-detection.
This speeds up iterating on fixing code.
Actually, nevermind this I've got a better solution... |
I know this is a lot more code but I do like the explicit-ness of this. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, wmanley The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -372,6 +372,33 @@ Boston, MA 02111-1307, USA. | |||
</listitem> | |||
</varlistentry> | |||
|
|||
<varlistentry> | |||
<term><varname>boot_path_on_disk</varname></term> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just boot_path
?
|
||
if (!boot_path_on_disk || boot_path_on_disk[0] != '/') | ||
{ | ||
g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "sysroot.boot_path_on_disk " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd do:
return glnx_null_throw ("sysroot.boot_path is not absolute: %s", boot_path);
Closing this since #2149 merged. |
This introduces a new config value "sysroot.boot_path_on_disk":
This commit is based on an original by Colin Walters (#215), but takes a
different tack. #215 attempts to determine automatically whether
/boot
is on root or not, but there are always situations where this isn't
possible so I'm adding a config option here so the user can make it
explicit.
Future commits can add the automatic detection in, but this means that we
don't need to be completely general with the auto-detection.
See also some background here: #1404 (comment)