From 30a3bd9f9428a1cdca2e48fa93241139a6afef3a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 23 Feb 2019 18:53:37 +0100 Subject: pkg/build: setup network interface on GCE for netbsd --- pkg/build/netbsd.go | 11 ++++++++--- 1 file 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, ";")) -- cgit mrf-deployment