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

fix(dracut.sh): Handle ImageBase for uefi #2285

Merged
merged 1 commit into from
May 9, 2023

Conversation

keentux
Copy link
Contributor

@keentux keentux commented Mar 22, 2023

  • UEFI creation didn't handle the ImageBase data for the PE file generation.
    Create an UKI thanks a stub file with a non zero ImageBase logs some warning and
    generate a bad file offset management:
objcopy: /var/tmp/dracut.lwbXWb/uefi/linux.efi:.osrel: section below image base
objcopy: /var/tmp/dracut.lwbXWb/uefi/linux.efi:.cmdline: section below image base
objcopy: /var/tmp/dracut.lwbXWb/uefi/linux.efi:.linux: section below image base
objcopy: /var/tmp/dracut.lwbXWb/uefi/linux.efi:.initrd: section below image base

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Fixes #2284

Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

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

Thanks! It looks good, only minor comments.

dracut-functions.sh Outdated Show resolved Hide resolved
dracut.sh Outdated Show resolved Hide resolved
dracut-functions.sh Outdated Show resolved Hide resolved
* UEFI creation didn't handle the ImageBase data for the PE file
  generation. Create an UKI thanks a stub file with a non zero BaseImage
  logs some warning ans generate a bad file offset management. The efi
  becomes unloadable.
* This commit parse the PE file header, get the data and apply the
  ImageBase on the objcopy command.

Fixes dracutdevs#2284

Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
@stale
Copy link

stale bot commented Apr 25, 2023

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Apr 25, 2023
@aafeijoo-suse aafeijoo-suse removed the stale communication is stuck label Apr 26, 2023
@LaszloGombos LaszloGombos removed the request for review from danimo May 9, 2023 01:30
@LaszloGombos LaszloGombos added this to the dracut-060 milestone May 9, 2023
Copy link
Collaborator

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

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

LGTM

@LaszloGombos LaszloGombos merged commit 6178a9d into dracutdevs:master May 9, 2023
@medhefgo
Copy link

I fail to see what this one is supposed to achieve. As mentioned in #2284 it's already fixed with #2277. And passing --image-base will only change the PE header field, which - if not identical to the previous value - will most likely break things in nasty ways.

So, as this is just a no-op it should really be reverted.

@LaszloGombos
Copy link
Collaborator

@keentux do you agree with @medhefgo 's position above ?

@LaszloGombos
Copy link
Collaborator

@medhefgo The best way to move this forward would be if you could upload a PR for the revert, so that we have an open PR for this discussion. Also PR's from non-maintainers would actually land faster than from maintainers. Thanks

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.

Malformed section header when creating UKI with dracut and upstream systemd-stub
4 participants