diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-02-23 18:53:37 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-02-23 18:53:37 +0100 |
| commit | 30a3bd9f9428a1cdca2e48fa93241139a6afef3a (patch) | |
| tree | a3a7736c3699900f303c393b803bb0c5f95223d3 | |
| parent | 40311807adda4b4c4163ba4824f7a01109ae6986 (diff) | |
pkg/build: setup network interface on GCE for netbsd
| -rw-r--r-- | pkg/build/netbsd.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/build/netbsd.go b/pkg/build/netbsd.go index be267cd99..228e9c737 100644 --- a/pkg/build/netbsd.go +++ b/pkg/build/netbsd.go @@ -114,9 +114,14 @@ func CopyKernelToDisk(targetArch, vmType, outputDir, kernel string) error { } commands := []string{"touch /fastboot"} // /fastboot file prevents disk check on start. if vmType == "gce" { - // We expect boot disk to be wd0a for the qemu (that's how qemu exposes -hda disk). - // GCE exposes boot disk as sd0a. - commands = append(commands, "sed -i 's#wd0#sd0#g' /etc/fstab") + commands = append(commands, []string{ + // We expect boot disk to be wd0a for the qemu (that's how qemu exposes -hda disk). + // GCE exposes boot disk as sd0a. + `sed -i 's#wd0#sd0#g' /etc/fstab`, + // GCE provides vioif0 interface. + `echo '\!dhcpcd vioif0' > /etc/ifconfig.vioif0`, + `echo 'mtu 1460' >> /etc/ifconfig.vioif0`, + }...) } commands = append(commands, "sync") // Run sync so that the copied image is stored properly. outc, errc, err := inst.Run(time.Minute, nil, strings.Join(commands, ";")) |
