aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/app/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/app/app.go')
-rw-r--r--cmd/app/app.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/cmd/app/app.go b/cmd/app/app.go
index b5e5ee92..7dd8b651 100644
--- a/cmd/app/app.go
+++ b/cmd/app/app.go
@@ -35,6 +35,10 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
shell := fhs.AbsRoot.Append("bin", "zsh")
home := hst.AbsPrivateTmp.Append("home")
+ root := hst.FSOverlay{
+ Target: fhs.AbsRoot,
+ Lower: []*check.Absolute{base.Append("initial")},
+ }
c := hst.Config{
ID: id,
Enablements: new(hst.Enablements),
@@ -51,13 +55,7 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
Container: &hst.ContainerConfig{
Env: make(map[string]string),
Filesystem: []hst.FilesystemConfigJSON{
- {FilesystemConfig: &hst.FSOverlay{
- Target: fhs.AbsRoot,
- Lower: []*check.Absolute{
- base.Append("template", "initial"),
- },
- Upper: base.Append("template", "upper"),
- }},
+ {FilesystemConfig: &root},
{FilesystemConfig: &hst.FSBind{
Target: home,
Source: base.Append("state", id),
@@ -102,10 +100,13 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
if err := scanOnce(); err != nil {
return nil, err
}
- if v, err := strconv.Atoi(s.Text()); err != nil {
+ if template, identity, ok := strings.Cut(s.Text(), ":"); !ok {
+ return nil, io.ErrUnexpectedEOF
+ } else if v, err := strconv.Atoi(identity); err != nil {
return nil, err
} else {
c.Identity = v
+ root.Upper = base.Append("template", template, "upper")
}
if err := scanOnce(); err != nil {