aboutsummaryrefslogtreecommitdiff
path: root/lib/geom
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2018-11-27 14:58:19 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2018-11-27 14:58:19 +0000
commitcdd2df880d0a7796608acc93d68c38cef9818a8d (patch)
tree2de4f693a6d30f0f7e9fa5d628b31d7bcc46c678 /lib/geom
parent9361c4ad4e909cc8756294f99f128df7a41b9a5d (diff)
downloadsrc-cdd2df880d0a7796608acc93d68c38cef9818a8d.tar.gz
src-cdd2df880d0a7796608acc93d68c38cef9818a8d.zip
Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr
from setting the volume serial number. This unbreaks older boot blocks that don't support serial numbers, and allows boot0cfg to set the serial number itself if requested by the user. Submitted by: lev@, yuripv@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17386
Notes
Notes: svn path=/head/; revision=341067
Diffstat (limited to 'lib/geom')
-rw-r--r--lib/geom/part/geom_part.c4
-rw-r--r--lib/geom/part/gpart.89
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/geom/part/geom_part.c b/lib/geom/part/geom_part.c
index 29c066c4714f..b21ebf7ef8d8 100644
--- a/lib/geom/part/geom_part.c
+++ b/lib/geom/part/geom_part.c
@@ -72,6 +72,7 @@ volatile sig_atomic_t undo_restore;
#define GPART_PARAM_BOOTCODE "bootcode"
#define GPART_PARAM_INDEX "index"
#define GPART_PARAM_PARTCODE "partcode"
+#define GPART_PARAM_SKIP_DSN "skip_dsn"
static struct gclass *find_class(struct gmesh *, const char *);
static struct ggeom * find_geom(struct gclass *, const char *);
@@ -115,8 +116,9 @@ struct g_command PUBSYM(class_commands)[] = {
{ 'p', GPART_PARAM_PARTCODE, G_VAL_OPTIONAL, G_TYPE_STRING },
{ 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER },
{ 'f', "flags", GPART_FLAGS, G_TYPE_STRING },
+ { 'N', GPART_PARAM_SKIP_DSN, NULL, G_TYPE_BOOL },
G_OPT_SENTINEL },
- "[-b bootcode] [-p partcode -i index] [-f flags] geom"
+ "[-N] [-b bootcode] [-p partcode -i index] [-f flags] geom"
},
{ "commit", 0, gpart_issue, G_NULL_OPTS,
"geom"
diff --git a/lib/geom/part/gpart.8 b/lib/geom/part/gpart.8
index 76177892ceb1..80ea0a317d3a 100644
--- a/lib/geom/part/gpart.8
+++ b/lib/geom/part/gpart.8
@@ -49,6 +49,7 @@
.\" ==== BOOTCODE ====
.Nm
.Cm bootcode
+.Op Fl N
.Op Fl b Ar bootcode
.Op Fl p Ar partcode Fl i Ar index
.Op Fl f Ar flags
@@ -214,6 +215,14 @@ The
.Cm bootcode
command accepts these options:
.Bl -tag -width 10n
+.It Fl N
+Don't preserve the Volume Serial Number for MBR.
+MBR bootcode contains Volume Serial Number by default, and
+.Nm
+tries to preserve it when installing new bootstrap code.
+This option allows to skip the preservation to help with some versions of
+.Xr boot0 8
+that don't support Volume Serial Number.
.It Fl b Ar bootcode
Embed bootstrap code from the file
.Ar bootcode