Skip to content

Commit

Permalink
Update builder image version to f40, don't make grub2-mkconfig fatal,…
Browse files Browse the repository at this point in the history
… add new partition type for grub mbr
  • Loading branch information
korewaChino committed Oct 10, 2024
1 parent a0e743a commit a871edd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
image-x86_64:
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
image: ghcr.io/terrapkg/builder:f40
# Pass /dev from host to container
# Very hacky, but it works
# Microsoft/Github, if you're reading this,
Expand Down
11 changes: 11 additions & 0 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,18 @@ impl RootBuilder for DnfRootBuilder {
info!("Generating GRUB configuration");
crate::chroot_run_cmd!(&chroot,
echo "GRUB_DISABLE_OS_PROBER=true" > /etc/default/grub;
)?;

// While grub2-mkconfig may not return 0 it should still work
let res = crate::chroot_run_cmd!(&chroot,
grub2-mkconfig -o /boot/grub2/grub.cfg;
);

if let Err(e) = res {
warn!(?e, "grub2-mkconfig not returning 0, continuing anyway");
}

crate::chroot_run_cmd!(&chroot,
rm -f /etc/default/grub;
)?;
}
Expand Down
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,8 @@ pub enum PartitionType {
Swap,
/// A generic partition that carries a Linux filesystem
LinuxGeneric,
/// MBR header partition for grub-install
BiosGrub,
/// An arbitrary GPT partition type GUID/UUIDv4
#[serde(untagged)]
Guid(uuid::Uuid),
Expand All @@ -693,6 +695,7 @@ impl PartitionType {
PartitionType::Xbootldr => "bc13c2ff-59e6-4262-a352-b275fd6f7172",
PartitionType::Swap => "0657fd6d-a4ab-43c4-84e5-0933c84b4f4f",
PartitionType::LinuxGeneric => "0fc63daf-8483-4772-8e79-3d69d8477de4",
PartitionType::BiosGrub => "21686148-6449-6E6F-744E-656564454649",
PartitionType::Guid(guid) => return guid.to_string(),
}
.to_string()
Expand Down
4 changes: 2 additions & 2 deletions tests/ng/katsu-bios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ disk:
size: 8GiB
partitions:
- label: mbr_grub
type: 21686148-6449-6E6F-744E-656564454649
type: bios-grub
size: 1MiB
filesystem: none # no filesystem
mountpoint: ""
mountpoint: "-"

- label: boot
type: xbootldr
Expand Down

0 comments on commit a871edd

Please sign in to comment.