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

release/amd64: cleanup code duplication #1571

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

Conversation

VexedUXR
Copy link
Contributor

@VexedUXR VexedUXR commented Jan 13, 2025

Improve the release script by checking MK_LOADER_IA32 instead of the janky if -f "${BASEBITSDIR}/boot/loader_ia32.efi"

I'm hesitant about putting this in install-boot.sh, it feels out of place.
Maybe a new script in release/amd64 that gets sourced by both make-memstick and mkisoimages would be better? I'm not sure..

This also makes the script complain if MK_LOADER_IA32 is yes but the file is missing, instead of silently not copying it.
FWIW it also allows the user to build the ia32 loader, but omit it from the img, though I'm not sure what the use case would be.

I've been meaning to do this since 599273f landed but forgot, so here it is.

Copy link
Member

@bsdjhb bsdjhb left a comment

Choose a reason for hiding this comment

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

I think checking for the existence of the file is fine vs checking MK_LOADER_IA32. That said, I think the cleanup to use a helper extra_args variable to reduce code duplication is useful in its own right (and probably worthy of being its own commit). I do think bootx64 belongs in extra_args though.

else
make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi
if [ ${MK_LOADER_IA32} = "yes" ]; then
extra_args="${BASEBITSDIR}/boot/loader_ia32.efi bootia32"
Copy link
Member

Choose a reason for hiding this comment

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

Should "bootx64" be in the extra_args case here? It's not present in the existing code for the !LOADER_IA32 case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't matter. If make_esp_file isn't given the "bootx64", it automatically determines it using uname -m.
I just thought this would make more sense since the arguments are given in pairs, and the condition was for the ia32 pair.

@VexedUXR
Copy link
Contributor Author

Ok, went back to simply checking if the loader files exist. :)

@VexedUXR VexedUXR changed the title release/amd64: Check config variables instead of checking files release/amd64: cleanup code duplication Jan 25, 2025
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