Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102169585
D31587.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31587.diff
View Options
diff --git a/libexec/rc/rc.d/growfs b/libexec/rc/rc.d/growfs
--- a/libexec/rc/rc.d/growfs
+++ b/libexec/rc/rc.d/growfs
@@ -48,6 +48,19 @@
stop_cmd=":"
rcvar="growfs_enable"
+growfs_get_diskdev ()
+{
+ local _search=${1}
+ sysctl -b kern.geom.conftxt |
+ while read x1 _type _dev line
+ do
+ if [ "${_type}" = "DISK" -a -n "$(echo ${_search} | grep ${_dev})" ]; then
+ echo -n ${_dev}
+ break
+ fi
+ done
+}
+
growfs_start ()
{
echo "Growing root partition to fill device"
@@ -69,13 +82,24 @@
# raw device
rawdev="$rootdev"
else
- rawdev=$(glabel status | awk '$1 == "'"$rootdev"'" { print $3 }')
+ rawdev=$(glabel status | awk -v rootdev=$rootdev 'index(rootdev, $1) { print $3; }')
if [ x"$rawdev" = x"" ]; then
echo "Can't figure out device for: $rootdev"
return
fi
fi
+ if [ x"diskid" = x"${rootdev%/*}" ]; then
+ search=$rootdev
+ else
+ search=$rawdev
+ fi
+
+ diskdev=$(growfs_get_diskdev ${search})
+ if [ -z "${diskdev}" ]; then
+ diskdev=${rootdev}
+ fi
+
sysctl -b kern.geom.conftxt | awk '
{
lvl=$1
@@ -104,8 +128,8 @@
}
exit 0
}
-}' dev="$rawdev"
- gpart commit "$rootdev"
+}' dev="$search"
+ gpart commit "$diskdev" 2> /dev/null
case "$FSTYPE" in
ufs)
growfs -y /dev/"$rootdev"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 11:31 AM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14558373
Default Alt Text
D31587.diff (1 KB)
Attached To
Mode
D31587: Improvements to growfs rc script
Attached
Detach File
Event Timeline
Log In to Comment