diff options
| author | Ming Liu <liu.ming50@gmail.com> | 2024-01-03 13:30:52 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-03 23:36:34 +0000 |
| commit | 361cc39ede48686d2fbece697e024220861aad2c (patch) | |
| tree | 0874d1b3ff199d7fe21073ad0b6654d19c8edec5 | |
| parent | e08a0caab4cc30b7b98032af28dc4bbad5172ead (diff) | |
| download | poky-361cc39ede48686d2fbece697e024220861aad2c.tar.gz | |
grub: fs/fat: Don't error when mtime is 0
A issue was found when I run "runqemu genericx86-64 ovmf", grub failed
to boot, it's a known issue has been fixed in grub upstream, backport
the fix.
(From OE-Core rev: 51eab4bb0cae46c9c32d28986eb97badf47594b7)
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-bsp/grub/files/0001-fs-fat-Don-t-error-when-mtime-is-0.patch | 70 | ||||
| -rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 1 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-fs-fat-Don-t-error-when-mtime-is-0.patch b/meta/recipes-bsp/grub/files/0001-fs-fat-Don-t-error-when-mtime-is-0.patch new file mode 100644 index 0000000000..a5fbd58f46 --- /dev/null +++ b/meta/recipes-bsp/grub/files/0001-fs-fat-Don-t-error-when-mtime-is-0.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | From e43f3d93b28cce852c110c7a8e40d8311bcd8bb1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Robbie Harwood <rharwood@redhat.com> | ||
| 3 | Date: Fri, 15 Jul 2022 16:13:02 -0400 | ||
| 4 | Subject: [PATCH] fs/fat: Don't error when mtime is 0 | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | In the wild, we occasionally see valid ESPs where some file modification | ||
| 10 | times are 0. For instance: | ||
| 11 | |||
| 12 | ├── [Dec 31 1979] EFI | ||
| 13 | │ ├── [Dec 31 1979] BOOT | ||
| 14 | │ │ ├── [Dec 31 1979] BOOTX64.EFI | ||
| 15 | │ │ └── [Dec 31 1979] fbx64.efi | ||
| 16 | │ └── [Jun 27 02:41] fedora | ||
| 17 | │ ├── [Dec 31 1979] BOOTX64.CSV | ||
| 18 | │ ├── [Dec 31 1979] fonts | ||
| 19 | │ ├── [Mar 14 03:35] fw | ||
| 20 | │ │ ├── [Mar 14 03:35] fwupd-359c1169-abd6-4a0d-8bce-e4d4713335c1.cap | ||
| 21 | │ │ ├── [Mar 14 03:34] fwupd-9d255c4b-2d88-4861-860d-7ee52ade9463.cap | ||
| 22 | │ │ └── [Mar 14 03:34] fwupd-b36438d8-9128-49d2-b280-487be02d948b.cap | ||
| 23 | │ ├── [Dec 31 1979] fwupdx64.efi | ||
| 24 | │ ├── [May 10 10:47] grub.cfg | ||
| 25 | │ ├── [Jun 3 12:38] grub.cfg.new.new | ||
| 26 | │ ├── [May 10 10:41] grub.cfg.old | ||
| 27 | │ ├── [Jun 27 02:41] grubenv | ||
| 28 | │ ├── [Dec 31 1979] grubx64.efi | ||
| 29 | │ ├── [Dec 31 1979] mmx64.efi | ||
| 30 | │ ├── [Dec 31 1979] shim.efi | ||
| 31 | │ ├── [Dec 31 1979] shimx64.efi | ||
| 32 | │ └── [Dec 31 1979] shimx64-fedora.efi | ||
| 33 | └── [Dec 31 1979] FSCK0000.REC | ||
| 34 | |||
| 35 | 5 directories, 17 files | ||
| 36 | |||
| 37 | This causes grub-probe failure, which in turn causes grub-mkconfig | ||
| 38 | failure. They are valid filesystems that appear intact, and the Linux | ||
| 39 | FAT stack is able to mount and manipulate them without complaint. | ||
| 40 | |||
| 41 | The check for mtime of 0 has been present since | ||
| 42 | 20def1a3c3952982395cd7c3ea7e78638527962b (fat: support file | ||
| 43 | modification times). | ||
| 44 | |||
| 45 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e43f3d93b28cce852c110c7a8e40d8311bcd8bb1] | ||
| 46 | |||
| 47 | Signed-off-by: Robbie Harwood <rharwood@redhat.com> | ||
| 48 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
| 49 | Signed-off-by: Ming Liu <liu.ming50@gmail.com> | ||
| 50 | --- | ||
| 51 | grub-core/fs/fat.c | 3 --- | ||
| 52 | 1 file changed, 3 deletions(-) | ||
| 53 | |||
| 54 | diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c | ||
| 55 | index 0951b2e63..c5efed724 100644 | ||
| 56 | --- a/grub-core/fs/fat.c | ||
| 57 | +++ b/grub-core/fs/fat.c | ||
| 58 | @@ -1027,9 +1027,6 @@ grub_fat_dir (grub_device_t device, const char *path, grub_fs_dir_hook_t hook, | ||
| 59 | grub_le_to_cpu16 (ctxt.dir.w_date), | ||
| 60 | &info.mtime); | ||
| 61 | #endif | ||
| 62 | - if (info.mtimeset == 0) | ||
| 63 | - grub_error (GRUB_ERR_OUT_OF_RANGE, | ||
| 64 | - "invalid modification timestamp for %s", path); | ||
| 65 | |||
| 66 | if (hook (ctxt.filename, &info, hook_data)) | ||
| 67 | break; | ||
| 68 | -- | ||
| 69 | 2.34.1 | ||
| 70 | |||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index f594e7d3a4..1215b24668 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
| @@ -44,6 +44,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
| 44 | file://0001-fs-ext2-Ignore-checksum-seed-incompat-feature.patch \ | 44 | file://0001-fs-ext2-Ignore-checksum-seed-incompat-feature.patch \ |
| 45 | file://CVE-2023-4692.patch \ | 45 | file://CVE-2023-4692.patch \ |
| 46 | file://CVE-2023-4693.patch \ | 46 | file://CVE-2023-4693.patch \ |
| 47 | file://0001-fs-fat-Don-t-error-when-mtime-is-0.patch \ | ||
| 47 | " | 48 | " |
| 48 | 49 | ||
| 49 | SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" | 50 | SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" |
