This commit is contained in:
purplerain 2023-05-15 03:54:51 +00:00
parent 0f55503fed
commit ab90ba3a7c
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
92 changed files with 264 additions and 259 deletions

View file

@ -176,7 +176,7 @@ gpt_chk_mbr(struct dos_partition *dp, u_int64_t dsize)
}
/*
* Try to find the disk address of the first MBR OpenBSD partition.
* Try to find the disk address of the first MBR SecBSD partition.
*
* N.B.: must boot from a partition within first 2^32-1 sectors!
*
@ -210,7 +210,7 @@ again:
return (-1);
}
/* Search for OpenBSD partition */
/* Search for SecBSD partition */
nextebr = 0;
for (i = 0; i < NDOSPART; i++) {
dp = &mbr.dmbr_parts[i];
@ -253,7 +253,7 @@ again:
}
/*
* Try to find the disk address of the first GPT OpenBSD partition.
* Try to find the disk address of the first GPT SecBSD partition.
*
* N.B.: must boot from a partition within first 2^32-1 sectors!
*
@ -275,7 +275,7 @@ findopenbsd_gpt(efi_diskinfo_t ed, const char **err)
static struct uuid *openbsd_uuid = NULL, openbsd_uuid_space;
static u_char buf[4096];
/* Prepare OpenBSD UUID */
/* Prepare SecBSD UUID */
if (openbsd_uuid == NULL) {
/* XXX: should be replaced by uuid_dec_be() */
memcpy(&openbsd_uuid_space, openbsd_uuid_code,
@ -368,7 +368,7 @@ findopenbsd_gpt(efi_diskinfo_t ed, const char **err)
lba = letoh64(gp.gp_lba_start);
/* Bootloaders do not current handle addresses > UINT_MAX! */
if (lba > UINT_MAX || EFI_SECTOBLK(ed, lba) > UINT_MAX) {
*err = "OpenBSD Partition LBA > 2**32 - 1";
*err = "SecBSD Partition LBA > 2**32 - 1";
return (-1);
}
return (u_int)lba;
@ -414,14 +414,14 @@ efi_getdisklabel(efi_diskinfo_t ed, struct disklabel *label)
if (start == (u_int)-1) {
if (err != NULL)
return (err);
return ("no OpenBSD GPT partition");
return ("no SecBSD GPT partition");
}
} else {
start = findopenbsd(ed, &err);
if (start == (u_int)-1) {
if (err != NULL)
return (err);
return "no OpenBSD MBR partition\n";
return "no SecBSD MBR partition\n";
}
}

View file

@ -548,11 +548,11 @@ sr_getdisklabel(struct sr_boot_volume *bv, struct disklabel *label)
if (start == (u_int)-1) {
if (err != NULL)
return (err);
return "no OpenBSD partition\n";
return "no SecBSD partition\n";
}
} else if (mbr.dmbr_sign == DOSMBR_SIGNATURE) {
/* Search for OpenBSD partition */
/* Search for SecBSD partition */
for (i = 0; i < NDOSPART; i++) {
dp = &mbr.dmbr_parts[i];
if (!dp->dp_size)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: vnd.c,v 1.180 2023/03/08 04:43:08 guenther Exp $ */
/* $OpenBSD: vnd.c,v 1.181 2023/05/14 18:34:02 krw Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@ -85,6 +85,7 @@ struct vnd_softc {
char sc_file[VNDNLEN]; /* file we're covering */
int sc_flags; /* flags */
uint16_t sc_type; /* d_type we are emulating */
size_t sc_size; /* size of vnd in sectors */
size_t sc_secsize; /* sector size in bytes */
size_t sc_nsectors; /* # of sectors per track */
@ -224,7 +225,7 @@ vndgetdisklabel(dev_t dev, struct vnd_softc *sc, struct disklabel *lp,
lp->d_ncylinders = sc->sc_size / lp->d_secpercyl;
strncpy(lp->d_typename, "vnd device", sizeof(lp->d_typename));
lp->d_type = DTYPE_VND;
lp->d_type = sc->sc_type;
strncpy(lp->d_packname, "fictitious", sizeof(lp->d_packname));
DL_SETDSIZE(lp, sc->sc_size);
lp->d_version = 1;
@ -502,6 +503,7 @@ fail:
}
/* Set geometry for device. */
sc->sc_type = vio->vnd_type;
sc->sc_secsize = vio->vnd_secsize;
sc->sc_ntracks = vio->vnd_ntracks;
sc->sc_nsectors = vio->vnd_nsectors;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: vndioctl.h,v 1.11 2019/11/18 22:32:45 jca Exp $ */
/* $OpenBSD: vndioctl.h,v 1.12 2023/05/14 18:34:02 krw Exp $ */
/* $NetBSD: vndioctl.h,v 1.5 1995/01/25 04:46:30 cgd Exp $ */
/*
@ -48,13 +48,14 @@
* Ioctl definitions for file (vnode) disk pseudo-device.
*/
struct vnd_ioctl {
char *vnd_file; /* pathname of file to mount */
size_t vnd_secsize; /* sector size in bytes */
size_t vnd_nsectors; /* number of sectors in a track */
size_t vnd_ntracks; /* number of tracks per cylinder (i.e. heads) */
off_t vnd_size; /* (returned) size of disk */
u_char *vnd_key;
int vnd_keylen;
char *vnd_file; /* pathname of file to mount */
size_t vnd_secsize; /* sector size in bytes */
size_t vnd_nsectors; /* number of sectors in a track */
size_t vnd_ntracks; /* number of tracks per cylinder */
off_t vnd_size; /* (returned) size of disk */
u_char *vnd_key;
int vnd_keylen;
uint16_t vnd_type; /* DTYPE being emulated */
};
/*