Date: Sun, 15 Dec 2019 18:54:44 +0300 From: Mehmet Erol Sanliturk <m.e.sanliturk@gmail.com> To: Matthew Seaman <matthew@freebsd.org> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: Scripting bsdinstall Message-ID: <CAOgwaMtTC9PSHqPiHTkiTrDtgVxgSMF_zJT4QGRmRE3dCpVLsg@mail.gmail.com> In-Reply-To: <96ecfc02-04f6-7222-4582-3740c505c7e5@FreeBSD.org> References: <CALH631=S0d9kmYRNrG5PVg9rqUF80Ko_Z5DsP=9dGKQKodW5Hg@mail.gmail.com> <96ecfc02-04f6-7222-4582-3740c505c7e5@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 15, 2019 at 3: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. > > > - Same question goes for target drive. In most cases it is ada0, but how > do > > I dynamically find it out? > > This one is trickier. You can't feasibly write a generic zero-knowledge > install script: there are too many variables to deal with. Basically > you're going to have to assume some knowledge about what disks are > present in your systems and how they are connected. > > If you know you're always going to be attaching your drives to an > on-board SAS controller, then /dev/ada0 is the right choice. > > If you need to handle systems with larger numbers of drives which may be > hanging off various different flavours of host bus adaptor or RAID > controller and you need to create (for example) some complicated ZPOOL > of multiple vdevs with hot spares and separate intent log or cache > devices; well, perhaps in that case aim for a basic single-disk install > (perhaps on a temporary device like a USB stick), get the minimal system > up and then script building your more complex storage solutions from > within that self-hosted and running system where you have the full power > of the shell and all the normal management tools available to you. > > Cheers, > > Matthew > Let's assume that you are not writing a sufficiently expert script that in its first attempt to install into a new machine it should be successful ( because it is more involved and some decisions may be very difficult to make ) . Prepare a simple boot able .iso or USB stick . Boot that system in your target machine . Make a , for example a JSON , file storing devices in the computer ( if it is possible with their hardware addresses ) . Record that file into a medium which can be supplied to the actual install .iso or other medium . Define some variables ( known to your script ) and containing addresses about existing devices . By supplying these variables with their related data as a file to your script in a "known" place by your script may solve your problem . By using your definition file , you may install in the similar machines easily . You may copy that definition file and modify some values to use it in other machines You may use the same definition file for repeated installs in the same machine . When Mandriva Linux was managed by its French company , there was a similar application : Into a diskette a file was stored and then used for installation parameters in new installs . Thank you very much . Mehmet Erol Sanliturk You can
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOgwaMtTC9PSHqPiHTkiTrDtgVxgSMF_zJT4QGRmRE3dCpVLsg>