diff --git a/cmds/core/init/fns_unix.go b/cmds/core/init/fns_unix.go index 4bcac71548..bb0e8ebc8d 100644 --- a/cmds/core/init/fns_unix.go +++ b/cmds/core/init/fns_unix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !tinygo && (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) -// +build !tinygo +//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build darwin dragonfly freebsd linux netbsd openbsd solaris package main diff --git a/pkg/libinit/net_linux.go b/pkg/libinit/net_linux.go index c10c65112b..a2b855d546 100644 --- a/pkg/libinit/net_linux.go +++ b/pkg/libinit/net_linux.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && !tinygo +// +build linux,!tinygo + package libinit import ( diff --git a/pkg/libinit/net_linux_tinygo.go b/pkg/libinit/net_linux_tinygo.go new file mode 100644 index 0000000000..606d86ed6b --- /dev/null +++ b/pkg/libinit/net_linux_tinygo.go @@ -0,0 +1,21 @@ +// Copyright 2014-2019 the u-root Authors. All rights reserved +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux && tinygo +// +build linux,tinygo + +package libinit + +import ( + "github.com/u-root/u-root/pkg/ulog" +) + +// Stub for notifying the user that network functionality is not supported on linux platforms +func linuxNetInit() { + ulog.KernelLog.Printf("tinygo builds currently do not support network functionality on linux platforms\n") +} + +func init() { + osNetInit = linuxNetInit +}