Re: bsdinstall/scriptedpart could not run ;-(

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 15 Nov 2023 16:17:31 UTC
On 11/12/23 11:00 PM, KIRIYAMA Kazuhiko wrote:
> Hi, all
> 
> I usually run bsdinstall by instllerconfig, but
> bsdinstall/scriptedpart could not run ;-(
> 
> My installerconfig is:
> 
> PARTITIONS='nda0 gpt { 200M efi, 804G freebsd-ufs /, 128G freebsd-swap }'
> DISTRIBUTIONS='base.txz kernel-dbg.txz kernel.txz lib32.txz tests.txz'
> ZFSBOOT_DISKS=""
> 
> #!/bin/sh
> /bin/mkdir -p /.dake
> /bin/cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
> /bin/cp /root/.cshrc /root/.cshrc.org
> /bin/cat <<EOF >> /etc/fstab
> 192.168.1.17:/.dake	/.dake		nfs	rw	0	0
> EOF
> sed -i".bak" -Ee '/^#BDS_install.sh_added:start_line$/,/^#BDS_install.sh_added:end_line$/d' /root/.cshrc
> /bin/cat <<'EOF' >> /root/.cshrc
> #BDS_install.sh_added:start_line
> setenv	PATH		${PATH}:/.dake/bin
> setenv	MGRHOME		/usr/home/admin
> setenv	OPENTOOLSDIR	/.dake
> setenv	DAKEDIR		/.dake
> #BDS_install.sh_added:end_line
> EOF
>    :
> (snip)
>    :
> 
> I investigated in bsdinstall script and found scriptedpart
> which acutually run partedit with scriptedpart would not be
> destroy existing partition. In fact scriptedpart -> partedit
> changed in script as follows, then parttion editor run at
> terminal.

My guess is something to do with commit 23099099196548550461ba427dcf09dcfb01878d,
though I don't see how it could work any differently in this case as the only
change to part_config there was to return if if geom_gettree fails, and if it
fails, provider_for_name would presumably have failed anyway.

-- 
John Baldwin