Module Name: src
Committed By: jnemeth
Date: Tue Sep 9 06:30:09 UTC 2014
Modified Files:
src/sbin/gpt: backup.c
Log Message:
- record the sector size of the disk
- correct confusion with end_cylinder and end_sector in MBRs
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/gpt/backup.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/gpt/backup.c
diff -u src/sbin/gpt/backup.c:1.1 src/sbin/gpt/backup.c:1.2
--- src/sbin/gpt/backup.c:1.1 Thu Dec 19 06:46:51 2013
+++ src/sbin/gpt/backup.c Tue Sep 9 06:30:09 2014
@@ -29,7 +29,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $");
#endif
#ifdef __RCSID
-__RCSID("$NetBSD: backup.c,v 1.1 2013/12/19 06:46:51 jnemeth Exp $");
+__RCSID("$NetBSD: backup.c,v 1.2 2014/09/09 06:30:09 jnemeth Exp $");
#endif
#include <sys/bootblock.h>
@@ -82,6 +82,10 @@ backup(void)
props = prop_dictionary_create();
PROP_ERR(props);
+ propnum = prop_number_create_integer(secsz);
+ PROP_ERR(propnum);
+ rc = prop_dictionary_set(props, "sector_size", propnum);
+ PROP_ERR(rc);
m = map_first();
while (m != NULL) {
switch (m->map_type) {
@@ -139,6 +143,11 @@ backup(void)
propnum = prop_number_create_unsigned_integer(mbr->mbr_part[i].part_esect);
PROP_ERR(propnum);
rc = prop_dictionary_set(mbr_dict,
+ "end_sector", propnum);
+ PROP_ERR(rc);
+ propnum = prop_number_create_unsigned_integer(mbr->mbr_part[i].part_ecyl);
+ PROP_ERR(propnum);
+ rc = prop_dictionary_set(mbr_dict,
"end_cylinder", propnum);
PROP_ERR(rc);
propnum = prop_number_create_unsigned_integer(le16toh(mbr->mbr_part[i].part_start_lo));