Skip to content
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

Closed

Conversation

wmanley
Copy link
Member

@wmanley wmanley commented Jul 8, 2020

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 (#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)

wmanley and others added 8 commits July 6, 2020 16:14
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.
@openshift-ci-robot openshift-ci-robot requested review from d4s and mwleeds July 8, 2020 14:29
@wmanley
Copy link
Member Author

wmanley commented Jul 15, 2020

Actually, nevermind this I've got a better solution...

@cgwalters
Copy link
Member

I know this is a lot more code but I do like the explicit-ness of this.
/approve

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -372,6 +372,33 @@ Boston, MA 02111-1307, USA.
</listitem>
</varlistentry>

<varlistentry>
<term><varname>boot_path_on_disk</varname></term>
Copy link
Member

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 "
Copy link
Member

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);

@cgwalters
Copy link
Member

Closing this since #2149 merged.
Thanks for all the work on this!

@cgwalters cgwalters closed this Aug 18, 2020
@wmanley wmanley deleted the specify-bootloader-boot-directory branch September 1, 2020 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants