Skip to content

Commit 6c0e1dc

Browse files
committed
Drop support for embedding type1 entries directly in an image
We're not going to use this in bootc and right now we just error if we encounter it, and I am not aware of a good use case. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent d6b4c27 commit 6c0e1dc

3 files changed

Lines changed: 5 additions & 27 deletions

File tree

crates/composefs-boot/src/bootloader.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,10 @@ initrd /{id}/initramfs.img
524524

525525
/// Represents any type of boot entry found in the filesystem.
526526
///
527-
/// This enum unifies the three types of boot entries that can be discovered:
528-
/// Type 1 BLS entries, Type 2 UKIs, and traditional vmlinuz/initramfs pairs.
527+
/// This enum unifies the different types of boot entries that can be discovered:
528+
/// Type 2 UKIs and traditional vmlinuz/initramfs pairs.
529529
#[derive(Debug)]
530530
pub enum BootEntry<ObjectID: FsVerityHashValue> {
531-
/// Boot Loader Specification Type 1 entry
532-
Type1(Type1Entry<ObjectID>),
533531
/// Boot Loader Specification Type 2 entry (UKI)
534532
Type2(Type2Entry<ObjectID>),
535533
/// Traditional vmlinuz from /usr/lib/modules
@@ -538,27 +536,21 @@ pub enum BootEntry<ObjectID: FsVerityHashValue> {
538536

539537
/// Extracts all boot resources from a filesystem image.
540538
///
541-
/// Scans the filesystem for all types of boot entries: Type 1 BLS entries in
542-
/// /boot/loader/entries, Type 2 UKIs in /boot/EFI/Linux, and traditional vmlinuz
543-
/// files in /usr/lib/modules.
539+
/// Scans the filesystem for all types of boot entries: Type 2 UKIs in
540+
/// /boot/EFI/Linux and traditional vmlinuz files in /usr/lib/modules.
544541
///
545542
/// # Arguments
546543
///
547544
/// * `image` - The filesystem to scan
548-
/// * `repo` - The composefs repository
549545
///
550546
/// # Returns
551547
///
552548
/// A vector containing all boot entries found in the filesystem
553549
pub fn get_boot_resources<ObjectID: FsVerityHashValue>(
554550
image: &FileSystem<ObjectID>,
555-
repo: &Repository<ObjectID>,
556551
) -> Result<Vec<BootEntry<ObjectID>>> {
557552
let mut entries = vec![];
558553

559-
for e in Type1Entry::load_all(&image.root, repo)? {
560-
entries.push(BootEntry::Type1(e));
561-
}
562554
for e in Type2Entry::load_all(&image.root)? {
563555
entries.push(BootEntry::Type2(e));
564556
}

crates/composefs-boot/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl<ObjectID: FsVerityHashValue> BootOps<ObjectID> for FileSystem<ObjectID> {
6969
&mut self,
7070
repo: &Repository<ObjectID>,
7171
) -> Result<Vec<BootEntry<ObjectID>>> {
72-
let boot_entries = get_boot_resources(self, repo)?;
72+
let boot_entries = get_boot_resources(self)?;
7373

7474
// Get /usr's mtime to use as the canonical mtime for emptied directories.
7575
// This matches how we handle the root directory in copy_root_metadata_from_usr().

crates/composefs-boot/src/write_boot.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,6 @@ pub fn write_boot_simple<ObjectID: FsVerityHashValue>(
140140
cmdline_extra: &[&str],
141141
) -> Result<()> {
142142
match entry {
143-
BootEntry::Type1(mut t1) => {
144-
if let Some(name) = entry_id {
145-
t1.relocate(boot_subdir, name);
146-
}
147-
write_t1_simple(
148-
t1,
149-
boot_partition,
150-
boot_subdir,
151-
root_id,
152-
insecure,
153-
cmdline_extra,
154-
repo,
155-
)?;
156-
}
157143
BootEntry::Type2(mut t2) => {
158144
if let Some(name) = entry_id {
159145
t2.rename(name);

0 commit comments

Comments
 (0)