github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/pkg/boot/kexec/kexec_linux.go (about) 1 // Copyright 2015-2017 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package kexec 6 7 import ( 8 "fmt" 9 "syscall" 10 ) 11 12 // Reboot executes a kernel previously loaded with FileInit. 13 func Reboot() error { 14 if err := syscall.Reboot(syscall.LINUX_REBOOT_CMD_KEXEC); err != nil { 15 return fmt.Errorf("sys_reboot(..., kexec) = %v", err) 16 } 17 return nil 18 }