summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2012-01-13 18:32:56 +0000
committertruckman <truckman@FreeBSD.org>2012-01-13 18:32:56 +0000
commit906ade71853c1e7343dc3e624a90ff9c56cd89d2 (patch)
treee20c1dac1653b6e75c25cdb2eadc5754c61a81c5
parent405e6f5ec553103368fb180c1fb4eeb29ba637ba (diff)
downloadFreeBSD-src-906ade71853c1e7343dc3e624a90ff9c56cd89d2.zip
FreeBSD-src-906ade71853c1e7343dc3e624a90ff9c56cd89d2.tar.gz
Allow an MBR primary or extended Linux swap partition to be specified
as the system dump device. This was already allowed for GPT. The Linux swap metadata at the beginning of the partition should not be disturbed because the crash dump is written at the end. Reviewed by: alfred, pjd, marcel MFC after: 2 weeks
-rw-r--r--sys/geom/part/g_part_ebr.c5
-rw-r--r--sys/geom/part/g_part_mbr.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/geom/part/g_part_ebr.c b/sys/geom/part/g_part_ebr.c
index 85b8a8a..c7657f8 100644
--- a/sys/geom/part/g_part_ebr.c
+++ b/sys/geom/part/g_part_ebr.c
@@ -333,9 +333,10 @@ g_part_ebr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry)
{
struct g_part_ebr_entry *entry;
- /* Allow dumping to a FreeBSD partition only. */
+ /* Allow dumping to a FreeBSD partition or Linux swap partition only. */
entry = (struct g_part_ebr_entry *)baseentry;
- return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0);
+ return ((entry->ent.dp_typ == DOSPTYP_386BSD ||
+ entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0);
}
#if defined(GEOM_PART_EBR_COMPAT)
diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c
index bebdfee..5e73ee0 100644
--- a/sys/geom/part/g_part_mbr.c
+++ b/sys/geom/part/g_part_mbr.c
@@ -304,9 +304,10 @@ g_part_mbr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry)
{
struct g_part_mbr_entry *entry;
- /* Allow dumping to a FreeBSD partition only. */
+ /* Allow dumping to a FreeBSD partition or Linux swap partition only. */
entry = (struct g_part_mbr_entry *)baseentry;
- return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0);
+ return ((entry->ent.dp_typ == DOSPTYP_386BSD ||
+ entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0);
}
static int
OpenPOWER on IntegriCloud