diff --git a/container/init.go b/container/init.go index f4796f1d..76a77828 100644 --- a/container/init.go +++ b/container/init.go @@ -223,6 +223,13 @@ func initEntrypoint(k syscallDispatcher, msg message.Msg) { state := &setupState{process: make(map[int]WaitStatus), Params: ¶m.Params, Msg: msg, Context: ctx} defer cancel() + if err := k.mount(SourceTmpfsRootfs, intermediateHostPath, FstypeTmpfs, MS_NODEV|MS_NOSUID, zeroString); err != nil { + k.fatalf(msg, "cannot mount intermediate root: %v", optionalErrorUnwrap(err)) + } + if err := k.chdir(intermediateHostPath); err != nil { + k.fatalf(msg, "cannot enter intermediate host path: %v", err) + } + /* early is called right before pivot_root into intermediate root; this step is mostly for gathering information that would otherwise be difficult to obtain via library functions after pivot_root, and @@ -242,13 +249,6 @@ func initEntrypoint(k syscallDispatcher, msg message.Msg) { } } - if err := k.mount(SourceTmpfsRootfs, intermediateHostPath, FstypeTmpfs, MS_NODEV|MS_NOSUID, zeroString); err != nil { - k.fatalf(msg, "cannot mount intermediate root: %v", optionalErrorUnwrap(err)) - } - if err := k.chdir(intermediateHostPath); err != nil { - k.fatalf(msg, "cannot enter intermediate host path: %v", err) - } - if err := k.mkdir(sysrootDir, 0755); err != nil { k.fatalf(msg, "%v", err) } diff --git a/container/init_test.go b/container/init_test.go index a4eb1182..a27391a2 100644 --- a/container/init_test.go +++ b/container/init_test.go @@ -332,6 +332,8 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("fatalf", stub.ExpectArgs{"invalid op at index %d", []any{0}}, nil, nil), /* end early */ @@ -370,6 +372,8 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("fatalf", stub.ExpectArgs{"invalid op at index %d", []any{0}}, nil, nil), /* end early */ @@ -408,6 +412,8 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", stub.UniqueError(61)), call("fatalf", stub.ExpectArgs{"cannot prepare op at index %d: %v", []any{0, stub.UniqueError(61)}}, nil, nil), @@ -447,6 +453,8 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", &os.PathError{Op: "readlink", Path: "/", Err: stub.UniqueError(60)}), call("fatal", stub.ExpectArgs{[]any{"cannot readlink /: unique error 60 injected by the test suite"}}, nil, nil), @@ -486,9 +494,6 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), - /* begin early */ - call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), - /* end early */ call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, stub.UniqueError(58)), call("fatalf", stub.ExpectArgs{"cannot mount intermediate root: %v", []any{stub.UniqueError(58)}}, nil, nil), }, @@ -526,9 +531,6 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), - /* begin early */ - call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), - /* end early */ call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, stub.UniqueError(56)), call("fatalf", stub.ExpectArgs{"cannot enter intermediate host path: %v", []any{stub.UniqueError(56)}}, nil, nil), @@ -567,11 +569,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, stub.UniqueError(54)), call("fatalf", stub.ExpectArgs{"%v", []any{stub.UniqueError(54)}}, nil, nil), }, @@ -609,11 +611,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, stub.UniqueError(52)), call("fatalf", stub.ExpectArgs{"cannot bind sysroot: %v", []any{stub.UniqueError(52)}}, nil, nil), @@ -652,11 +654,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, stub.UniqueError(50)), @@ -696,11 +698,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -741,11 +743,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -787,11 +789,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -842,11 +844,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -897,11 +899,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -953,11 +955,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1010,11 +1012,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1069,11 +1071,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1129,11 +1131,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1190,11 +1192,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1252,11 +1254,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1315,11 +1317,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1379,11 +1381,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1444,11 +1446,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1510,11 +1512,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1584,11 +1586,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1691,11 +1693,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1799,11 +1801,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -1908,11 +1910,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -2032,11 +2034,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(4), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -2132,11 +2134,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(4), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -2232,11 +2234,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(4), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -2323,11 +2325,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(4), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -2418,11 +2420,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(4), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -2520,11 +2522,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil), @@ -2659,11 +2661,11 @@ func TestInitEntrypoint(t *testing.T) { call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil), call("lastcap", stub.ExpectArgs{}, uintptr(40), nil), call("mount", stub.ExpectArgs{"", "/", "", uintptr(0x8c000), ""}, nil, nil), + call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), + call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), /* begin early */ call("evalSymlinks", stub.ExpectArgs{"/"}, "/", nil), /* end early */ - call("mount", stub.ExpectArgs{"rootfs", "/proc/self/fd", "tmpfs", uintptr(6), ""}, nil, nil), - call("chdir", stub.ExpectArgs{"/proc/self/fd"}, nil, nil), call("mkdir", stub.ExpectArgs{"sysroot", os.FileMode(0755)}, nil, nil), call("mount", stub.ExpectArgs{"sysroot", "sysroot", "", uintptr(0xd000), ""}, nil, nil), call("mkdir", stub.ExpectArgs{"host", os.FileMode(0755)}, nil, nil),