aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libefi
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-06-03 23:34:27 +0200
committerBrian Behlendorf <[email protected]>2021-06-09 17:03:42 -0700
commitd406a695c640dd93f49f8dcb532bfa0394ad1812 (patch)
treefaf2c920d1d601dc7271c57ff71d34a936757951 /lib/libefi
parent4b7ed6a286c3c92e34f2941dafd822cfa6a880dd (diff)
libefi: remove efi_auto_sense()
It's present (but undocumented) in the illumos gate and used exclusively by rmformat(1) (which I recommend as a nice blast from the past), and also the math assumes 512B sectors and is therefore wrong Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12191
Diffstat (limited to 'lib/libefi')
-rw-r--r--lib/libefi/rdwr_efi.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/libefi/rdwr_efi.c b/lib/libefi/rdwr_efi.c
index 1e022cc8e..39b3509a5 100644
--- a/lib/libefi/rdwr_efi.c
+++ b/lib/libefi/rdwr_efi.c
@@ -1692,57 +1692,3 @@ efi_err_check(struct dk_gpt *vtoc)
"no reserved partition found\n");
}
}
-
-/*
- * We need to get information necessary to construct a *new* efi
- * label type
- */
-int
-efi_auto_sense(int fd, struct dk_gpt **vtoc)
-{
-
- int i;
-
- /*
- * Now build the default partition table
- */
- if (efi_alloc_and_init(fd, EFI_NUMPAR, vtoc) != 0) {
- if (efi_debug) {
- (void) fprintf(stderr, "efi_alloc_and_init failed.\n");
- }
- return (-1);
- }
-
- for (i = 0; i < MIN((*vtoc)->efi_nparts, V_NUMPAR); i++) {
- (*vtoc)->efi_parts[i].p_tag = default_vtoc_map[i].p_tag;
- (*vtoc)->efi_parts[i].p_flag = default_vtoc_map[i].p_flag;
- (*vtoc)->efi_parts[i].p_start = 0;
- (*vtoc)->efi_parts[i].p_size = 0;
- }
- /*
- * Make constants first
- * and variable partitions later
- */
-
- /* root partition - s0 128 MB */
- (*vtoc)->efi_parts[0].p_start = 34;
- (*vtoc)->efi_parts[0].p_size = 262144;
-
- /* partition - s1 128 MB */
- (*vtoc)->efi_parts[1].p_start = 262178;
- (*vtoc)->efi_parts[1].p_size = 262144;
-
- /* partition -s2 is NOT the Backup disk */
- (*vtoc)->efi_parts[2].p_tag = V_UNASSIGNED;
-
- /* partition -s6 /usr partition - HOG */
- (*vtoc)->efi_parts[6].p_start = 524322;
- (*vtoc)->efi_parts[6].p_size = (*vtoc)->efi_last_u_lba - 524322
- - (1024 * 16);
-
- /* efi reserved partition - s9 16K */
- (*vtoc)->efi_parts[8].p_start = (*vtoc)->efi_last_u_lba - (1024 * 16);
- (*vtoc)->efi_parts[8].p_size = (1024 * 16);
- (*vtoc)->efi_parts[8].p_tag = V_RESERVED;
- return (0);
-}