| Age | Commit message (Collapse) | Author |
|
This avoids accessing uninitialised hostProc in some build modes.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
There is generally no use case where any setup is required before init, and requiring the explicit function call is error-prone and unnecessary. It also causes trouble with packages using a similar trick. This change moves argv0 check early and makes it an import side effect. The stub will be removed in v0.5.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This arranges for binfmt entries to be registered for the container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Unfortunately required to work around flawed APIs like binfmt_misc.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This cleans up preserving caps for expansion and correctly sets privileged caps.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is usable as scratch space during early.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This does not make sense as part of the public API, so make it internal.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is not considered an error, if the process finishes while the signal is being delivered.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This makes package check portable, and removes nonportable behaviour from package pkg, pipewire, and system. All other packages remain nonportable due to their nature. No latency increase was observed due to this change on amd64 and arm64 linux.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This removes netpoll boilerplate for the most common use case.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This package is not container-specific.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
These are generally useful, and none of them are container-specific. Syscalls subtle to use and requiring container-specific setup remains in container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This change removes inconsistencies collected over time in this package.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This enables loopback networking when owning the net namespace.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This avoids a race between returning from syscall and checking the state.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Blocking prevents further wait4 processing causing ops to never receive their signals.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This includes the string for the failing op which helps with troubleshooting.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Due to the special nature of the init process, regular wait calls are unavailable. This change provides infrastructure to access wait4 loop state from Op.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is useful currently for daemon Op, but could be used for many other things.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is at a point considered to be already "within" the container. Daemons internal to the container can be started here.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This prevents leaking the setup pipe.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This closes them during the adopt wait delay. This also keeps them alive.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
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>
|
|
Init is not very talkative after process start even when verbose. Suspending output here is pointless and does more harm than good.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
The SIGTERM signal is delivered in many other cases and can lead to strange behaviour. The unconditional resume of the logger also causes strange behaviour in the cancellation forwarding path. This change also passes through additional signals.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This covers invalid call to Init.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
When using two channels it is possible for the other case to be reached before all pending winfo are consumed, causing incorrect reporting.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
These errors are printed with a descriptive message prefixed to them, so it is more readable to expose the underlying errno.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This package is quite useful. This change allows it to be imported without importing container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This allows referencing FHS pathnames without importing container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This frees all container instances of side effects.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This makes it possible to optionally omit the identifying verbose message, for when the Op implementation can provide a much more useful message in its case, using information not yet available to the String method.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This helps indicate the exact origin and nature of the error. This eliminates generic WrapErr from container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is much cleaner from both the return statement and the error handling.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This moves repeated Op errors and impossible internal state errors off of msg.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This used to be entirely done via integration tests, with almost no hope of error injection and coverage profile. These tests significantly increase confidence of future work in this area.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This allows instrumentation of calls from goroutine without relying on finalizers.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This reduces the size of []kexpect in the test suite.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Scheduler nondeterminism cannot be accounted for, so do this instead.
There should not be any performance penalty as these calls are optimised out for direct.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
The file is very difficult to stub. Pass fd instead as it is the value that is actually useful.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This degrades test performance if not stubbed out.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This allows tests to stub all kernel behaviour, enabling measurement of all function call arguments and error injection.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Check ops early and eliminate duplicate checks.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This helps with the eventual separation of all setup ops into individual files.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is only a nice to have feature as the init process has no additional privileges and the monitor process was never reachable anyway.
Closes #4.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This allows some LSM setup in the parent.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is useful for ops that need to be aware of previous instances of themselves.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
This is simultaneously more efficient and less error-prone. This change caused minor API changes in multiple other packages.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
Signed-off-by: Ophestra <cat@gensokyo.uk>
|
|
These literals were missed when the constants were first defined.
Signed-off-by: Ophestra <cat@gensokyo.uk>
|