diff --git a/.gitignore b/.gitignore index 7ba2e5b4..7c1589c0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ *tar *uck *.pub + +u-root/ diff --git a/TESTCPU b/TESTCPU index e996461b..080755d4 100755 --- a/TESTCPU +++ b/TESTCPU @@ -1,9 +1,9 @@ #!/bin/bash set -e -SOURCE=${SOURCE:=$HOME/go/src/github.com/u-root/u-root} +UROOT=${UROOT:=$HOME/go/src/github.com/u-root/u-root} KERNEL=${KERNEL:=$HOME/linuxboot/mainboards/intel/generic/kernel-noinitramfs} VMN=${VMN:=42} -KEY=${KEY:=~/.ssh/cpu_rsa.pub:key.pub} +KEY=${KEY:=$HOME/.ssh/cpu_rsa.pub} echo NOTE: WE USED TO RUN CPUD AUTOMAGICALLY echo That turned out to be inconvenient for testing @@ -12,18 +12,20 @@ echo If you want to test cpud as the init, add this line echo to the u-root command, along with the other switches. echo -initcmd=/bbin/cpud \ +# error our early for simple things +ls ${KEY} +ls -d ${UROOT} +ls ${KERNEL} + # You will need to put your host key and private key somewhere. They will be placed in the proper place in the image. # # $* is positioned where it is so you can use extra switches like -h or add files via, e.g., -files whatever # you can also add non-switch args too. # it allows you to configure the initramfs a bit more, with or without switches -u-root \ - -files $KEY \ - -uroot-source $SOURCE \ - $* \ - all \ - cmds/cpud \ - cmds/cpu \ +# The day when u-root was superconvenient to use is gone, done in by modules. +# goanywhere makes it much less hard. +go install github.com/u-root/gobusybox/src/cmd/goanywhere@latest +goanywhere ${UROOT}/cmds/core/* ./cmds/cpu ./cmds/cpud -- u-root -files $KEY echo NOT adding a host key at -files ssh_host_rsa_key:etc/ssh/ssh_host_rsa_key diff --git a/cmds/cpu/cpu.go b/cmds/cpu/cpu.go index 9c7c1286..d501f8b6 100644 --- a/cmds/cpu/cpu.go +++ b/cmds/cpu/cpu.go @@ -305,6 +305,9 @@ func main() { if *port == "22" { *sshd = true } + if *srvnfs { + *ninep = false + } verbose("connecting to %q port %q", host, *port) if err := newCPU(host, a...); err != nil { e := 1 diff --git a/session/session_linux.go b/session/session_linux.go index 404f01df..f53a1c8c 100644 --- a/session/session_linux.go +++ b/session/session_linux.go @@ -111,7 +111,7 @@ func (s *Session) Namespace() error { // The debug= option is here so you can see how to temporarily set it if needed. // It generates copious output so use it sparingly. // A useful compromise value is 5. - opts := fmt.Sprintf("version=9p2000.L,trans=fd,rfdno=%d,wfdno=%d,uname=%v,debug=0,msize=%d", fd, fd, user, s.msize) + opts := fmt.Sprintf("version=9p2000.L,noxattr,trans=fd,rfdno=%d,wfdno=%d,uname=%v,debug=0,msize=%d", fd, fd, user, s.msize) if len(s.mopts) > 0 { opts += "," + s.mopts }