Add creation of basejail (jail based on template, system in readonly, nullfs binded)

This commit is contained in:
yo
2023-08-06 11:15:49 +02:00
parent 56926f7200
commit a3dd0a7aa2
3 changed files with 140 additions and 37 deletions

View File

@ -14,7 +14,7 @@ import (
)
const (
gVersion = "0.37"
gVersion = "0.37a"
// TODO : Get from $jail_zpool/defaults.json
MIN_DYN_DEVFS_RULESET = 1000
@ -65,6 +65,14 @@ var (
gFetchFrom string
gUpgradeRelease string
// For a based jail, these are directories binded to basejail
gBaseDirs = []string{"bin", "boot", "lib", "libexec", "rescue", "sbin", "usr", "usr/bin",
"usr/include", "usr/lib", "usr/lib32", "usr/libdata", "usr/libexec", "usr/sbin", "usr/share"}
// These directories are to be created empty
gEmptyDirs = []string{"dev", "media", "mnt", "net", "proc"}
// Copy these from base template
gCopyDirs = []string{"etc", "root", "tmp", "var"}
gMdevfs sync.Mutex
rootCmd = &cobra.Command{