From owner-freebsd-hackers@freebsd.org Wed Jan 8 02:05:16 2020 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 AE3741F9270 for ; Wed, 8 Jan 2020 02:05:16 +0000 (UTC) (envelope-from kiri@truefc.org) Received: from kx.truefc.org (flets-sg1026.kamome.or.jp [202.216.24.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp", Issuer "smtp" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ssyf5fQtz3wwd; Wed, 8 Jan 2020 02:05:13 +0000 (UTC) (envelope-from kiri@truefc.org) Received: from kx.truefc.org (kx.truefc.org [202.216.24.26]) by kx.truefc.org (8.15.2/8.15.2) with ESMTP id 00825AUD094655; Wed, 8 Jan 2020 11:05:10 +0900 (JST) (envelope-from kiri@kx.truefc.org) Message-Id: <202001080205.00825AUD094655@kx.truefc.org> Date: Wed, 08 Jan 2020 11:05:10 +0900 From: KIRIYAMA Kazuhiko To: Gleb Popov Cc: Ravi Pokala , "freebsd-hackers@freebsd.org" Subject: Re: interactive bsdinstall -> scripted bsdinstall In-Reply-To: References: <34796D6B-91A0-4EB8-A225-5A7B6D0275AE@freebsd.org> <202001070736.0077aMru061650@kx.truefc.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 MULE XEmacs/21.4 (patch 24) (Standard C) (amd64--freebsd) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 47ssyf5fQtz3wwd X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of kiri@truefc.org has no SPF policy when checking 202.216.24.26) smtp.mailfrom=kiri@truefc.org X-Spamd-Result: default: False [2.54 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[truefc.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.65)[0.647,0]; NEURAL_SPAM_LONG(0.76)[0.760,0]; R_SPF_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4704, ipnet:202.216.0.0/19, country:JP]; IP_SCORE(0.04)[asn: 4704(0.15), country: JP(0.03)]; ONCE_RECEIVED(0.10)[] 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: Wed, 08 Jan 2020 02:05:16 -0000 On Wed, 08 Jan 2020 05:35:15 +0900, Gleb Popov wrote: > > On Wed, Jan 8, 2020 at 12:27 AM Ravi Pokala wrote: > > > -----Original Message----- > > From: KIRIYAMA Kazuhiko > > Date: 2020-01-06, Monday at 23:36 > > To: Ravi Pokala > > Cc: "freebsd-hackers@freebsd.org" > > Subject: Re: interactive bsdinstall -> scripted bsdinstall > > > > Hi, Ravi > > > > On Tue, 07 Jan 2020 16:08:33 +0900, > > Ravi Pokala wrote: > > > > > > Hi folks, > > > > > > I have a vague memory that `bsdinstall' generates a script or log, > > which can be used to script identical installations. > > > > What would you do ? Non interactive installation or > > debugging installation ? > > > > I mean, I want to perform an interactive installation for a new piece of > > hardware, once. Then, I want to replicate that installation on additional > > instances of that hardware. If `bsdinstall' generates an installation > > script, then I could just use that. > > > > Thanks, > > > > Ravi (rpokala@) > > > > I wrote the installer config from scratch and here is what I ended up with: > > DISTRIBUTIONS="base.txz kernel.txz lib32.txz vpn.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 > > gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 I could not understood why above directive should be needed. I always can install without that. BTW when I installed in the case of amd64/aarch64, installed VM by bsdinstall could not boot, so I thought that bootcode would not be copied boot partition correctlly, so I do above command to install bootcode, but there are nothing embed bootstrap codes in /boot/* of amd64/aarch64 image: root@vm:/vm/test # mdconfig -a -t vnode -f FreeBSD-13.0-CURRENT-arm64-aarch64-20191212-r355634-memstick.img md1 root@vm:/vm/test # gpart show md1 => 3 2042648 md1 GPT (997M) 3 66584 1 efi (33M) 66587 1976064 2 freebsd (965M) root@vm:/vm/test # mount /dev/md1s2 /mnt root@vm:/vm/test # ll /mnt/boot total 2988 -r--r--r-- 1 root wheel 3547 Dec 12 17:02 beastie.4th -r-xr-xr-x 1 root wheel 97848 Dec 12 17:02 boot1.efi* -r--r--r-- 1 root wheel 2119 Dec 12 17:02 brand-fbsd.4th -r--r--r-- 1 root wheel 2799 Dec 12 17:02 brand.4th -r--r--r-- 1 root wheel 6270 Dec 12 17:02 check-password.4th -r--r--r-- 1 root wheel 2104 Dec 12 17:02 color.4th drwxr-xr-x 2 root wheel 512 Dec 12 17:02 defaults/ -r--r--r-- 1 root wheel 4046 Dec 12 17:02 delay.4th drwxr-xr-x 6 root wheel 512 Dec 12 16:25 dtb/ drwxr-xr-x 2 root wheel 512 Dec 12 16:26 efi/ -r--r--r-- 1 root wheel 1584 Dec 12 17:02 efi.4th drwxr-xr-x 2 root wheel 512 Dec 12 16:26 firmware/ -r--r--r-- 1 root wheel 3741 Dec 12 17:02 frames.4th -r-xr-xr-x 1 root wheel 87080 Dec 12 17:02 gptboot.efi* drwxr-xr-x 2 root wheel 13312 Dec 12 16:26 kernel/ -r--r--r-- 1 root wheel 7815 Dec 12 17:02 loader.4th -rw-r--r-- 1 root wheel 51 Dec 12 17:12 loader.conf -r-xr-xr-x 2 root wheel 677944 Dec 12 17:02 loader.efi* -r--r--r-- 1 root wheel 700 Dec 12 17:02 loader.rc -r-xr-xr-x 1 root wheel 584432 Dec 12 17:02 loader_4th.efi* -r-xr-xr-x 2 root wheel 677944 Dec 12 17:02 loader_lua.efi* -r-xr-xr-x 1 root wheel 513656 Dec 12 17:02 loader_simp.efi* -r--r--r-- 1 root wheel 3103 Dec 12 17:02 logo-beastie.4th -r--r--r-- 1 root wheel 2629 Dec 12 17:02 logo-beastiebw.4th -r--r--r-- 1 root wheel 2207 Dec 12 17:02 logo-fbsdbw.4th -r--r--r-- 1 root wheel 2624 Dec 12 17:02 logo-orb.4th -r--r--r-- 1 root wheel 2347 Dec 12 17:02 logo-orbbw.4th drwxr-xr-x 2 root wheel 512 Dec 12 17:02 lua/ -r--r--r-- 1 root wheel 9253 Dec 12 17:02 menu-commands.4th -r--r--r-- 1 root wheel 36008 Dec 12 17:02 menu.4th -r--r--r-- 1 root wheel 6319 Dec 12 17:02 menu.rc -r--r--r-- 1 root wheel 18590 Dec 12 17:02 menusets.4th drwxr-xr-x 2 root wheel 512 Dec 12 16:26 modules/ -r--r--r-- 1 root wheel 2668 Dec 12 17:02 screen.4th -r--r--r-- 1 root wheel 2606 Dec 12 17:02 shortcuts.4th -r--r--r-- 1 root wheel 36328 Dec 12 17:02 support.4th drwxr-xr-x 2 root wheel 512 Dec 12 16:26 uboot/ -r--r--r-- 1 root wheel 3058 Dec 12 17:02 version.4th drwxr-xr-x 2 root wheel 512 Dec 12 16:26 zfs/ root@vm:/vm/test # > > echo 'xxxxxx' | pw usermod -n root -h 0 > > echo "PermitRootLogin yes" > /etc/ssh/sshd_config > echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config > echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config > echo "PubkeyAuthentication no" >> /etc/ssh/sshd_config > echo "Subsystem sftp /usr/libexec/sftp-server" >> /etc/ssh/sshd_config > > mkdir -p /usr/local/etc/pkg/repos/ > echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }' > > /usr/local/etc/pkg/repos/FreeBSD.conf > > sysrc ifconfig_DEFAULT=SYNCDHCP > service netif start > > sysrc sshd_enable=YES > service sshd start > > env PATH=$PATH:/usr/local/bin pkg install -y openvpn python python3 > > sysrc openvpn_enable=YES > sysrc openvpn_dir=/root/vpn/ > sysrc openvpn_configfile=/root/vpn/client.ovpn > > bsdconfig hostname > > echo -n "ifconfig " >> /root/vpn/client.ovpn > dialog --title "VPN IP" --clear --inputbox "Enter VPN IP address" 10 30 2>> > /root/vpn/client.ovpn > echo " 255.0.0.0" >> /root/vpn/client.ovpn > > > > > > > > Is that a real thing, or did I imagine that? If that's real, where > > does that live on the newly installed system? > > > > > > Thanks, > > > > > > Ravi (rpokala@) > > > > > > > > > _______________________________________________ > > > 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" > > > > --- > > Kazuhiko Kiriyama > > > > > > > > _______________________________________________ > > 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" > > > _______________________________________________ > 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" > --- Kazuhiko Kiriyama