[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] grub-install: hook up --emu-512b to sector size autodetectio
From: |
Mihai Moldovan |
Subject: |
[PATCH 4/7] grub-install: hook up --emu-512b to sector size autodetection in biosdisk |
Date: |
Sun, 24 May 2020 13:43:05 +0200 |
Chances are that if you need the
native-sector-addressing-with-512-bytes-lengths feature, you will also
need grub to autodetect the native sector size later on.
---
util/grub-install.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/util/grub-install.c b/util/grub-install.c
index 57ef3ef33..89e80907c 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1362,6 +1362,32 @@ main (int argc, char *argv[])
fprintf (load_cfg_f, "set debug='%s'\n",
debug_image);
}
+
+ if (emu_512b)
+ {
+ switch (platform)
+ {
+ case GRUB_INSTALL_PLATFORM_I386_PC:
+ if (!load_cfg_f)
+ {
+ load_cfg_f = grub_util_fopen (load_cfg, "wb");
+ }
+ have_load_cfg = 1;
+ /*
+ * Exporting this variable would be nice, but the export command
+ * is not part of the rescue shell, so that won't work.
+ */
+ fprintf (load_cfg_f,
+ "set biosdisk_autodetect_sector_size='1'\n");
+ break;
+ default:
+ grub_util_error ("%s", _("native-sector-addressing with "
+ "512-bytes length emulation is not "
+ "supported on your platform"));
+ break;
+ }
+ }
+
char *prefix_drive = NULL;
char *install_drive = NULL;
--
2.25.1
- [PATCH 0/7] support >512b sector disks with old/buggy firmware, Mihai Moldovan, 2020/05/24
- [PATCH 4/7] grub-install: hook up --emu-512b to sector size autodetection in biosdisk,
Mihai Moldovan <=
- [PATCH 6/7] diskfilter: write out currently scanned partition, Mihai Moldovan, 2020/05/24
- [PATCH 2/7] biosdisk: restore LBA mode after read/write failures, Mihai Moldovan, 2020/05/24
- [PATCH 5/7] docs/grub: document --emu-512b install option, Mihai Moldovan, 2020/05/24
- [PATCH 1/7] biosdisk: autodetect hardware sector size (opt-in), Mihai Moldovan, 2020/05/24
- [PATCH 7/7] gpt: respect native sector size if set/detected, Mihai Moldovan, 2020/05/24
- [PATCH 3/7] setup: add support for native sector addressing w/ 512-bytes lengths, Mihai Moldovan, 2020/05/24