Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ path = "src/main.rs"
[dependencies]
anyhow = "1.0"
bincode = "1.3.2"
bootc-blockdev = { git = "https://github.com/containers/bootc", rev = "v1.3.0" }
bootc-utils = { git = "https://github.com/containers/bootc", rev = "v1.3.0" }
bootc-internal-blockdev = "0.0.0"
bootc-internal-utils = "0.0.0"
cap-std-ext = "4.0.6"
camino = "1.1.9"
chrono = { version = "0.4.41", features = ["serde"] }
Expand Down
4 changes: 2 additions & 2 deletions src/bios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ fn target_device(device: &str) -> Result<Cow<str>> {
const PREPBOOT_MBR_TYPE: &str = "41";

// Here we use lsblk to see if the device has any partitions at all
let dev = bootc_blockdev::list_dev(device.into())?;
let dev = bootc_internal_blockdev::list_dev(device.into())?;
if dev.children.is_none() {
return Ok(device.into());
};
// If it does, directly call `sfdisk` and bypass lsblk because inside a container
// we may not have all the cached udev state (that I think is in /run).
let device = bootc_blockdev::partitions_of(device.into())?;
let device = bootc_internal_blockdev::partitions_of(device.into())?;
let prepdev = device
.partitions
.iter()
Expand Down
9 changes: 5 additions & 4 deletions src/blockdev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use camino::Utf8Path;
use std::path::Path;

use anyhow::{Context, Result};
use bootc_blockdev::PartitionTable;
use bootc_internal_blockdev::PartitionTable;
use fn_error_context::context;

#[context("get parent devices from mount point boot or sysroot")]
Expand Down Expand Up @@ -30,7 +30,7 @@ pub fn get_devices<P: AsRef<Path>>(target_root: P) -> Result<Vec<String>> {
};

// Find the parent devices of the source path
let parent_devices = bootc_blockdev::find_parent_devices(&source)
let parent_devices = bootc_internal_blockdev::find_parent_devices(&source)
.with_context(|| format!("While looking for backing devices of {}", source))?;
log::debug!("Found parent devices: {parent_devices:?}");
Ok(parent_devices)
Expand All @@ -40,7 +40,8 @@ pub fn get_devices<P: AsRef<Path>>(target_root: P) -> Result<Vec<String>> {
/// using sfdisk to get partitiontable
pub fn get_esp_partition(device: &str) -> Result<Option<String>> {
const ESP_TYPE_GUID: &str = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B";
let device_info: PartitionTable = bootc_blockdev::partitions_of(Utf8Path::new(device))?;
let device_info: PartitionTable =
bootc_internal_blockdev::partitions_of(Utf8Path::new(device))?;
let esp = device_info
.partitions
.into_iter()
Expand Down Expand Up @@ -70,7 +71,7 @@ pub fn find_colocated_esps(devices: &Vec<String>) -> Result<Option<Vec<String>>>
/// Find bios_boot partition on the same device
pub fn get_bios_boot_partition(device: &str) -> Result<Option<String>> {
const BIOS_BOOT_TYPE_GUID: &str = "21686148-6449-6E6F-744E-656564454649";
let device_info = bootc_blockdev::partitions_of(Utf8Path::new(device))?;
let device_info = bootc_internal_blockdev::partitions_of(Utf8Path::new(device))?;
let bios_boot = device_info
.partitions
.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion src/efi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::path::{Path, PathBuf};
use std::process::Command;

use anyhow::{bail, Context, Result};
use bootc_utils::CommandRunExt;
use bootc_internal_utils::CommandRunExt;
use cap_std::fs::Dir;
use cap_std_ext::cap_std;
use fn_error_context::context;
Expand Down
2 changes: 1 addition & 1 deletion src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::os::unix::process::CommandExt;
use std::process::Command;

use anyhow::Result;
use bootc_utils::CommandRunExt;
use bootc_internal_utils::CommandRunExt;
use fn_error_context::context;
use rustix::fd::BorrowedFd;
use serde::Deserialize;
Expand Down
2 changes: 1 addition & 1 deletion src/filetree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ pub(crate) struct ApplyUpdateOptions {
target_arch = "riscv64"
))]
fn copy_dir(root: &openat::Dir, src: &str, dst: &str) -> Result<()> {
use bootc_utils::CommandRunExt;
use bootc_internal_utils::CommandRunExt;
use std::os::unix::process::CommandExt;
use std::process::Command;

Expand Down
2 changes: 1 addition & 1 deletion src/grubconfigs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::os::unix::io::AsRawFd;
use std::path::{Path, PathBuf};

use anyhow::{anyhow, Context, Result};
use bootc_utils::CommandRunExt;
use bootc_internal_utils::CommandRunExt;
use fn_error_context::context;
use openat_ext::OpenatDirExt;

Expand Down