From 1438096339f49bdd466f3b057c7e695aa126fc3c Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 25 Aug 2025 17:51:08 +0900 Subject: hst/config: handle filesystem entry targeting root This allows any fstype supported by hst to be directly mounted on sysroot. A special case in internal/app applies the matching entry early and excludes it from path hiding. Closes #5. Signed-off-by: Ophestra --- cmd/hakurei/print.go | 4 ---- cmd/hakurei/print_test.go | 31 +++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 12 deletions(-) (limited to 'cmd') diff --git a/cmd/hakurei/print.go b/cmd/hakurei/print.go index d163efc3..3e238d65 100644 --- a/cmd/hakurei/print.go +++ b/cmd/hakurei/print.go @@ -110,10 +110,6 @@ func printShowInstance( } t.Printf(" Flags:\t%s\n", strings.Join(flags, " ")) - if params.AutoRoot != nil { - t.Printf(" Root:\t%s (%d)\n", params.AutoRoot, params.RootFlags) - } - etc := params.Etc if etc == nil { etc = container.AbsFHSEtc diff --git a/cmd/hakurei/print_test.go b/cmd/hakurei/print_test.go index dab4b9ec..b55c1044 100644 --- a/cmd/hakurei/print_test.go +++ b/cmd/hakurei/print_test.go @@ -42,12 +42,12 @@ func Test_printShowInstance(t *testing.T) { Data: /var/lib/hakurei/u0/org.chromium.Chromium Hostname: localhost Flags: userns devel net abstract device tty mapuid autoetc - Root: /var/lib/hakurei/base/org.debian (2) Etc: /etc/ Path: /run/current-system/sw/bin/chromium Arguments: chromium --ignore-gpu-blocklist --disable-smooth-scrolling --enable-features=UseOzonePlatform --ozone-platform=wayland Filesystem + autoroot:w:/var/lib/hakurei/base/org.debian w+ephemeral(-rwxr-xr-x):/tmp/ w*/nix/store:/mnt-root/nix/.rw-store/upper:/mnt-root/nix/.rw-store/work:/mnt-root/nix/.ro-store */nix/store @@ -121,12 +121,12 @@ App Data: /var/lib/hakurei/u0/org.chromium.Chromium Hostname: localhost Flags: userns devel net abstract device tty mapuid autoetc - Root: /var/lib/hakurei/base/org.debian (2) Etc: /etc/ Path: /run/current-system/sw/bin/chromium Arguments: chromium --ignore-gpu-blocklist --disable-smooth-scrolling --enable-features=UseOzonePlatform --ozone-platform=wayland Filesystem + autoroot:w:/var/lib/hakurei/base/org.debian w+ephemeral(-rwxr-xr-x):/tmp/ w*/nix/store:/mnt-root/nix/.rw-store/upper:/mnt-root/nix/.rw-store/work:/mnt-root/nix/.ro-store */nix/store @@ -279,6 +279,13 @@ App "map_real_uid": true, "device": true, "filesystem": [ + { + "type": "bind", + "dst": "/", + "src": "/var/lib/hakurei/base/org.debian", + "write": true, + "autoroot": true + }, { "type": "ephemeral", "dst": "/tmp/", @@ -325,8 +332,6 @@ App "linkname": "/run/user/150" } ], - "auto_root": "/var/lib/hakurei/base/org.debian", - "root_flags": 2, "etc": "/etc/", "auto_etc": true } @@ -428,6 +433,13 @@ App "map_real_uid": true, "device": true, "filesystem": [ + { + "type": "bind", + "dst": "/", + "src": "/var/lib/hakurei/base/org.debian", + "write": true, + "autoroot": true + }, { "type": "ephemeral", "dst": "/tmp/", @@ -474,8 +486,6 @@ App "linkname": "/run/user/150" } ], - "auto_root": "/var/lib/hakurei/base/org.debian", - "root_flags": 2, "etc": "/etc/", "auto_etc": true } @@ -631,6 +641,13 @@ func Test_printPs(t *testing.T) { "map_real_uid": true, "device": true, "filesystem": [ + { + "type": "bind", + "dst": "/", + "src": "/var/lib/hakurei/base/org.debian", + "write": true, + "autoroot": true + }, { "type": "ephemeral", "dst": "/tmp/", @@ -677,8 +694,6 @@ func Test_printPs(t *testing.T) { "linkname": "/run/user/150" } ], - "auto_root": "/var/lib/hakurei/base/org.debian", - "root_flags": 2, "etc": "/etc/", "auto_etc": true } -- cgit v1.3.1