Skip to content

Change Mtime field to INT64 to adapt to new GRUB changes #52

Open
liushuyu wants to merge 3 commits into
pbatard:masterfrom
liushuyu:master
Open

Change Mtime field to INT64 to adapt to new GRUB changes #52
liushuyu wants to merge 3 commits into
pbatard:masterfrom
liushuyu:master

Conversation

@liushuyu

@liushuyu liushuyu commented Apr 4, 2026

Copy link
Copy Markdown

This pull request changes the Mtime field to INT64 to adapt to the new GRUB changes

* GRUB upstream commit 81f1962393f4403e2b6b127f23524a962a236afb changed
  mtime to `grub_int64_t`
@MarsDoge

MarsDoge commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Excellent!LGTM.

@pbatard

pbatard commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Thanks!

I'll apply it when I get a chance, but since there was an EfiFs release recently, it'll probably be some time before you get another release that integrates this, unless you can point to a real-life issue that's going to happen before 2038.

@liushuyu liushuyu force-pushed the master branch 3 times, most recently from 706c73e to 0067ef3 Compare April 4, 2026 15:07
@xry111

xry111 commented Apr 24, 2026

Copy link
Copy Markdown

unless you can point to a real-life issue that's going to happen before 2038.

AFAIK the issue is already happening: we observed the ls command in EFI shell outputting all dates as 1970-01-01 and applying this PR can fix the issue.

If I read the code correctly the change to EFI_GRUB_FILE will only make a real difference after 2038, but the change to GRUB_DIRHOOK_INFO is already making a difference now: the offset of the Mtime field will be changed from 4 to 8 with this PR. Thus my guess is without this PR we are reading Mtime from an incorrect offset (i.e. the grub code is putting mtime at offset 8 but we'd read it at offset 4).

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.

4 participants