Skip to content
Draft
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
5 changes: 0 additions & 5 deletions crates/composefs-boot/src/bootloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,15 @@ initrd /{id}/initramfs.img

#[derive(Debug)]
pub enum BootEntry<ObjectID: FsVerityHashValue> {
Type1(Type1Entry<ObjectID>),
Type2(Type2Entry<ObjectID>),
UsrLibModulesVmLinuz(UsrLibModulesVmlinuz<ObjectID>),
}

pub fn get_boot_resources<ObjectID: FsVerityHashValue>(
image: &FileSystem<ObjectID>,
repo: &Repository<ObjectID>,
) -> Result<Vec<BootEntry<ObjectID>>> {
let mut entries = vec![];

for e in Type1Entry::load_all(&image.root, repo)? {
entries.push(BootEntry::Type1(e));
}
for e in Type2Entry::load_all(&image.root)? {
entries.push(BootEntry::Type2(e));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/composefs-boot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<ObjectID: FsVerityHashValue> BootOps<ObjectID> for FileSystem<ObjectID> {
&mut self,
repo: &Repository<ObjectID>,
) -> Result<Vec<BootEntry<ObjectID>>> {
let boot_entries = get_boot_resources(self, repo)?;
let boot_entries = get_boot_resources(self)?;
for d in REQUIRED_TOPLEVEL_TO_EMPTY_DIRS {
let d = self.root.get_directory_mut(d.as_ref())?;
d.stat.st_mtim_sec = 0;
Expand Down
15 changes: 1 addition & 14 deletions crates/composefs-boot/src/write_boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::{
uki,
};

/// Write a BLS Type 1 entry.
pub fn write_t1_simple<ObjectID: FsVerityHashValue>(
mut t1: Type1Entry<ObjectID>,
bootdir: &Path,
Expand Down Expand Up @@ -119,20 +120,6 @@ pub fn write_boot_simple<ObjectID: FsVerityHashValue>(
cmdline_extra: &[&str],
) -> Result<()> {
match entry {
BootEntry::Type1(mut t1) => {
if let Some(name) = entry_id {
t1.relocate(boot_subdir, name);
}
write_t1_simple(
t1,
boot_partition,
boot_subdir,
root_id,
insecure,
cmdline_extra,
repo,
)?;
}
BootEntry::Type2(mut t2) => {
if let Some(name) = entry_id {
t2.rename(name);
Expand Down
Loading