Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/gpt - record the sector size of the disk
details: https://anonhg.NetBSD.org/src/rev/94bc19b61472
branches: trunk
changeset: 332150:94bc19b61472
user: jnemeth <jnemeth%NetBSD.org@localhost>
date: Tue Sep 09 06:30:09 2014 +0000
description:
- record the sector size of the disk
- correct confusion with end_cylinder and end_sector in MBRs
diffstat:
sbin/gpt/backup.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diffs (35 lines):
diff -r 512ad6c15596 -r 94bc19b61472 sbin/gpt/backup.c
--- a/sbin/gpt/backup.c Tue Sep 09 06:18:17 2014 +0000
+++ b/sbin/gpt/backup.c Tue Sep 09 06:30:09 2014 +0000
@@ -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 @@
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 @@
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));
Home |
Main Index |
Thread Index |
Old Index