Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/utils/embedded resize_disklabel: if disk and partiti...
details: https://anonhg.NetBSD.org/src/rev/f08862ed0295
branches: trunk
changeset: 433809:f08862ed0295
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Oct 06 09:58:55 2018 +0000
description:
resize_disklabel: if disk and partition is not specified, use kern.root_device/kern.root_partition sysctls
diffstat:
distrib/utils/embedded/conf/evbarm.conf | 4 +---
distrib/utils/embedded/files/resize_disklabel | 8 +++-----
2 files changed, 4 insertions(+), 8 deletions(-)
diffs (44 lines):
diff -r b89be1cf0418 -r f08862ed0295 distrib/utils/embedded/conf/evbarm.conf
--- a/distrib/utils/embedded/conf/evbarm.conf Sat Oct 06 00:17:06 2018 +0000
+++ b/distrib/utils/embedded/conf/evbarm.conf Sat Oct 06 09:58:55 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.28 2018/06/19 15:12:05 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.29 2018/10/06 09:58:55 jmcneill Exp $
# evbarm shared config
#
image=$HOME/${board}.img
@@ -138,8 +138,6 @@
if $resize; then
cat >> ${mnt}/etc/rc.conf << EOF
resize_disklabel=YES
-resize_disklabel_disk=ld0
-resize_disklabel_part=a
resize_root=YES
resize_root_flags="-p"
resize_root_postcmd="/sbin/reboot -n"
diff -r b89be1cf0418 -r f08862ed0295 distrib/utils/embedded/files/resize_disklabel
--- a/distrib/utils/embedded/files/resize_disklabel Sat Oct 06 00:17:06 2018 +0000
+++ b/distrib/utils/embedded/files/resize_disklabel Sat Oct 06 09:58:55 2018 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: resize_disklabel,v 1.2 2017/04/14 13:47:21 jmcneill Exp $
+# $NetBSD: resize_disklabel,v 1.3 2018/10/06 09:58:55 jmcneill Exp $
#
# PROVIDE: resize_disklabel
@@ -80,12 +80,10 @@
resize_disklabel_start()
{
if [ x"${resize_disklabel_disk}" = "x" ]; then
- warn "\${resize_disklabel_disk} is not set, not resizing disklabel"
- return
+ resize_disklabel_disk="$(/sbin/sysctl -n kern.root_device)"
fi
if [ x"${resize_disklabel_part}" = "x" ]; then
- warn "\${resize_disklabel_part} is not set, not resizing disklabel"
- return
+ resize_disklabel_part=$(printf \\$(printf '%03o' $(( 97 + $(sysctl -n kern.root_partition) ))))
fi
grow_mbrpart "${resize_disklabel_disk}"
Home |
Main Index |
Thread Index |
Old Index