From owner-freebsd-hackers@freebsd.org Fri Dec 27 01:21:18 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 0FE3E1DE428 for ; Fri, 27 Dec 2019 01:21:18 +0000 (UTC) (envelope-from papowell@astart.com) Received: from smtp-out3.electric.net (smtp-out3.electric.net [208.70.128.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47kTYT0DZYz4XGt for ; Fri, 27 Dec 2019 01:21:16 +0000 (UTC) (envelope-from papowell@astart.com) Received: from 1ikeJV-00024l-VI by out3c.electric.net with emc1-ok (Exim 4.92.3) (envelope-from ) id 1ikeJW-00025p-Tz for freebsd-hackers@freebsd.org; Thu, 26 Dec 2019 17:21:14 -0800 Received: by emcmailer; Thu, 26 Dec 2019 17:21:14 -0800 Received: from [207.246.88.68] (helo=vultr.guest) by out3c.electric.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1ikeJV-00024l-VI for freebsd-hackers@freebsd.org; Thu, 26 Dec 2019 17:21:13 -0800 Received: from [127.0.0.1] (localhost [IPv6:0:0:0:0:0:0:0:1]) by vultr.guest (8.15.2/8.15.2) with ESMTP id xBR1LCan032493 for ; Thu, 26 Dec 2019 17:21:12 -0800 (PST) (envelope-from papowell@astart.com) Reply-To: papowell@astart.com Subject: Re: Scripting bsdinstall To: freebsd-hackers@freebsd.org References: <96ecfc02-04f6-7222-4582-3740c505c7e5@FreeBSD.org> <3d8f953e-0bdf-4939-b127-668f73635d2b@comcast.net> From: Patrick Powell Organization: Astart Technologies Message-ID: <72fa9e36-4460-c09c-25a8-b8157bacccdb@astart.com> Date: Thu, 26 Dec 2019 17:21:12 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Outbound-IP: 207.246.88.68 X-Env-From: papowell@astart.com X-Proto: esmtps X-Revdns: X-HELO: vultr.guest X-TLS: TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256 X-Authenticated_ID: X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (b) X-PolicySMART: 9383282 X-Rspamd-Queue-Id: 47kTYT0DZYz4XGt X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of papowell@astart.com has no SPF policy when checking 208.70.128.187) smtp.mailfrom=papowell@astart.com X-Spamd-Result: default: False [-2.62 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[papowell@astart.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(-1.52)[ipnet: 208.70.128.0/24(-4.34), asn: 16941(-3.19), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_IN_DNSWL_NONE(0.00)[187.128.70.208.list.dnswl.org : 127.0.3.0]; R_SPF_NA(0.00)[]; DMARC_NA(0.00)[astart.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16941, ipnet:208.70.128.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[187.128.70.208.rep.mailspike.net : 127.0.0.17] 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 01:21:18 -0000 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. -- 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