-
Notifications
You must be signed in to change notification settings - Fork 150
install: Detect bootloader from target image instead of host #1785
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,38 @@ | ||
| use std assert | ||
| use tap.nu | ||
|
|
||
| # In this test we install a generic image mainly because it keeps | ||
| # this test in theory independent of starting from a bootc host, | ||
| # but also because it's useful to test "skew" between the bootc binary | ||
| # doing the install and the target image. | ||
| let target_image = "docker://quay.io/centos-bootc/centos-bootc:stream10" | ||
|
|
||
| # setup filesystem | ||
| mkdir /var/mnt | ||
| truncate -s 100M disk.img | ||
| truncate -s 10G disk.img | ||
| mkfs.ext4 disk.img | ||
| mount -o loop disk.img /var/mnt | ||
|
|
||
| # attempt to install to filesystem without specifying a source-imgref | ||
| let result = bootc install to-filesystem /var/mnt e>| find "--source-imgref must be defined" | ||
| assert not equal $result null | ||
| umount /var/mnt | ||
|
|
||
| # Mask off the bootupd state to reproduce https://github.com/bootc-dev/bootc/issues/1778 | ||
| # Also it turns out that installation outside of containers dies due to `error: Multiple commit objects found` | ||
| # so we mask off /sysroot/ostree | ||
| # And using systemd-run here breaks our install_t so we disable SELinux enforcement | ||
| setenforce 0 | ||
| systemd-run -p MountFlags=slave -qdPG -- /bin/sh -c $" | ||
| set -xeuo pipefail | ||
| if test -d /sysroot/ostree; then mount --bind /usr/share/empty /sysroot/ostree; fi | ||
| mkdir -p /tmp/ovl/{upper,work} | ||
| mount -t overlay -olowerdir=/usr,workdir=/tmp/ovl/work,upperdir=/tmp/ovl/upper overlay /usr | ||
| # Note we do keep the other bootupd state | ||
| rm -vrf /usr/lib/bootupd/updates | ||
| # Another bootc install bug, we should not look at this in outside-of-container flows | ||
| rm -vrf /usr/lib/bootc/bound-images.d | ||
| bootc install to-disk --disable-selinux --via-loopback --filesystem xfs --source-imgref ($target_image) ./disk.img | ||
| " | ||
|
|
||
| tap ok |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.