Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/embedded/files Can't use disklabel to find the...



details:   https://anonhg.NetBSD.org/src/rev/a7ed237b31a3
branches:  trunk
changeset: 373913:a7ed237b31a3
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Mar 18 11:36:23 2023 +0000

description:
Can't use disklabel to find the real size of a disk since a fake disklabel
read from disk is trusted. Revert to use drvctl again.

diffstat:

 distrib/utils/embedded/files/resize_disklabel |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r d5bf41f1de93 -r a7ed237b31a3 distrib/utils/embedded/files/resize_disklabel
--- a/distrib/utils/embedded/files/resize_disklabel     Fri Mar 17 17:16:06 2023 +0000
+++ b/distrib/utils/embedded/files/resize_disklabel     Sat Mar 18 11:36:23 2023 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: resize_disklabel,v 1.4 2023/02/18 07:58:34 mlelstv Exp $
+# $NetBSD: resize_disklabel,v 1.5 2023/03/18 11:36:23 mlelstv Exp $
 #
 
 # PROVIDE: resize_disklabel
@@ -27,8 +27,7 @@
        local disk
 
        disk=$1
-       /sbin/disklabel -t "$disk" \
-       | sed -ne 's/.*:su#\([0-9]*\):.*/\1/p'
+       /sbin/drvctl -p "$disk" disk-info/geometry/sectors-per-unit
 }
 
 get_rawpart_sectors()



Home | Main Index | Thread Index | Old Index