Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package #73

Closed
wants to merge 13 commits into from
Closed

Package #73

wants to merge 13 commits into from

Conversation

rminnich
Copy link
Member

@rminnich rminnich commented Mar 9, 2022

No description provided.

rminnich added 8 commits March 9, 2022 14:57
The HostName is either the Host, or the HostName as found
in an .ssh/config file. Use HostName for the Dial, not Host.

Signed-off-by: Ronald G. Minnich <[email protected]>
Signed-off-by: Ronald G. Minnich <[email protected]>
We should not determine the rules of a valid port type in
this package; that's up to the net package.

Signed-off-by: Ronald G. Minnich <[email protected]>
This will, gradually, become equivalent to, and replace, the
old one that did not use the package.

Signed-off-by: Ronald G. Minnich <[email protected]>
This works to this point:
./cpu -old=false  v mount

2022/03/09 14:57:14 c.Run: (<nil>, "rootfs on / type rootfs (rw)\nproc on /proc type proc (rw,relatime)\nsysfs on /sys type sysfs (rw,relatime)\nfusectl on /sys/fs/fuse/connections
type fusectl (rw,relatime)\ndevpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)\ntmpfs on /dev/shm type tmpfs (rw,relatime)\ncpu on /tmp type tmpfs
(rw,relatime)\n127.0.0.1 on /tmp/cpu type 9p (rw,nosuid,nodev,relatime,sync,dirsync,uname=rminnich,access=client,msize=1048576,trans=fd,rfd=9,wfd=9)\nrootfs on /tmp/local type rootfs
(rw)\n127.0.0.1 on /lib type 9p (rw,nosuid,nodev,relatime,sync,dirsync,uname=rminnich,access=client,msize=1048576,trans=fd,rfd=9,wfd=9)\n127.0.0.1 on /lib64 type 9p
(rw,nosuid,nodev,relatime,sync,dirsync,uname=rminnich,access=client,msize=1048576,trans=fd,rfd=9,wfd=9)\n127.0.0.1 on /usr type 9p
(rw,nosuid,nodev,relatime,sync,dirsync,uname=rminnich,access=client,msize=1048576,trans=fd,rfd=9,wfd=9)\n127.0.0.1 on /bin type 9p
(rw,nosuid,nodev,relatime,sync,dirsync,uname=rminnich,access=client,msize=1048576,trans=fd,rfd=9,wfd=9)\n127.0.0.1 on /etc type 9p
(rw,nosuid,nodev,relatime,sync,dirsync,uname=rminnich,access=client,msize=1048576,trans=fd,rfd=9,wfd=9)\n127.0.0.1 on /home type 9p
(rw,nosuid,nodev,relatime,sync,dirsync,uname=rminnich,access=client,msize=1048576,trans=fd,rfd=9,wfd=9)\n", "")

Note that the namespace worked fine, using the package code.

Signed-off-by: Ronald G. Minnich <[email protected]>
@orangecms
Copy link
Member

orangecms commented Mar 10, 2022

What does pkg/package mean here? I am not seeing it. 🤔

Is that about the "github.com/u-root/cpu/cpu" import?

@rminnich
Copy link
Member Author

What does pkg/package mean here? I am not seeing it. 🤔

Is that about the "github.com/u-root/cpu/cpu" import?

The culture has changed. pkg is no longer the standard. Packages start at top level now.
golang-standards/project-layout#10

and you're supposed to use internal/ where possible to hide packages you don't want people to see

for $MODULES$

but cpu/cpu is still a package :-)

@rminnich
Copy link
Member Author

anyway it's not ready, this will be a series, almost there but not quite

There was an interesting gotcha with this line:
       c.Env = append(c.Env, "CPUNONCE="+c.nonce.String())

when the nonce was not set, it seemed to create a corrupt environment,
and the cmd.Start would return EINVAL.

Kernels that use integer error return should not be allowed to exist.
But they do, sadly.

Signed-off-by: Ronald G. Minnich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants