golang.org/x/build@v0.0.0-20240506185731-218518f32b70/env/dragonfly-amd64/phase1.sh (about) 1 #!/bin/sh 2 # Copyright 2023 The Go Authors. All rights reserved. 3 # Use of this source code is governed by a BSD-style 4 # license that can be found in the LICENSE file. 5 6 7 # Phase 1 of the DragonflyBSD installation: boot from installer CD and install on empty disk. 8 9 set -ex 10 11 echo >&2 phase1.sh starting 12 13 mkdir -p /root/gopherinstall 14 cp -a /mnt/* /root/gopherinstall 15 cd /root/gopherinstall 16 17 echo >&2 install.sh running 18 19 # Following Manual Installation section of https://www.dragonflybsd.org/docs/handbook/Installation/#index3h1 20 21 fdisk -IB /dev/da0 22 disklabel -r -w -B /dev/da0s1 auto 23 disklabel da0s1 >label 24 echo ' 25 a: 1G 0 4.2BSD 26 d: * * HAMMER2 27 ' >>label 28 disklabel -R -r da0s1 label 29 30 newfs /dev/da0s1a 31 newfs_hammer2 -L ROOT /dev/da0s1d 32 mount /dev/da0s1d /mnt 33 mkdir /mnt/boot /mnt/mnt 34 mount /dev/da0s1a /mnt/boot 35 36 # mount clean file system image from second copy of CD on /mnt/mnt for copying. 37 # the install instructions use cpdup / /mnt, 38 # but using this second copy of the CD avoids all the tmpfs 39 # that are mounted on top of /, as well as our local modifications (like the gopherinstall user). 40 mount_cd9660 /dev/cd2 /mnt/mnt 41 cpdup /mnt/mnt/boot /mnt/boot 42 cpdup /mnt/mnt /mnt 43 44 cat >/mnt/etc/rc.conf <<'EOF' 45 ifconfig_vtnet0='DHCP mtu 1460' 46 EOF 47 48 cat >/mnt/boot/loader.conf <<'EOF' 49 vfs.root.mountfrom=hammer2:da0s1d 50 console=comconsole 51 EOF 52 53 cat >/mnt/etc/fstab <<'EOF' 54 da0s1a /boot ufs rw 1 1 55 da0s1d / hammer2 rw 1 1 56 EOF 57 58 umount /mnt/mnt 59 umount /mnt/boot 60 61 echo 'DONE WITH PHASE 1.' 62 sync 63 poweroff 64 sleep 86400