Date: Wed, 4 Jan 2023 20:05:48 GMT From: Mike Karels <karels@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 0e2fdab227a1 - main - growfs script: fix config-dependent errors Message-ID: <202301042005.304K5mAU059531@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=0e2fdab227a1e02956271e5a15403d1408de1eed commit 0e2fdab227a1e02956271e5a15403d1408de1eed Author: Mike Karels <karels@FreeBSD.org> AuthorDate: 2023-01-04 18:25:54 +0000 Commit: Mike Karels <karels@FreeBSD.org> CommitDate: 2023-01-04 20:05:35 +0000 growfs script: fix config-dependent errors - awk sometimes formatted swapbase as floating point, which gpart does not accept; force int. - Fix typo in code for checking vm.max_swap_pages. - While here, do not set kernel env if "gpart add" fails. - Add "gpart show" before modification to verbose output. Reported by: marklmi at yahoo dot com Tested by: marklmi at yahoo dot com --- libexec/rc/rc.d/growfs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/growfs b/libexec/rc/rc.d/growfs index 3c738e24177e..4cd4f19c8eac 100755 --- a/libexec/rc/rc.d/growfs +++ b/libexec/rc/rc.d/growfs @@ -89,7 +89,7 @@ growfs_swap_max() if [ $swapmax -gt $vm_swap_max ] then - $swapmax=$vm_swap_max + swapmax=$vm_swap_max fi echo -n "$swapmax" } @@ -260,9 +260,9 @@ growfs_start() " sz ", size[i] swapbase = (expand + size[i]) / sector swapbase -= swapsize + align - swapcmd = "gpart add -t freebsd-swap -a " align " -b " swapbase " " pdev "; kenv growfs_swap_pdev=" pdev " >/dev/null; " + swapcmd = "gpart add -t freebsd-swap -a " align " -b " int(swapbase) " " pdev " && kenv growfs_swap_pdev=" pdev " >/dev/null; " if (verbose) - swapcmd = "set -x; " swapcmd + swapcmd = "set -x; gpart show; " swapcmd } cmd[i] = swapcmd "gpart resize -i " idx[i] " " pdev if (parttype[i] == "GPT")
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301042005.304K5mAU059531>