From owner-freebsd-hackers@freebsd.org Fri Dec 27 05:28:08 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 11B331E36FB for ; Fri, 27 Dec 2019 05:28:08 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 47kb2G4LHYz3GBB for ; Fri, 27 Dec 2019 05:28:06 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mail-lf1-f43.google.com with SMTP id r14so19867687lfm.5 for ; Thu, 26 Dec 2019 21:28:06 -0800 (PST) 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=WN4AUJr0zPCVz2Qs4hj1CIAQ7GnuKBS5hwqkrSBiK9M=; b=c8lH9IpWhbQTU2tzoxoZUfg+aBbCRLSxoEksfTcz9I3sDroSCh1KNsDcFzcOllP5wr KlhadH16azhJ9NEK+uQAd+8nQZ6GOaA9zkFRu8n46iGIvzz4zB3KCE5NBbUDxK2q/drz LzkBiIwypmoENRA5SE/WM+MUDCXTrkiFuzdSF1FAgYDEz30ddQLEDfcp+BngzIz6MwL0 np1vrExmGhuEhyfeSIIZ7Z126gBnzbiZxOH9y1VUzQ9zHuyRayITWAnPHw9WmgluM3ez QIjsN9TqmRP9CRipWkqodSNFm3qllyOAdxtTmChztQjlSmTjSjZTbZvNCU23a9tpq3HF lwnA== X-Gm-Message-State: APjAAAWi1iO6+QhL5dg3JHeUE9Oh2E43bvh5ZL4cA9urGL6UaqTBNL6K exB8qfGMori6aVyy7DUKnsPnEKgDXhI= X-Google-Smtp-Source: APXvYqzdEXQM3s7QA5Wrehgv+YNLlK1j13WktKO6F1s9oJ5zVIKq0WuOzOJKC+2h3DVo1g2QhKoadw== X-Received: by 2002:ac2:544f:: with SMTP id d15mr29658691lfn.126.1577424484482; Thu, 26 Dec 2019 21:28:04 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id j22sm13922408lfh.93.2019.12.26.21.28.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Dec 2019 21:28:04 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id l18so11667985lfc.1 for ; Thu, 26 Dec 2019 21:28:03 -0800 (PST) X-Received: by 2002:ac2:4909:: with SMTP id n9mr28698296lfi.21.1577424483654; Thu, 26 Dec 2019 21:28:03 -0800 (PST) MIME-Version: 1.0 References: <96ecfc02-04f6-7222-4582-3740c505c7e5@FreeBSD.org> <3d8f953e-0bdf-4939-b127-668f73635d2b@comcast.net> <72fa9e36-4460-c09c-25a8-b8157bacccdb@astart.com> In-Reply-To: <72fa9e36-4460-c09c-25a8-b8157bacccdb@astart.com> From: Gleb Popov Date: Fri, 27 Dec 2019 09:27:38 +0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Scripting bsdinstall To: papowell@astart.com Cc: freebsd-hackers X-Rspamd-Queue-Id: 47kb2G4LHYz3GBB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of 6yearold@gmail.com designates 209.85.167.43 as permitted sender) smtp.mailfrom=6yearold@gmail.com X-Spamd-Result: default: False [-2.08 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; URI_COUNT_ODD(1.00)[9]; RCVD_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[43.167.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.08)[ip: (-0.35), ipnet: 209.85.128.0/17(-3.11), asn: 15169(-1.88), country: US(-0.05)]; FORGED_SENDER(0.30)[arrowd@freebsd.org,6yearold@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[43.167.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[arrowd@freebsd.org,6yearold@gmail.com]; RCVD_TLS_ALL(0.00)[] 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: Fri, 27 Dec 2019 05:28:08 -0000 On Fri, Dec 27, 2019 at 5:21 AM Patrick Powell wrote: > On 2019-12-25 04:48, Mike Remski wrote: > > On Wednesday, December 25, 2019 7:43:26 AM EST, Gleb Popov wrote: > >> > >> > >> On Wed, Dec 25, 2019 at 4:37 PM Mike Remski > wrote: > >> On Wednesday, December 25, 2019 4:31:50 AM EST, Gleb Popov wrote: > >>> On Sun, Dec 22, 2019 at 9:47 PM Gleb Popov wrote: > >>> > >>>> On Sun, Dec 15, 2019 at 4:51 PM Matthew Seaman > >>>> wrote: > >>>> ... > >>> > >>> 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? > >> In bsdinstall/scripts/zfsboot there are a couple things that look > >> related to what you want. GPART_BOOTCODE, GPART_BOOTCODE_PART and > >> GPART_BOOTCODE_PARTONLY, plus GPART_SET_ACTIVE and > >> GPART_SET_PMBR_ACTIVE. I know you are using UFS, but it may help > >> figure out what you need. > >> > >> Thanks for these, but I ended up adding > >> > >> gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 > >> > >> to the second part of the script. It should be noted that it wasn't > >> working without "-b /boot/pmbr" part. > > > > Ahh. I think at one time you needed to do them as separate gpart > > commands then you needed to have both options on the same command. > > Glad you got it working. > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to > > "freebsd-hackers-unsubscribe@freebsd.org" > > > As a highly interested outside observer, is it possible to put this > accumulated wisdom into a document and put it on a FreeBSD Web Site? > > Scripting FreeBSD installs seems to be a lost, or at least, arcane Art. > I documented my findings in the man page: https://reviews.freebsd.org/D22927 Feel free to add any suggestions. > -- > Patrick Powell Astart Technologies > papowell@astart.com 1509 Hollow Ct., > Network and System San Diego, CA 92019 > Consulting Cell 858-518-7581 FAX 858-751-2435 > Web: papowell at astart dot com > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >