From a4c6003bc2ab2a3702a1a825489f450d68629619 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 30 Mar 2020 12:16:19 +0200 Subject: [PATCH] Revert "use freebsd built in growfs script (#3810)" Breaks our default Nano image growfs, the only use case we have. This reverts commit 7fe5fe52dcc948d8988f995905efeab8d96af144. This reverts commit 16efb9aa348124b1d5d9755f40c67df8124698ba. --- src/etc/rc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/etc/rc b/src/etc/rc index 5dedf709f..eb7651994 100755 --- a/src/etc/rc +++ b/src/etc/rc @@ -69,6 +69,15 @@ while read FS_PART FS_MNT FS_TYPE FS_MORE; do fi FS_DEV=$(echo ${FS_PART} | awk 'match($0, /^\/dev\/(gpt|ufs)\/.+$/) { print substr( $0, RSTART + 5, RLENGTH - 5 )}') + if [ -n "${FS_DEV}" ]; then + FS_DEV=$(glabel status -as | grep ${FS_DEV} | awk 'match($3, /^[a-z]+[0-9]+/) { print substr( $3, RSTART, RLENGTH )}') + if [ "${FS_MNT}" = "/" -a -f ${GROWFS_MARKER} ]; then + # hammertime! + gpart recover ${FS_DEV} + gpart resize -i 1 ${FS_DEV} + growfs -y ${FS_MNT} + fi + fi if [ -z "${FS_DEV}" ]; then FS_DEV=$(echo ${FS_PART} | awk 'match($0, /^\/dev\/[a-z]+[0-9]+/) { print substr( $0, RSTART + 5, RLENGTH - 5 )}') fi @@ -87,11 +96,6 @@ while read FS_PART FS_MNT FS_TYPE FS_MORE; do fi done < /etc/fstab -if [ -f ${GROWFS_MARKER} ]; then - # hammertime! - /etc/rc.d/growfs onestart -fi - attempts=0 while [ ${attempts} -lt 3 ]; do if [ -n "${ROOT_IS_UFS}" ]; then