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

Support for booting without initramfs (rebased) #1401

Closed

Conversation

wmanley
Copy link
Member

@wmanley wmanley commented Jan 9, 2018

This is #442 rebased and with some additional tests. We've been using this patch successfully for over a year in combination with #215 and some others.

gatispaeglis and others added 5 commits January 9, 2018 19:46
With the current approach, when ostree-prepare-root is used
on the kernel command line as init=, it always assumes that
the next value in the argument list is a path to the sysroot.
The code for falling back to a default path (if none is provided),
would only work if init= is the last arg in the argument list.
We can not rely on that and have to explicitly provide the
path to the sysroot. Which defeats the purpose of a default
path selection code.

To keep command line neater assume that sysroot is on / when
using ostree-prepare-root as init. This probably is what most
people want anyways. Also _ostree_kernel_args* API assumes
that args are space separated list. Which is problematic for:
"init=${ostree}/usr/lib/ostree/ostree-prepare-root /" as it
gets split in two.
If the current deployment has "rootwait root=/dev/sda2",
but the new deployment does not need "rootwait" anymore,
there is no way to clear this arg at the moment (as opposed
to "karg=root=", which overrides any earlier argument with
the same name). With "--karg-none" users can now clear all
the previous args and set new "root=":

ostree admin deploy --karg-none --karg=root=LABEL=rootfs
Previously when initramfs-* was not found in a deployment's
boot directory, it was assumed that rootfs is prepared for
ostree booting by a kernel patch.

With this patch, the behaviour changes to be - if initramfs-*
is not found, assume that system is using a static
ostree-prepare-root as init process. Booting without initramfs
is a common use case on embedded systems. This approach is
also more convenient, than having to patch the kernel.
@wmanley wmanley changed the title No initramfs bootloader support Support for booting without initramfs (rebased) Jan 9, 2018
@vtolstov
Copy link

vtolstov commented Jan 9, 2018

@cgwalters does it possible to update #215 while new grub2 backend not ready? I have already bunch of hosts with /boot on / and i'm always need to prepend /boot inside grub.cfg

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one very minor comment, otherwise looks great to me! Sorry I didn't get to reviewing the original PR; my world is mostly laptop-and-above machines. I did buy a Cubietruck but have yet to put an OS on it...testing things like this may be an excuse to spend time on that.

Thanks a ton for pushing this forward.

else
{
g_autofree char *prepare_root_arg = NULL;
prepare_root_arg = g_strdup_printf ("init=/ostree/boot.%d/%s/%s/%d/usr/lib/ostree/ostree-prepare-root",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path should use LIBEXECDIR I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. See fd1a044. I think the idea is that ostree-prepare-root needs to be at a fixed location in the rootfs otherwise a different version of ostree with different configure flags couldn't successfully deploy a rootfs with standard configure flags.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I even agreed with this in #449 (comment) - though for a different reason; I'm not sure how realistic it is to worry about different configure flags.

@cgwalters
Copy link
Member

Did you already rebase #215 then?

@wmanley
Copy link
Member Author

wmanley commented Jan 10, 2018

Did you already rebase #215 then?

Yes, I've now created a PR for this too: #1404

@cgwalters
Copy link
Member

@rh-atomic-bot r+ a97c054

@rh-atomic-bot
Copy link

⌛ Testing commit a97c054 with merge 3318db5...

rh-atomic-bot pushed a commit that referenced this pull request Jan 10, 2018
If the current deployment has "rootwait root=/dev/sda2",
but the new deployment does not need "rootwait" anymore,
there is no way to clear this arg at the moment (as opposed
to "karg=root=", which overrides any earlier argument with
the same name). With "--karg-none" users can now clear all
the previous args and set new "root=":

ostree admin deploy --karg-none --karg=root=LABEL=rootfs

Closes: #1401
Approved by: cgwalters
rh-atomic-bot pushed a commit that referenced this pull request Jan 10, 2018
Previously when initramfs-* was not found in a deployment's
boot directory, it was assumed that rootfs is prepared for
ostree booting by a kernel patch.

With this patch, the behaviour changes to be - if initramfs-*
is not found, assume that system is using a static
ostree-prepare-root as init process. Booting without initramfs
is a common use case on embedded systems. This approach is
also more convenient, than having to patch the kernel.

Closes: #1401
Approved by: cgwalters
rh-atomic-bot pushed a commit that referenced this pull request Jan 10, 2018
rh-atomic-bot pushed a commit that referenced this pull request Jan 10, 2018
@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: cgwalters
Pushing 3318db5 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants