From owner-freebsd-hackers@freebsd.org Sun Dec 15 15:55:24 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B0171EF8D0 for ; Sun, 15 Dec 2019 15:55:24 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bTWc2kMZz4dpS; Sun, 15 Dec 2019 15:55:24 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: by mail-lj1-x22a.google.com with SMTP id e28so3991791ljo.9; Sun, 15 Dec 2019 07:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Aw0XRE9SZOuhMSIr1lMM4NdEfJsmu3A8ev4kM3lTai0=; b=fjG7fzb8eOF6uJlZYIq5jY6WlL56F/PdC1A5EShX0tqmg0pw7rKTi8CIPG+QqH0oeD jI/tGAmcH+rhIOxu9OMQMsJVkilvgn1JvwXqwv08v5Hw5lKd3SY3GkU96CUdKTZiduEA KMlAzr6gIvOQyoMQ4eJ/pUEHeQYWtYGSCEbA1Zg8L3tNBxaeSLlsYoUlK+Rm0RhlGuXz 2PTV+rzzOETTzynfm4dapmRvxDdglhpoOA8vJRSfyYKh42gjB/Q2fgg2KLTPAposLE8o RfGRpbJJt7svyYSftjA/PRlTO9z8QP/cOBErdsgD+61mgJ4Pek5WZnJ7dbctZM69BAdW W10A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Aw0XRE9SZOuhMSIr1lMM4NdEfJsmu3A8ev4kM3lTai0=; b=A427DJIZxEExzJRfIssUDLJBw/7rHP+sgcu9iqr6LCLubosrp2NHnRbl9oXKXl5g1+ mbV3xv4WRiLE/GRU2vbnYo1rSid8iT6NyHTHGotq4UWs8cpRzGlyNG5bIYiaK7XUax/Y WYNwmfHlOkojda5NdspPdrl0kP81cLxd5o0iJqpKfXZZzPtoxfyX8B4x4cLzPh35+ObB O8b078QOtWGNd8afLIlOMfiUS79ERaNAD90frPYjBqvGCfxv8CDD04whalzOniIOH6tV c2eJXTuqWgScmQQFwLnEaa9DYPgxBnBx5En3+5I6sDm0XKOKwa90H3Y/hh6s4zl2V9OT av8A== X-Gm-Message-State: APjAAAVWARfuUhDhWO23yGFaUqQHXikl3tKxCwzdKk5uTx150Aj5Fl3Q 88cuI5BiDDSrChmL7e8IN8XFajUPJoZYfgd/66y1Kw== X-Google-Smtp-Source: APXvYqy99hg6iXIgVY0OFqtF3kjnho3v7/HEbhwHYPDcY5yOSvSiTLI0Gtnziu5M64NSRA2fX8IAFNzTzuERDDL7Bb8= X-Received: by 2002:a2e:9e16:: with SMTP id e22mr15745722ljk.220.1576425320591; Sun, 15 Dec 2019 07:55:20 -0800 (PST) MIME-Version: 1.0 References: <96ecfc02-04f6-7222-4582-3740c505c7e5@FreeBSD.org> In-Reply-To: <96ecfc02-04f6-7222-4582-3740c505c7e5@FreeBSD.org> From: Mehmet Erol Sanliturk Date: Sun, 15 Dec 2019 18:54:44 +0300 Message-ID: Subject: Re: Scripting bsdinstall To: Matthew Seaman Cc: FreeBSD Hackers X-Rspamd-Queue-Id: 47bTWc2kMZz4dpS X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 15:55:24 -0000 On Sun, Dec 15, 2019 at 3:51 PM Matthew Seaman 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