38e9128a8c
container/std/seccomp: remove ineffectual typecast
...
This is no longer necessary since the return type changed.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-07 05:45:51 +09:00
7ee702a44e
container/seccomp/presets: add fields to literals
...
This keeps composites analysis happy.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-07 05:11:57 +09:00
3d188ef884
std: separate seccomp constants
...
This avoids inadvertently using PNRs as syscall numbers.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-07 04:30:06 +09:00
34ccda84b2
release: 0.3.0
...
Signed-off-by: Ophestra <cat@gensokyo.uk >
v0.3.0
2025-11-06 01:37:15 +09:00
042013bb04
container/std: syscall JSON adapter
...
This provides cross-platform JSON adapter for syscall number.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-06 00:57:53 +09:00
5c2b63a7f1
container: add 386 constants
...
While it is unlikely a use case for hakurei on i686 exists, it does not hurt to have this support.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 20:21:14 +09:00
9fd97e71d0
treewide: fit test untyped int literals in 32-bit
...
This enables hakurei test suite to run on 32-bit targets.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 20:13:19 +09:00
fba201c995
container/std: relocate rule types
...
This enables its use in hst for #15 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 06:00:39 +09:00
7f27a6dc51
container/seccomp: use native types
...
This prepares NativeRule for relocation to std for #15 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 05:48:59 +09:00
b65aba9446
container/seccomp: alias libseccomp types
...
This enables tests to refer to these types and check its size.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 05:21:43 +09:00
becaf8b6d7
std: relocate seccomp lookup tables
...
This should enable resolving NativeRule in hst.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 04:48:05 +09:00
54c0d6bf48
container/seccomp/pnr: define pseudo syscalls
...
This eliminates the cgo dependency from syscall lookup.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 04:32:41 +09:00
c1399f5030
std: rename from comp
...
Seccomp lookup tables are going to be relocated here, and PNR constants.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 02:47:43 +09:00
9ac63aac0c
hst/grp_pwd: add extra test cases
...
Does not change coverage but this helps me crosscheck with my phone.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-05 01:42:42 +09:00
cb9ebf0e15
hst/grp_pwd: specify new uid format
...
This leaves slots available for additional uid ranges in Rosa OS.
This breaks all existing installations! Users are required to fix ownership manually.
Closes #18 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-04 08:24:41 +09:00
9a2a7b749f
cmd/hakurei/print: handle nil config
...
There is nothing to print in this case, and such a nil check is missing.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-03 02:20:18 +09:00
ec5cb9400c
cmd/hpkg/test: print share directory
...
This is more useful now that state is tracked here.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-03 01:51:57 +09:00
ae66b3d2fb
message: rename NewMsg to New
...
Should have done this when relocating this from container. Now is a good time to rename it before v0.3.x.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-03 01:49:27 +09:00
149bc3671a
internal/store: remove compat adapter
...
This is no longer used as everything has been migrated.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-03 01:26:01 +09:00
24435694a5
hst/config: make identifier omitempty
...
This is an optional field. Serialise it as such.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-03 01:23:15 +09:00
1c168babf2
cmd/hakurei/print: use new store interface
...
This removes the final uses of the compat interfaces.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-03 01:19:16 +09:00
0edcb7c1d3
test: print share directory
...
This is more useful now that state is tracked here.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 17:00:59 +09:00
0e5ca74b98
cmd/hakurei/print: serialise array for ps
...
Wanted to do this for a long time, since the key is redundant. This also makes it easier to migrate to the new store interface.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 16:37:08 +09:00
23ae7822bf
cmd/hakurei/parse: use new store interface
...
This greatly reduces overhead. The iterator also significantly cleans up the usage code.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 16:00:41 +09:00
898b5aed3d
internal/store: iterator over all entries
...
This is quite convenient for searching the store or printing active instance information.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 15:54:00 +09:00
7c3c3135d8
internal/outcome: track state in TMPDIR
...
The SharePath is a more stable path than RunDirPath, since it is available all the time and should remain consistent. This also fits better into the intended use case of XDG_RUNTIME_DIR.
Closes #17 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 12:40:58 +09:00
f33aea9ff9
internal/env: cleaner runtime dir fallback
...
This now places rundir inside the fallback runtime dir, so special case in internal/outcome is avoided.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 12:22:32 +09:00
e7fc311d0b
internal/outcome/shim: cover reparent and exit request paths
...
These test cases were missed when making the changes.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 11:58:09 +09:00
f5274067f6
internal/outcome/process: nil-safe unlock when failing to lock
...
This also prints a debug message which might be useful.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 11:47:51 +09:00
e7161f8e61
internal/outcome: measure finalise time
...
This also increases precision of state time output.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 05:17:33 +09:00
6931ad95c3
internal/outcome/shim: EOF as exit request fallback
...
In some cases the signal might be delivered before the signal handler is installed, and synchronising against such a case is too expensive. Instead, use the pipe being closed as a fallback to the regular exit request. This change also moves installation of the signal handler early.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 04:41:26 +09:00
2ba599b399
internal/outcome/process: use new store interface
...
This change also spawns shim before committing system state, leaving it blocking on the setup pipe. The internal/outcome/process structure is also entirely reworked to be much more readable and less error-prone, while enabling basic performance measurements. A long-standing bug where segment lock is not held during Commit is also resolved.
Closes #19 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-02 04:25:45 +09:00
d3d3417125
internal/outcome/process: relocate start and serve
...
This is useful for reordering these operations for further cleanup.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-01 19:14:59 +09:00
651cdf9ccb
internal/outcome: remove guard on main
...
This is no longer exported. Such a check is pointless.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-31 22:58:26 +09:00
68ff0a2ba6
container/params: expose pipe
...
This increases flexibility of how caller wants to handle the I/O. Also makes it no longer rely on finalizer.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-31 22:39:02 +09:00
6a0ecced90
internal/store: expose save via handle
...
The handle is otherwise inaccessible without the compat interface. This change also moves compatibility methods to separate adapter structs to avoid inadvertently using them.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-31 04:20:22 +09:00
b667fea1cb
internal/store: export new interface
...
This exposes store operations safe for direct access, and enables #19 to be implemented in internal/outcome.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-31 03:41:26 +09:00
b25ade5f3d
internal/store: rename compat interface
...
The new store implementation will be exported as Store.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-30 18:53:59 +09:00
ebdcff1049
internal/store: rename from state
...
This reduces collision with local variable names, and generally makes sense for the new store package, since it no longer specifies the state struct.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-30 18:43:55 +09:00
46c5ce4936
internal/outcome/shim: check full behaviour
...
This took significant effort to stub out, and achieves full coverage after c5aefe5e9d .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-30 05:20:49 +09:00
36f8064905
internal/outcome/process: output via msg
...
This makes it possible to instrument output behaviour through stub.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-30 03:41:38 +09:00
eeb9f98e5b
internal/outcome/shim: move signal constants
...
The magic numbers hurt readability.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-30 01:20:51 +09:00
3f9f331501
internal/outcome/shim: remove noop resume
...
The shim does not suspend output to begin with. These are leftovers from when container startup code suspends output.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-29 23:31:39 +09:00
2563391086
internal/outcome/shim: params check early
...
This is unreachable, but keeping it here as a failsafe until more test cases are added.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-29 23:10:12 +09:00
a0b4e47acc
internal/outcome: rename from app
...
This is less ambiguous, and more accurately describes the purpose of the package.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-29 04:33:13 +09:00
a52f7038e5
internal/env: relocate from app
...
This package is much cleaner to stub independently, and makes no sense to lump into app.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-29 04:11:49 +09:00
274686d10d
internal/validate: relocate from app
...
These are free of the dispatcher from internal/app. This change relocates them into their own package.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-29 03:40:09 +09:00
65342d588f
internal/app/state: improve store internals
...
This fully exposes the store internals for #19 and are final preparations for removing the legacy store interface.
This change also fixes a potential deadlock in the handle initialisation mkdir failure path. This however is never reachable in hakurei as the store is never accessed concurrently.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-29 03:21:00 +09:00
5e5826459e
internal/app/state: improve handles internals
...
This replaces the Store interface with something better reflecting the underlying data format for #19 . An implementation of Store is provided on top of the new code to ease transition.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-28 22:00:54 +09:00
4a463b7f03
internal/app/state: use absolute pathnames
...
This is less error-prone and fits better into internal/app which already uses check.Absolute for all pathnames.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-26 03:41:19 +09:00