Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64 support: efi stub and devicetree selection #722

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zdykstra
Copy link
Member

@zdykstra zdykstra commented Feb 5, 2025

generate-zbm now understands the EFI.DeviceTree key. This key can contain one of three possible values:

  1. /absolute/path/%{kernel}/to/device-tree-file.dtb
  2. /absolute/path/to/device-tree-file.dtb
  3. partial/path/device-tree-file.dtb

If found, %{kernel} is replaced with the kernel version being built in to the EFI asset. Partial paths are appended to /boot/dtbs/dtb-$kernel/, a well-known path for device tree files used by Void Linux.

Inside ZFSBootMenu, the org.zfsbootmenu:devicetree property is read. The values of this property are handled in the same order/priority as EFI.DeviceTree.

Documentation will be written and appended to this PR once the overall design of this support is accepted.

@zdykstra zdykstra force-pushed the podunk-platform-support branch 8 times, most recently from 4b60c5c to 0ec4a20 Compare February 5, 2025 22:31
@zdykstra
Copy link
Member Author

zdykstra commented Feb 5, 2025

Go go gadget force push

@zdykstra zdykstra force-pushed the podunk-platform-support branch from 0ec4a20 to b64815c Compare February 6, 2025 00:02
generate-zbm now understands the EFI.DeviceTree key. This key can
contain one of three possible values:

1) /absolute/path/%{kernel}/to/device-tree-file.dtb
2) /absolute/path/to/device-tree-file.dtb
3) partial/path/device-tree-file.dtb

If found, %{kernel} is replaced with the kernel version being built in
to the EFI asset. Partial paths are appended to /boot/dtbs/dtb-$kernel/,
a well-known path for device tree files used by Void Linux.

Inside ZFSBootMenu, the org.zfsbootmenu:devicetree property is read. The
value of this property are handled in the same order/priority as
EFI.DeviceTree. %{kernel} is replaced with the kernel version that kexec
is loading / executing.
@zdykstra zdykstra force-pushed the podunk-platform-support branch from b64815c to cccb2b0 Compare February 6, 2025 00:50
Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works exactly as I'd expect. I offer only some trivial comments, take or leave them as you like.

We need documentation on the config.yaml options and the ZFS property.

Comment on lines +797 to +807
if ( has_value $dtb_try && -f $dtb_try ) {
$uki_offset = addBundleSection( \@cmd, ".dtb", $dtb_try, $uki_offset, $uki_alignment );
} else {
if ( has_value $dtb_try ) {
printf "EFI.DeviceTree key set to '%s', file not found at '%s'\n", $config{EFI}{DeviceTree}, $dtb_try;
exit 1;
} else {
printf "EFI.DeviceTree key set to '%s', file not found\n", $config{EFI}{DeviceTree};
exit 1;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ( has_value $dtb_try && -f $dtb_try ) {
$uki_offset = addBundleSection( \@cmd, ".dtb", $dtb_try, $uki_offset, $uki_alignment );
} else {
if ( has_value $dtb_try ) {
printf "EFI.DeviceTree key set to '%s', file not found at '%s'\n", $config{EFI}{DeviceTree}, $dtb_try;
exit 1;
} else {
printf "EFI.DeviceTree key set to '%s', file not found\n", $config{EFI}{DeviceTree};
exit 1;
}
}
if ( has_value $dtb_try) {
if ( -f $dtb_try ) {
$uki_offset = addBundleSection( \@cmd, ".dtb", $dtb_try, $uki_offset, $uki_alignment );
} else {
printf "EFI.DeviceTree key set to '%s', file not found at '%s'\n", $config{EFI}{DeviceTree}, $dtb_try;
exit 1;
}
} else {
printf "EFI.DeviceTree key set to '%s', but no DeviceTree file could be found\n", $config{EFI}{DeviceTree};
exit 1;
}

if [ -n "${dtb_prop}" ] && [ "${dtb_prop}" != '-' ] ; then
zdebug "devicetree property set to '${dtb_prop}'"

# this is cursed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really cursed, it's how we map kernels to initramfs images as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants