SHARE
TWEET

Untitled

a guest Jun 16th, 2019 56 in 1 hour
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ cat init.go
  2. package main
  3.  
  4. import (
  5.     "fmt"
  6.     // #include <sys/reboot.h>
  7.     "C"
  8. )
  9.  
  10. func main() {
  11.         fmt.Println("hello world")
  12.         C.reboot(C.RB_POWER_OFF);
  13. }
  14.  
  15. $ go build -a -installsuffix cgo -ldflags "-linkmode external -extldflags -static" init.go && echo init | cpio -H newc -o | gzip > initrd.gz
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top