Skip to content

Commit d3e6651

Browse files
committed
Update the instructions for building a FreeBSD CI image
1 parent 9c56176 commit d3e6651

File tree

1 file changed

+66
-26
lines changed

1 file changed

+66
-26
lines changed

ci/README.md

Lines changed: 66 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -128,32 +128,72 @@ QEMU is available, and if so mount it, run a script (it'll specifically be
128128
`run-qemu.sh` in this folder which is copied into the generated image talked
129129
about above), and then shut down.
130130

131-
### QEMU setup - FreeBSD
132-
133-
1. Download CD installer (most minimal is fine)
134-
2. `qemu-img create -f qcow2 foo.qcow2 2G`
135-
3. `qemu -cdrom foo.iso -drive if=virtio,file=foo.qcow2 -net nic,model=virtio -net user`
136-
4. run installer
137-
5. `echo 'console="comconsole"' >> /boot/loader.conf`
138-
6. `echo 'autoboot_delay="0"' >> /boot/loader.conf`
139-
7. look at /etc/ttys, see what getty argument is for ttyu0
140-
8. edit /etc/gettytab, look for ttyu0 argument, prepend `:al=root` to line
141-
beneath
142-
143-
(note that the current image has a `freebsd` user, but this isn't really
144-
necessary)
145-
146-
Once that's done, arrange for this script to run at login:
147-
148-
```
149-
#!/bin/sh
150-
151-
sudo kldload ext2fs
152-
[ -e /dev/vtbd1 ] || exit 0
153-
sudo mount -t ext2fs /dev/vtbd1 /mnt
154-
sh /mnt/run.sh /mnt
155-
sudo poweroff
156-
```
131+
### QEMU Setup - FreeBSD
132+
133+
1. [Download the latest stable amd64-bootonly release ISO](https://www.freebsd.org/where.html).
134+
E.g. FreeBSD-11.1-RELEASE-amd64-bootonly.iso
135+
2. Create the disk image: `qemu-img create -f qcow2 FreeBSD-11.1-RELEASE-amd64.qcow2 2G`
136+
3. Boot the machine: `qemu-system-x86_64 -cdrom FreeBSD-11.1-RELEASE-amd64-bootonly.iso -drive if=virtio,file=FreeBSD-11.1-RELEASE-amd64.qcow2 -net nic,model=virtio -net user`
137+
4. Run the installer, and install FreeBSD:
138+
1. Install
139+
1. Continue with default keymap
140+
1. Set Hostname: freebsd-ci
141+
1. Distribution Select:
142+
1. Uncheck lib32
143+
1. Uncheck ports
144+
1. Network Configuration: vtnet0
145+
1. Configure IPv4? Yes
146+
1. DHCP? Yes
147+
1. Configure IPv6? No
148+
1. Resolver Configuration: Ok
149+
1. Mirror Selection: Main Site
150+
1. Partitioning: Auto (UFS)
151+
1. Partition: Entire Disk
152+
1. Partition Scheme: MBR
153+
1. App Partition: Ok
154+
1. Partition Editor: Finish
155+
1. Confirmation: Commit
156+
1. Wait for sets to install
157+
1. Set the root password to nothing (press enter twice)
158+
1. Set time zone to UTC
159+
1. Set Date: Skip
160+
1. Set Time: Skip
161+
1. System Configuration:
162+
1. Disable sshd
163+
1. Disable dumpdev
164+
1. System Hardening
165+
1. Disable Sendmail service
166+
1. Add User Accounts: No
167+
1. Final Configuration: Exit
168+
1. Manual Configuration: Yes
169+
1. `echo 'console="comconsole"' >> /boot/loader.conf`
170+
1. `echo 'autoboot_delay="0"' >> /boot/loader.conf`
171+
1. `echo 'ext2fs_load="YES"' >> /boot/loader.conf`
172+
1. Look at `/etc/ttys`, see what getty argument is for `ttyu0` (E.g. `3wire`)
173+
1. Edit `/etc/gettytab` (with `vi` for example), look for `ttyu0` argument,
174+
prepend `:al=root` to the line beneath to have the machine auto-login as
175+
root. E.g.
176+
177+
3wire:\
178+
:np:nc:sp#0:
179+
becomes:
180+
181+
3wire:\
182+
:al=root:np:nc:sp#0:
183+
184+
1. Edit `/root/.login` and put this in it:
185+
186+
[ -e /dev/vtbd1 ] || exit 0
187+
mount -t ext2fs /dev/vtbd1 /mnt
188+
sh /mnt/run.sh /mnt
189+
poweroff
190+
191+
1. Exit the post install shell: `exit`
192+
1. Back in in the installer choose Reboot
193+
1. If all went well the machine should reboot and show a login prompt.
194+
If you switch to the serial console by choosing View > serial0 in
195+
the qemu menu, you should be logged in as root.
196+
1. Shutdown the machine: `shutdown -p now`
157197

158198
Helpful links
159199

0 commit comments

Comments
 (0)