aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-25 17:51:08 +0900
committerOphestra <cat@gensokyo.uk>2025-08-25 17:52:57 +0900
commit1438096339f49bdd466f3b057c7e695aa126fc3c (patch)
treea374384097ab7346c0a1cb730edc1c838f5adbc7 /cmd
parent059164d4fa80047fc50bffc1582424d00cf4c139 (diff)
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 <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hakurei/print.go4
-rw-r--r--cmd/hakurei/print_test.go31
2 files changed, 23 insertions, 12 deletions
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
@@ -280,6 +280,13 @@ App
"device": true,
"filesystem": [
{
+ "type": "bind",
+ "dst": "/",
+ "src": "/var/lib/hakurei/base/org.debian",
+ "write": true,
+ "autoroot": true
+ },
+ {
"type": "ephemeral",
"dst": "/tmp/",
"write": true,
@@ -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
}
@@ -429,6 +434,13 @@ App
"device": true,
"filesystem": [
{
+ "type": "bind",
+ "dst": "/",
+ "src": "/var/lib/hakurei/base/org.debian",
+ "write": true,
+ "autoroot": true
+ },
+ {
"type": "ephemeral",
"dst": "/tmp/",
"write": true,
@@ -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
}
@@ -632,6 +642,13 @@ func Test_printPs(t *testing.T) {
"device": true,
"filesystem": [
{
+ "type": "bind",
+ "dst": "/",
+ "src": "/var/lib/hakurei/base/org.debian",
+ "write": true,
+ "autoroot": true
+ },
+ {
"type": "ephemeral",
"dst": "/tmp/",
"write": true,
@@ -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
}