From cb66a9176ee4656a6d3566a6d9085b665112907b Mon Sep 17 00:00:00 2001 From: nixpig <143995476+nixpig@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:09:48 +0000 Subject: [PATCH] chore: remove unused code --- README.md | 1 - container/container_reexec.go | 22 ---------------------- sysctl/sysctl.go | 1 - 3 files changed, 24 deletions(-) diff --git a/README.md b/README.md index 8f5acae..706b5e0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ This is a personal project for me to explore and better understand the OCI Runti - [ ] Build, version and package - [ ] Integration tests for other tools - [ ] Rollback (step 12) -- [ ] When `terminal` is enabled then bind mount the pseudoterminal pty to `/dev/console` (https://github.com/opencontainers/runtime-spec/blob/main/config-linux.md#default-devices). - [ ] Refactor and tidy-up diff --git a/container/container_reexec.go b/container/container_reexec.go index c762ead..3d46c83 100644 --- a/container/container_reexec.go +++ b/container/container_reexec.go @@ -43,28 +43,6 @@ func (c *Container) Reexec() error { if err := pty.Connect(); err != nil { return fmt.Errorf("connect pty: %w", err) } - - // TODO: mount /dev/console?? - // if _, err := os.Stat(filepath.Join(c.Rootfs(), "/dev/console")); os.IsNotExist(err) { - // f, err := os.Create(filepath.Join(c.Rootfs(), "/dev/console")) - // if err != nil && !os.IsExist(err) { - // return fmt.Errorf("create rootfs dev/console: %w", err) - // } - // if f != nil { - // f.Close() - // } - // } - // - // if err := syscall.Mount( - // pty.Slave.Name(), - // filepath.Join(c.Rootfs(), "dev/console"), - // "", - // uintptr(0), - // "", - // ); err != nil { - // return fmt.Errorf("mount rootfs dev/console: %w", err) - // } - } if err := filesystem.SetupRootfs(c.Rootfs(), c.Spec); err != nil { diff --git a/sysctl/sysctl.go b/sysctl/sysctl.go index d8a1545..dcb02c6 100644 --- a/sysctl/sysctl.go +++ b/sysctl/sysctl.go @@ -9,7 +9,6 @@ import ( func SetSysctl(sc map[string]string) error { for k, v := range sc { - fmt.Print(k, v) kp := strings.ReplaceAll(k, ".", "/") if err := os.WriteFile( path.Join("/proc/sys", kp),