Attention is currently required from: Dmitri Shuralyov.
Yuval Pavel Zholkover would like Dmitri Shuralyov to review this change.
env/freebsd-amd64: add FreeBSD 11.4, 12.1, 12.2 images
Update the expect script to work with with the SeaBIOS built-in VGA
serial console emulation instead of sgabios.
Tested on Ubuntu 20.4.
Updates golang/go#40562
Change-Id: I4f7f1972092416f1d6d54ec7e16d100aeeeaf25f
---
M env/freebsd-amd64/README
M env/freebsd-amd64/make.bash
2 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/env/freebsd-amd64/README b/env/freebsd-amd64/README
index 37b166c..3afb2f6 100644
--- a/env/freebsd-amd64/README
+++ b/env/freebsd-amd64/README
@@ -2,8 +2,8 @@
FreeBSD builder, booting up to run the buildlet.
make.bash should be run on a Linux box with qemu and a few additional packages.
-on ubuntu 16.04 / debian 9 install:
- apt-get install qemu-system-x86 qemu-utils sgabios expect genisoimage
+on ubuntu 20.04:
+ apt-get install qemu-system-x86 qemu-utils expect genisoimage
After it completes, it creates a file freebsd-amd64-gce101.tar.gz
diff --git a/env/freebsd-amd64/make.bash b/env/freebsd-amd64/make.bash
index 16007ff..cb307fc 100755
--- a/env/freebsd-amd64/make.bash
+++ b/env/freebsd-amd64/make.bash
@@ -60,14 +60,29 @@
readonly VERSION_TRAILER=
readonly SHA256=e5f7fb12b828f0af7edf9464a08e51effef05ca9eb5fb52dba6d23a3c7a39223
;;
+11.4)
+ readonly VERSION=11.4-RELEASE
+ readonly VERSION_TRAILER=
+ readonly SHA256=53a9db4dfd9c964d487d9f928754c964e2c3610c579c7f3558c745a75fa430f0
+;;
12.0)
readonly VERSION=12.0-RELEASE
readonly VERSION_TRAILER=
readonly SHA256=9eb70a552f5395819904ed452a02e5805743459dbb1912ebafe4c9ae5de5eb53
;;
+12.1)
+ readonly VERSION=12.1-RELEASE
+ readonly VERSION_TRAILER=
+ readonly SHA256=3750767f042ebf47a1e8e122b67d9cd48ec3cd2a4a60b724e64c4ff6ba33653a
+;;
+12.2)
+ readonly VERSION=12.2-RELEASE
+ readonly VERSION_TRAILER=
+ readonly SHA256=0f8593382b6833658c6f6be532d4ffbedde7b75504452e27d912a0183f72ab56
+;;
*)
echo "Usage: $0 <version>"
- echo " version - FreeBSD version to build. Valid choices: 9.3 10.3 10.4 11.0 11.1 11.2 11.3 12.0"
+ echo " version - FreeBSD version to build. Valid choices: 9.3 10.3 10.4 11.0 11.1 11.2 11.3 11.4 12.0 12.1 12.2"
exit 1
esac
@@ -83,7 +98,7 @@
download_image
fi
-qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2
+qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2 8G
mkdir -p iso/boot iso/etc iso/usr/local/etc/rc.d
cp loader.conf iso/boot
@@ -117,19 +132,23 @@
env DOWNLOAD_UPDATES=$((1-IS_SNAPSHOT)) expect <<'EOF'
set prompt "root@.*:~ #[ ]"
set timeout -1
+set send_human {.1 .3 1 .05 2}
-spawn qemu-system-x86_64 -nographic -option-rom sgabios.bin -m 1G -drive if=virtio,file=disk.qcow2,format=qcow2,cache=none -cdrom config.iso -net nic,model=virtio -net user
+spawn qemu-system-x86_64 -machine graphics=off -display none -serial stdio \
+ -fw_cfg name=opt/etc/sercon-port,string=0x3F8 \
+ -m 1G -drive if=virtio,file=disk.qcow2,format=qcow2,cache=none -cdrom config.iso -net nic,model=virtio -net user
set qemu_pid $spawn_id
# boot with serial console enabled
expect -ex "Welcome to FreeBSD"
-sleep 2
-expect -ex "ape to loader prompt"
-send "3\n"
-expect -ex "Type '?' for a list of commands, 'help' for more detailed help."
-send "set console=\"comconsole\"\n"
+expect -re "Autoboot in \[0-9\]\+ seconds"
sleep 1
-send "boot\n"
+send -h "3" ;# escape to bootloader prompt
+expect -ex "Type '?' for a list of commands, 'help' for more detailed help."
+expect -ex "OK "
+send -h "set console=\"comconsole\"\n"
+expect -ex "OK "
+send -h "boot\n"
# wait for login prompt
set timeout 120
@@ -165,7 +184,8 @@
sleep 2
expect -re $prompt
send "freebsd-update install\n"
- expect "Installing updates... done."
+ expect "Installing updates..."
+ expect "done."
sleep 1
send "\n"
}
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Dmitri Shuralyov.
2 comments:
Patchset:
Hi @dmitshur,
I've tested FreeBSD image creation for 11.4, 12.1 and 12.2, please use them create updated GCE images for the builders.
Thanks!
File env/freebsd-amd64/make.bash:
Patch Set #1, Line 101: qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2 8G
This increase (from 4GB) is necessary for the FreeBSD-12.1 updates to succeed. If you don't plan to generate 12.1 images (it is approaching EOL), this can be dropped.
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover.
2 comments:
Patchset:
Thank you for doing this work Yuval. We'll try to take a look, although I don't know yet how soon we'll be able to get to it.
File env/freebsd-amd64/make.bash:
Patch Set #1, Line 101: qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2 8G
This increase (from 4GB) is necessary for the FreeBSD-12.1 updates to succeed. […]
Given FreeBSD's support lifecycle policy¹, I think it likely makes sense for us to target only the latest point release of each major branch. So if 12.2 is available, we'll skip 12.1. Or if 12.3 becomes available, we'd use that instead of 12.2.
(This is my initial observation; I haven't looked into our past decisions on this topic yet, if any, so it's possible I've missed something relevant.)
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover.
Yuval Pavel Zholkover uploaded patch set #2 to this change.
env/freebsd-amd64: add FreeBSD 11.4, 12.1, 12.2 images
Update the expect script to work with with the SeaBIOS built-in VGA
serial console emulation instead of sgabios.
Tested on Ubuntu 20.4.
Updates golang/go#40562
Change-Id: I4f7f1972092416f1d6d54ec7e16d100aeeeaf25f
---
M env/freebsd-amd64/README
M env/freebsd-amd64/make.bash
2 files changed, 47 insertions(+), 29 deletions(-)
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Dmitri Shuralyov.
1 comment:
File env/freebsd-amd64/make.bash:
Patch Set #1, Line 101: qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2 8G
Given FreeBSD's support lifecycle policy¹, I think it likely makes sense for us to target only the l […]
Iirc the 10.4, 11.2 and the 12.0 builder images are the only ones which were created with the newer update script. And the images were created fairly close to their respective version release dates so that not many patches were accumulated at the time.
It seems that while testing the image build for v12.1 I didn't cleanup the existing temporary qcow2 files, which caused the update to fail.
I've added a `trap cleanup EXIT` to handle it in the future.
However once I remove the increase to 8G, the build for the v12.2 image (which is already larger than 4G - 10487475 512 sectors) fails as well:
Number of packages to be installed: 63
The process will require 674 MiB more space.
109 MiB to be downloaded.
pkg: Not enough space in /var/cache/pkg, needed 109 MiB available 33 MiB
So it seems the increase is needed regardless.
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover, Dmitri Shuralyov.
1 comment:
Patchset:
Picking this up. I was able to generate the 11.4 image with an additional expect block. The 12.2 image fails after:
gpart: arg0 'gpt/rootfs': Invalid argument
super-block backups (for fsck_ffs -b #) at:
8975872, 10258112, 11540352, 12822592, 14104832
/etc/rc: WARNING: hostid: unable to figure out a UUID from DMI data, generating a new one
Setting hostuuid: c47eb210-9bde-11eb-8da6-e925b78fc728.
Setting hostid: 0xfce588a5.
Starting file system checks:
/dev/gpt/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/gpt/rootfs: clean, 926959 free (8231 frags, 114841 blocks, 0.5% fragmentation)
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
32-bit compatibility ldconfig path: /usr/lib32
Autoloading module: intpm.ko
intsmb0: <Intel PIIX4 SMBUS Interface> irq 9 at device 1.3 on pci0
intsmb0: intr IRQ 9 enabled revision 0
smbus0: <System Management Bus> on intsmb0
Setting hostname: freebsd.
Setting up harvesting: [UMA],> > > [FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: .
lo0: link state changed to UP
vtnet0: link state changed to UP
Starting Network
I'm going to continue debugging tomorrow. Would you be willing to test this on your end Yuval?
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Carlos Amedee, Dmitri Shuralyov.
1 comment:
Patchset:
Picking this up. I was able to generate the 11.4 image with an additional expect block. The 12. […]
Hi Carlos,
Are you seeing this full message on the initial boot of the extracted FreeBSD-12.2-RELEASE-amd64.raw image:
```
GEOM: vtbd0: the secondary GPT header is not in the last LBA.
Growing root partition to fill device
random: unblocking device.
vtbd0 recovered
vtbd0p4 resized
gpart: arg0 'gpt/rootfs': Invalid argument
super-block backups (for fsck_ffs -b #) at:
8975872, 10258112, 11540352, 12822592, 14104832
/etc/rc: WARNING: hostid: unable to figure out a UUID from DMI data, generating a new one
```
Or does it happen afterwards with the installed image?
During the initial boot, this is fine - it is caused by the resize of the image.
If this happens after the expect has finished, it might indicate the `sync` step wasn't run and produces a corrupt image.
I'm running a 12.2 install on my end, but it is really slow going network wise (13.0 is being released today).
Can you share the additional expect block?
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Patchset:
Hi Carlos, […]
(just to update, the 12.2 image builds and boots for me - Ubuntu 20.04.2 LTS, qemu-system-x86 4.2-3ubuntu6.14)
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover, Dmitri Shuralyov.
Patch set 3:Code-Review +2
6 comments:
Patchset:
(just to update, the 12.2 image builds and boots for me - Ubuntu 20.04.2 LTS, qemu-system-x86 4. […]
Ack
(just to update, the 12.2 image builds and boots for me - Ubuntu 20.04.2 LTS, qemu-system-x86 4. […]
After reviewing this a second time, all of the errors on my end were fixed by increasing the timeout in the mentioned comment. I was able to successfully create the images.
(just to update, the 12.2 image builds and boots for me - Ubuntu 20.04.2 LTS, qemu-system-x86 4. […]
Ack
Great work! Thanks for contributing this.
File env/freebsd-amd64/make.bash:
Patch Set #1, Line 101: qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2 8G
Iirc the 10.4, 11.2 and the 12. […]
I can confirm that the size increase is required for version >= 12.x.
File env/freebsd-amd64/make.bash:
While I was creating the images, I discovered that this timeout needs to be set higher. Would setting it to 180 be acceptable for you?
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover, Dmitri Shuralyov.
Patch set 3:Run-TryBot +1
File env/freebsd-amd64/make.bash:
While I was creating the images, I discovered that this timeout needs to be set higher. […]
Sure. I would also like to add the now released FreeBSD 13.0 image. I'll have time to test during the weekend - is this acceptable?
Should I send a separate PR instead and just increase the timeout here?
Although 3 minutes until the boot prompt seems very long (even the current 2 minutes was just an upper limit). Could this be due to running on a GCE instance?
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover, Dmitri Shuralyov.
1 comment:
File env/freebsd-amd64/make.bash:
Sure. I would also like to add the now released FreeBSD 13.0 image. […]
I think sending a separate CL for FreeBSD 13.0 would be desirable. We would probably want to add that to a separate GitHub issue. I agree with you, 3 minutes seems like a long time. I'm not sure it's worth spending the time trying to research how to decrease that time right now. You will probably need to rebase from master in order to make trybots pass.
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover, Dmitri Shuralyov.
Yuval Pavel Zholkover uploaded patch set #4 to this change.
env/freebsd-amd64: add FreeBSD 11.4, 12.1, 12.2 images
Update the expect script to work with with the SeaBIOS built-in VGA
serial console emulation instead of sgabios.
Tested on Ubuntu 20.4.
Updates golang/go#44431
Change-Id: I4f7f1972092416f1d6d54ec7e16d100aeeeaf25f
---
M env/freebsd-amd64/README
M env/freebsd-amd64/make.bash
2 files changed, 48 insertions(+), 30 deletions(-)
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Dmitri Shuralyov.
2 comments:
Patchset:
I've updated the timeout to 180 and rebased, can you please re-run the try-bots?
I'll create a new Github issue for the 13.0 images and update the expect script - there were some changes to the `freebsd-update` according to the release notes.
File env/freebsd-amd64/make.bash:
I think sending a separate CL for FreeBSD 13.0 would be desirable. […]
Ack
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Yuval Pavel Zholkover.
Patch set 4:Code-Review +1Trust +1
1 comment:
File env/freebsd-amd64/make.bash:
Carlos, my current understanding (from experience in CL 226977 and may not apply here) is that the QEMU disk image size specified here may influence the size of the disk.raw image from qemu-img convert later in the script, which in turn dictates the disk size of the builder VMs.
So if 8 GB disk space isn't enough for the builder, perhaps this is where it could be bumped rather than via GCE machine type. It may also be possible to control the VM disk size independently of the source image size, but I don't know about that. (If someone knows better, please correct this.)
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Dmitri Shuralyov, Yuval Pavel Zholkover.
Patch set 4:Code-Review +2
1 comment:
File env/freebsd-amd64/make.bash:
Carlos, my current understanding (from experience in CL 226977 and may not apply here) is that the Q […]
That falls in line with the experimentation I did last night. I will follow up this comment once I have a concrete solution.
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Dmitri Shuralyov, Yuval Pavel Zholkover.
Patch set 4:Run-TryBot +1
1 comment:
File env/freebsd-amd64/make.bash:
That falls in line with the experimentation I did last night. […]
Changing the size of the disk to 10G via this script worked. Changing it via the qemu-img resize command would work if you then follow it up by changing the partition table afterwards. It was easier to just regenerate the image.
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Dmitri Shuralyov, Yuval Pavel Zholkover.
1 comment:
Patchset:
4 of 6 TryBots failed. […]
Done
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.
Carlos Amedee submitted this change.
env/freebsd-amd64: add FreeBSD 11.4, 12.1, 12.2 images
Update the expect script to work with with the SeaBIOS built-in VGA
serial console emulation instead of sgabios.
Tested on Ubuntu 20.4.
Updates golang/go#44431
Change-Id: I4f7f1972092416f1d6d54ec7e16d100aeeeaf25f
Reviewed-on: https://go-review.googlesource.com/c/build/+/279392
Reviewed-by: Dmitri Shuralyov <dmit...@golang.org>
Reviewed-by: Carlos Amedee <car...@golang.org>
Trust: Dmitri Shuralyov <dmit...@golang.org>
Run-TryBot: Carlos Amedee <car...@golang.org>
TryBot-Result: Go Bot <go...@golang.org>
---
M env/freebsd-amd64/README
M env/freebsd-amd64/make.bash
2 files changed, 48 insertions(+), 30 deletions(-)
diff --git a/env/freebsd-amd64/README b/env/freebsd-amd64/README
index 37b166c..3afb2f6 100644
--- a/env/freebsd-amd64/README
+++ b/env/freebsd-amd64/README
@@ -2,8 +2,8 @@
FreeBSD builder, booting up to run the buildlet.
make.bash should be run on a Linux box with qemu and a few additional packages.
-on ubuntu 16.04 / debian 9 install:
- apt-get install qemu-system-x86 qemu-utils sgabios expect genisoimage
+on ubuntu 20.04:
+ apt-get install qemu-system-x86 qemu-utils expect genisoimage
After it completes, it creates a file freebsd-amd64-gce101.tar.gz
diff --git a/env/freebsd-amd64/make.bash b/env/freebsd-amd64/make.bash
index 16007ff..981775c 100755
--- a/env/freebsd-amd64/make.bash
+++ b/env/freebsd-amd64/make.bash
@@ -8,8 +8,8 @@
# an ISO mounted as the CD-ROM, and customizes the system before powering down.
# SSH is enabled, and a user gopher, password gopher, is created.
-# Only tested on Ubuntu 16.04.
-# Requires packages: qemu qemu-img expect sgabios genisoimage
+# Only tested on Ubuntu 20.04.
+# Requires packages: qemu-system-x86 qemu-img expect genisoimage
set -e
@@ -60,30 +60,46 @@
-IMAGE=freebsd-amd64-${VERSION/-RELEASE/}.tar.gz
-readonly IMAGE=${IMAGE/\./}
+function cleanup() {
+ rm -rf iso \
+ *.iso \
+ *.raw \
+ *.qcow2
+}
-if [ $(tput cols) -lt 80 ]; then
- echo "Running qemu with curses display requires a window 80 columns or larger or expect(1) won't work correctly."
- exit 1
-fi
+trap cleanup EXIT
if ! [ -e FreeBSD-${VERSION:?}-amd64.raw ]; then
download_image
fi
-qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2
+qemu-img create -f qcow2 -b FreeBSD-${VERSION:?}-amd64${VERSION_TRAILER}.raw disk.qcow2 8G
mkdir -p iso/boot iso/etc iso/usr/local/etc/rc.d
cp loader.conf iso/boot
@@ -117,22 +133,26 @@-set timeout 120
+set timeout 180
expect {
"\nlogin: " {
send "root\n"
@@ -165,7 +185,8 @@
sleep 2
expect -re $prompt
send "freebsd-update install\n"
- expect "Installing updates... done."
+ expect "Installing updates..."
+ expect "done."
sleep 1
send "\n"
}
@@ -184,17 +205,12 @@
expect -re $prompt
sleep 1
-send "pkg install bash curl git gdb\n"
-expect "Do you want to fetch and install it now"
-sleep 1
-send "y\n"
-
-expect "Proceed with this action"
-sleep 1
-send "y\n"
+send "pkg install -y bash curl git gdb\n"
expect -re $prompt
-sleep 1
+send "sync\n"
+
+expect -re $prompt
send "poweroff\n"
expect "All buffers synced."
@@ -202,6 +218,8 @@
EOF
# Create Compute Engine disk image.
+IMAGE=freebsd-amd64-${VERSION/-RELEASE/}.tar.gz
+readonly IMAGE=${IMAGE/\./}
echo "Archiving disk.raw as ${IMAGE:?}... (this may take a while)"
qemu-img convert -f qcow2 -O raw -t none -T none disk.qcow2 disk.raw
tar -Szcf ${IMAGE:?} disk.raw
To view, visit change 279392. To unsubscribe, or for help writing mail filters, visit settings.