From a9cc88c19f0c8907d7696b47a2b3b251a2ca06df Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 17 Dec 2018 16:56:39 +0100 Subject: pkg/osutil: provide better Rename os.Rename fails for cross-device renaming (e.g. to/from tmpfs). This is quite unpleasant. Provide own version that falls back to copying. --- pkg/build/linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/build/linux.go') diff --git a/pkg/build/linux.go b/pkg/build/linux.go index f2bc4e0fe..dbe9cfbb7 100644 --- a/pkg/build/linux.go +++ b/pkg/build/linux.go @@ -71,7 +71,7 @@ func (linux) buildKernel(kernelDir, outputDir, compiler string, config []byte) e } vmlinux := filepath.Join(kernelDir, "vmlinux") outputVmlinux := filepath.Join(outputDir, "obj", "vmlinux") - if err := os.Rename(vmlinux, outputVmlinux); err != nil { + if err := osutil.Rename(vmlinux, outputVmlinux); err != nil { return fmt.Errorf("failed to rename vmlinux: %v", err) } return nil -- cgit mrf-deployment