diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/hakurei/command.go | 7 | ||||
| -rw-r--r-- | cmd/hpkg/app.go | 2 | ||||
| -rw-r--r-- | cmd/hpkg/main.go | 4 | ||||
| -rw-r--r-- | cmd/hpkg/with.go | 2 |
4 files changed, 9 insertions, 6 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index 213cc416..187ed5d3 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -3,7 +3,6 @@ package main import ( "context" "encoding/json" - "errors" "fmt" "io" "log" @@ -13,6 +12,7 @@ import ( "strconv" "sync" "time" + _ "unsafe" "hakurei.app/command" "hakurei.app/container/check" @@ -25,6 +25,9 @@ import ( "hakurei.app/system/dbus" ) +//go:linkname optionalErrorUnwrap hakurei.app/container.optionalErrorUnwrap +func optionalErrorUnwrap(_ error) error + func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErrs, out io.Writer) command.Command { var ( flagVerbose bool @@ -115,7 +118,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr progPath := shell if len(args) > 0 { if p, err := exec.LookPath(args[0]); err != nil { - log.Fatal(errors.Unwrap(err)) + log.Fatal(optionalErrorUnwrap(err)) return err } else if progPath, err = check.NewAbs(p); err != nil { log.Fatal(err.Error()) diff --git a/cmd/hpkg/app.go b/cmd/hpkg/app.go index e8bd8b99..d03c8b03 100644 --- a/cmd/hpkg/app.go +++ b/cmd/hpkg/app.go @@ -91,7 +91,7 @@ func (app *appInfo) toHst(pathSet *appPathSet, pathname *check.Absolute, argv [] {FilesystemConfig: &hst.FSLink{Target: pathCurrentSystem, Linkname: app.CurrentSystem.String()}}, {FilesystemConfig: &hst.FSLink{Target: pathBin, Linkname: pathSwBin.String()}}, {FilesystemConfig: &hst.FSLink{Target: fhs.AbsUsrBin, Linkname: pathSwBin.String()}}, - {FilesystemConfig: &hst.FSBind{Source: pathSet.metaPath, Target: hst.AbsTmp.Append("app")}}, + {FilesystemConfig: &hst.FSBind{Source: pathSet.metaPath, Target: hst.AbsPrivateTmp.Append("app")}}, {FilesystemConfig: &hst.FSBind{Source: fhs.AbsEtc.Append("resolv.conf"), Optional: true}}, {FilesystemConfig: &hst.FSBind{Source: fhs.AbsSys.Append("block"), Optional: true}}, {FilesystemConfig: &hst.FSBind{Source: fhs.AbsSys.Append("bus"), Optional: true}}, diff --git a/cmd/hpkg/main.go b/cmd/hpkg/main.go index e3346bff..757dc144 100644 --- a/cmd/hpkg/main.go +++ b/cmd/hpkg/main.go @@ -162,7 +162,7 @@ func main() { withCacheDir(ctx, msg, "install", []string{ // export inner bundle path in the environment - "export BUNDLE=" + hst.Tmp + "/bundle", + "export BUNDLE=" + hst.PrivateTmp + "/bundle", // replace inner /etc "mkdir -p etc", "chmod -R +w etc", @@ -309,7 +309,7 @@ func main() { if a.GPU { config.Container.Filesystem = append(config.Container.Filesystem, - hst.FilesystemConfigJSON{FilesystemConfig: &hst.FSBind{Source: pathSet.nixPath.Append(".nixGL"), Target: hst.AbsTmp.Append("nixGL")}}) + hst.FilesystemConfigJSON{FilesystemConfig: &hst.FSBind{Source: pathSet.nixPath.Append(".nixGL"), Target: hst.AbsPrivateTmp.Append("nixGL")}}) appendGPUFilesystem(config) } diff --git a/cmd/hpkg/with.go b/cmd/hpkg/with.go index cb86f502..5cb1533e 100644 --- a/cmd/hpkg/with.go +++ b/cmd/hpkg/with.go @@ -88,7 +88,7 @@ func withCacheDir( {FilesystemConfig: &hst.FSLink{Target: pathCurrentSystem, Linkname: app.CurrentSystem.String()}}, {FilesystemConfig: &hst.FSLink{Target: pathBin, Linkname: pathSwBin.String()}}, {FilesystemConfig: &hst.FSLink{Target: fhs.AbsUsrBin, Linkname: pathSwBin.String()}}, - {FilesystemConfig: &hst.FSBind{Source: workDir, Target: hst.AbsTmp.Append("bundle")}}, + {FilesystemConfig: &hst.FSBind{Source: workDir, Target: hst.AbsPrivateTmp.Append("bundle")}}, {FilesystemConfig: &hst.FSBind{Target: pathDataData.Append(app.ID, "cache"), Source: pathSet.cacheDir, Write: true, Ensure: true}}, }, |
