Skip to content

Commit 5454608

Browse files
committed
install: use deployed sysroot as root for bootloader install
Tell bootupctl to load components from the deployed image rather than expecting we are running in the container (or assume that the buildroot is the container.) As the image content is already deployed at this stage, pointing to it makes it work in both scenarios (different buildroot or running from the container.) Fixes #1455
1 parent a27199d commit 5454608

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/lib/src/bootloader.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ pub(crate) fn install_via_bootupd(
1414
device: &PartitionTable,
1515
rootfs: &Utf8Path,
1616
configopts: &crate::install::InstallConfigOpts,
17+
deployment_path: &str,
1718
) -> Result<()> {
1819
let verbose = std::env::var_os("BOOTC_BOOTLOADER_DEBUG").map(|_| "-vvvv");
1920
// bootc defaults to only targeting the platform boot method.
2021
let bootupd_opts = (!configopts.generic_image).then_some(["--update-firmware", "--auto"]);
2122

23+
let srcroot = rootfs.join(deployment_path);
2224
let devpath = device.path();
2325
let args = ["backend", "install", "--write-uuid"]
2426
.into_iter()
2527
.chain(verbose)
2628
.chain(bootupd_opts.iter().copied().flatten())
29+
.chain(["--src-root", srcroot.as_str()])
2730
.chain(["--device", devpath.as_str(), rootfs.as_str()]);
2831
Task::new("Running bootupctl to install bootloader", "bootupctl")
2932
.args(args)

crates/lib/src/install.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ async fn install_with_sysroot(
13471347
) -> Result<()> {
13481348
// And actually set up the container in that root, returning a deployment and
13491349
// the aleph state (see below).
1350-
let (_deployment, aleph) = install_container(state, rootfs, &sysroot, has_ostree).await?;
1350+
let (deployment, aleph) = install_container(state, rootfs, &sysroot, has_ostree).await?;
13511351
// Write the aleph data that captures the system state at the time of provisioning for aid in future debugging.
13521352
rootfs
13531353
.physical_root
@@ -1356,6 +1356,8 @@ async fn install_with_sysroot(
13561356
})
13571357
.context("Writing aleph version")?;
13581358

1359+
let deployment_path = sysroot.deployment_dirpath(&deployment);
1360+
13591361
if cfg!(target_arch = "s390x") {
13601362
// TODO: Integrate s390x support into install_via_bootupd
13611363
crate::bootloader::install_via_zipl(&rootfs.device_info, boot_uuid)?;
@@ -1364,6 +1366,7 @@ async fn install_with_sysroot(
13641366
&rootfs.device_info,
13651367
&rootfs.physical_root_path,
13661368
&state.config_opts,
1369+
&deployment_path.as_str(),
13671370
)?;
13681371
}
13691372
tracing::debug!("Installed bootloader");

0 commit comments

Comments
 (0)