--- zzzz-none-000/linux-5.4.213/block/partitions/efi.c 2022-09-15 10:04:56.000000000 +0000 +++ miami-7690-761/linux-5.4.213/block/partitions/efi.c 2024-05-29 11:19:50.000000000 +0000 @@ -89,6 +89,7 @@ #include #include "check.h" #include "efi.h" +#include /* This allows a kernel command line option 'gpt' to override * the test for invalid PMBR. Not __initdata because reloading @@ -721,6 +722,14 @@ info->volname[label_count] = c; label_count++; } + + if (ROOT_DEV == 0 && !strcmp(info->volname, "rootfs") && + IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV)) { + ROOT_DEV = MKDEV(MAJOR(state->bdev->bd_dev), i + 1); + pr_notice("GPT: device [%d:%d] (%s) set to be root filesystem\n", + MAJOR(ROOT_DEV), MINOR(ROOT_DEV), + info->volname); + } state->parts[i + 1].has_info = true; } kfree(ptes);