aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2023-07-26 11:08:37 +0000
committerMarius Strobl <marius@FreeBSD.org>2023-07-26 11:16:12 +0000
commit4ef1c6f75d25ba0c264ab274a1b449467a6ee817 (patch)
tree2b890b542708993509d979de5bb543a9633b66e7 /stand
parent29fe5efc8aad3b283f2f53f24dc8ee3f3d0d6a58 (diff)
downloadsrc-4ef1c6f75d25ba0c264ab274a1b449467a6ee817.tar.gz
src-4ef1c6f75d25ba0c264ab274a1b449467a6ee817.zip
base: Remove support for the VTOC8 partitioning scheme
The removal of the sparc64 support in February 2020 obsoleted the VTOC8 partitioning scheme as no other FreeBSD platform makes use of it. Moreover, the code is bitrotting as nothing defines e. g. LOADER_VTOC8_SUPPORT any more and, thus, should go now, too. With this change, the following commits are reverted as far as VTOC8 is concerned and parts haven't already previously been deleted along with prior sparc64 removals: 094fcb157d4c98211899cf09d06e2cf19149b7e0 a7d366e9589c95feda6f3bc78c59c6355d51f126 ba8d50d08b9df4e8213f9a6997ff6792ecebcd9b The alignment example d9711c28efc4ec89ba5ea11f8fd63e9d0a7fc81b added to the VTOC8 section of gpart.8 is folded into the MBR one. This should finally conclude the deorbit of sparc64-specific bits. We had joy, we had fun we ran Unix on a Sun. But that source and the song of FreeBSD have all gone. Credits to Michael Bueker for the original "Unix on a Sun" and Rod McKuen for the "Seasons in the Sun" lyrics.
Diffstat (limited to 'stand')
-rw-r--r--stand/common/part.c100
-rw-r--r--stand/common/part.h1
2 files changed, 0 insertions, 101 deletions
diff --git a/stand/common/part.c b/stand/common/part.c
index 4ae38bfb7682..90d7855b53ff 100644
--- a/stand/common/part.c
+++ b/stand/common/part.c
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include <sys/gpt.h>
#include <sys/stddef.h>
#include <sys/queue.h>
-#include <sys/vtoc.h>
#include <fs/cd9660/iso.h>
@@ -70,7 +69,6 @@ struct pentry {
uint8_t bsd;
uint8_t mbr;
uuid_t gpt;
- uint16_t vtoc8;
} type;
STAILQ_ENTRY(pentry) entry;
};
@@ -519,88 +517,6 @@ out:
return (table);
}
-#ifdef LOADER_VTOC8_SUPPORT
-static enum partition_type
-vtoc8_parttype(uint16_t type)
-{
-
- switch (type) {
- case VTOC_TAG_FREEBSD_SWAP:
- return (PART_FREEBSD_SWAP);
- case VTOC_TAG_FREEBSD_UFS:
- return (PART_FREEBSD_UFS);
- case VTOC_TAG_FREEBSD_VINUM:
- return (PART_FREEBSD_VINUM);
- case VTOC_TAG_FREEBSD_ZFS:
- return (PART_FREEBSD_ZFS);
- }
- return (PART_UNKNOWN);
-}
-
-static struct ptable *
-ptable_vtoc8read(struct ptable *table, void *dev, diskread_t dread)
-{
- struct pentry *entry;
- struct vtoc8 *dl;
- uint8_t *buf;
- uint16_t sum, heads, sectors;
- int i;
-
- if (table->sectorsize != sizeof(struct vtoc8))
- return (table);
- buf = malloc(table->sectorsize);
- if (buf == NULL)
- return (table);
- if (dread(dev, buf, 1, 0) != 0) {
- DPRINTF("read failed");
- ptable_close(table);
- table = NULL;
- goto out;
- }
- dl = (struct vtoc8 *)buf;
- /* Check the sum */
- for (i = sum = 0; i < sizeof(struct vtoc8); i += sizeof(sum))
- sum ^= be16dec(buf + i);
- if (sum != 0) {
- DPRINTF("incorrect checksum");
- goto out;
- }
- if (be16toh(dl->nparts) != VTOC8_NPARTS) {
- DPRINTF("invalid number of entries");
- goto out;
- }
- sectors = be16toh(dl->nsecs);
- heads = be16toh(dl->nheads);
- if (sectors * heads == 0) {
- DPRINTF("invalid geometry");
- goto out;
- }
- DPRINTF("VTOC8 detected");
- for (i = 0; i < VTOC8_NPARTS; i++) {
- dl->part[i].tag = be16toh(dl->part[i].tag);
- if (i == VTOC_RAW_PART ||
- dl->part[i].tag == VTOC_TAG_UNASSIGNED)
- continue;
- entry = malloc(sizeof(*entry));
- if (entry == NULL)
- break;
- entry->part.start = be32toh(dl->map[i].cyl) * heads * sectors;
- entry->part.end = be32toh(dl->map[i].nblks) +
- entry->part.start - 1;
- entry->part.type = vtoc8_parttype(dl->part[i].tag);
- entry->part.index = i; /* starts from zero */
- entry->type.vtoc8 = dl->part[i].tag;
- STAILQ_INSERT_TAIL(&table->entries, entry, entry);
- DPRINTF("new VTOC8 partition added");
- }
- table->type = PTABLE_VTOC8;
-out:
- free(buf);
- return (table);
-
-}
-#endif /* LOADER_VTOC8_SUPPORT */
-
#define cdb2devb(bno) ((bno) * ISO_DEFAULT_BLOCK_SIZE / table->sectorsize)
static struct ptable *
@@ -678,16 +594,6 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize,
} else if (table->type == PTABLE_ISO9660)
goto out;
-#ifdef LOADER_VTOC8_SUPPORT
- if (be16dec(buf + offsetof(struct vtoc8, magic)) == VTOC_MAGIC) {
- if (ptable_vtoc8read(table, dev, dread) == NULL) {
- /* Read error. */
- table = NULL;
- goto out;
- } else if (table->type == PTABLE_VTOC8)
- goto out;
- }
-#endif
/* Check the BSD label. */
if (ptable_bsdread(table, dev, dread) == NULL) { /* Read error. */
table = NULL;
@@ -929,12 +835,6 @@ ptable_iterate(const struct ptable *table, void *arg, ptable_iterate_t *iter)
sprintf(name, "p%d", entry->part.index);
else
#endif
-#ifdef LOADER_VTOC8_SUPPORT
- if (table->type == PTABLE_VTOC8)
- sprintf(name, "%c", (uint8_t) 'a' +
- entry->part.index);
- else
-#endif
if (table->type == PTABLE_BSD)
sprintf(name, "%c", (uint8_t) 'a' +
entry->part.index);
diff --git a/stand/common/part.h b/stand/common/part.h
index b991ae3c381c..68acce22cb06 100644
--- a/stand/common/part.h
+++ b/stand/common/part.h
@@ -36,7 +36,6 @@ enum ptable_type {
PTABLE_BSD,
PTABLE_MBR,
PTABLE_GPT,
- PTABLE_VTOC8,
PTABLE_ISO9660
};