Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Dec 2019 13:31:50 +0400
From:      Gleb Popov <arrowd@freebsd.org>
To:        Matthew Seaman <matthew@freebsd.org>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Scripting bsdinstall
Message-ID:  <CALH631n23WTeJgZma3Mi5i6-8fvymCA9sVh4hD1JVsMt6hDrMw@mail.gmail.com>
In-Reply-To: <CALH631mswuj3xXJ8O96PKCBZUpBUWJ%2Bg0CsP0Cr7GTi1BbLS9w@mail.gmail.com>
References:  <CALH631=S0d9kmYRNrG5PVg9rqUF80Ko_Z5DsP=9dGKQKodW5Hg@mail.gmail.com> <96ecfc02-04f6-7222-4582-3740c505c7e5@FreeBSD.org> <CALH631mswuj3xXJ8O96PKCBZUpBUWJ%2Bg0CsP0Cr7GTi1BbLS9w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 22, 2019 at 9:47 PM Gleb Popov <arrowd@freebsd.org> wrote:

>
>
> On Sun, Dec 15, 2019 at 4:51 PM Matthew Seaman <matthew@freebsd.org>
> wrote:
>
>> On 15/12/2019 09:52, Gleb Popov wrote:
>> > - How do I setup networking on target machine? Examples propose running
>> > sysrc ifconfig_em0=DHCP, but how do I know interface name?
>>
>> For interfaces, you can just say:
>>
>>   sysrc ifconfig_DEFAULT=DHCP
>>
>> and it will match any interface name that doesn't have a more specific
>> ifconfig setting (so, not lo0).  Only works for IPv4 as far as I can
>> tell -- saying 'ifconfig_DEFAULT_ipv6="inet6 accept_rtadv"' doesn't have
>> the desired effect of enabling SLAAC everywhere.
>>
>
> Great, exactly what I needed, thanks.
>
> I ended up with following script:
>
>
> DISTRIBUTIONS="base.txz kernel.txz lib32.txz"
> export DISTRIBUTIONS
>
> bsdinstall checksum
> bsdinstall hostname
> bsdinstall scriptedpart ada0 gpt { 512K freebsd-boot , 2G freebsd-ufs / ,
> 4G freebsd-swap , 8G freebsd-ufs /var , 4G freebsd-ufs /tmp , auto
> freebsd-ufs /usr }
> bsdinstall mount
> bsdinstall distextract
> bsdinstall config
> bsdinstall entropy
>
> #!/bin/sh
>
> sysrc ifconfig_DEFAULT=DHCP
>
>
> While I feel a bit wrong using `bsdinstall` command in the preamble part,
> but it works pretty nice. However, the script part doesn't seem work. The
> last window I see in the installer is "No root partition is found. The root
> partition must have a mountpoint of /". After I hit OK, the script ends and
> no "sysrc" command is run.
>
> What am I doing wrong now?
>

I had to do all these "bsdinstall" invocations in the preamble because I
wanted to set up partitions in my way. It turned out that the value of
PARTITIONS variable is directly passed to "bsdinstall scriptedpart", so my
installerscript got reduced to

DISTRIBUTIONS="base.txz kernel.txz lib32.txz"
PARTITIONS="ada0 gpt { 512K freebsd-boot , 2G freebsd-ufs / , 4G
freebsd-swap , 8G freebsd-ufs /var , 4G freebsd-ufs /tmp , auto freebsd-ufs
/usr }"

#!/bin/sh

sysrc ifconfig_DEFAULT=DHCP

It now works, and even the second part gets properly executed.

However, no boot loader gets installed. Skimming through "bsdinstall
bootconfig" source reveals that it only supports installing boot files for
UEFI loader. What should I do in case of BIOS?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALH631n23WTeJgZma3Mi5i6-8fvymCA9sVh4hD1JVsMt6hDrMw>