aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst
diff options
context:
space:
mode:
Diffstat (limited to 'hst')
-rw-r--r--hst/container.go7
-rw-r--r--hst/template.go11
-rw-r--r--hst/template_test.go2
3 files changed, 16 insertions, 4 deletions
diff --git a/hst/container.go b/hst/container.go
index c385344c..56229929 100644
--- a/hst/container.go
+++ b/hst/container.go
@@ -45,10 +45,17 @@ type (
// create symlinks inside container filesystem
Link [][2]string `json:"symlink"`
+ // automatically bind mount top-level directories to container root;
+ // the zero value disables this behaviour
+ AutoRoot string `json:"auto_root,omitempty"`
+ // extra flags for AutoRoot
+ RootFlags int `json:"root_flags,omitempty"`
+
// read-only /etc directory
Etc string `json:"etc,omitempty"`
// automatically set up /etc symlinks
AutoEtc bool `json:"auto_etc"`
+
// cover these paths or create them if they do not already exist
Cover []string `json:"cover"`
}
diff --git a/hst/template.go b/hst/template.go
index 3ab9c277..391e58e2 100644
--- a/hst/template.go
+++ b/hst/template.go
@@ -1,6 +1,7 @@
package hst
import (
+ "hakurei.app/container"
"hakurei.app/container/seccomp"
"hakurei.app/system"
"hakurei.app/system/dbus"
@@ -85,10 +86,12 @@ func Template() *Config {
Dst: "/data/data/org.chromium.Chromium", Write: true, Must: true},
{Src: "/dev/dri", Device: true},
},
- Link: [][2]string{{"/run/user/65534", "/run/user/150"}},
- Etc: "/etc",
- AutoEtc: true,
- Cover: []string{"/var/run/nscd"},
+ Link: [][2]string{{"/run/user/65534", "/run/user/150"}},
+ AutoRoot: "/var/lib/hakurei/base/org.debian",
+ RootFlags: container.BindWritable,
+ Etc: "/etc",
+ AutoEtc: true,
+ Cover: []string{"/var/run/nscd"},
},
}
}
diff --git a/hst/template_test.go b/hst/template_test.go
index 8761b7d4..7f0caa7d 100644
--- a/hst/template_test.go
+++ b/hst/template_test.go
@@ -126,6 +126,8 @@ func TestTemplate(t *testing.T) {
"/run/user/150"
]
],
+ "auto_root": "/var/lib/hakurei/base/org.debian",
+ "root_flags": 2,
"etc": "/etc",
"auto_etc": true,
"cover": [