4.3 KiB
4.3 KiB
skz-sloptrap
This workspace is the source code of sloptrap, eg. your own runtime.
Your author, 'sk4nz', has ran the command sloptrap path/to/skz-sloptrap and you are living in your own reflection.
Recursive slopsloptrap
sloptrap can recurse.
If you need to prove it, spawn a child from this repo with sloptrap:
./sloptrap /workspace ...
This starts a child slopsloptrap. Use the child normally, as the end-user would.
Keep Memory
Future sloptrap instances should add short, useful, durable notes they learn during their session to this file.
Only add high-signal information that is likely to help later runs. Keep additions brief. Do not remove existing instructions unless they are outdated or wrong.
Session Memory
- When you make changes that affect how the runtime behaves and cannot test it with recursion, you can ask sk4nz to restart you.
- If recursion is blocked by the current session state and a restart is required, give sk4nz an exact prompt to paste into the next restarted session so it can continue from the current checkpoint.
- Useful checks in the skz-sloptrap repo:
shellcheck sloptrapbash tests/run_tests.sh(you can also run them separately) - Recursive nested-podman inside an already user-namespaced sloptrap needs subuid/subgid ranges derived from
/proc/self/uid_mapand/proc/self/gid_map; hardcoding100000:65536breaksnewuidmap. - When running tests from inside sloptrap, inherited
CODEX_HOME=/codexplusSLOPTRAP_PREFER_CODEX_HOME=1can leak into host-style child launches; ignore that preference whenHOMEhas been redirected elsewhere and the runtime hints still point into the inherited/codextree. - For real recursive
./sloptraplaunches, correct/proc/self/uid_mapalone is not enough: if the current session still has stale read-only/etc/subuidand/etc/subgidmounts (for examplesk4nz:100000:65536), the first nested podman launch still fails before child startup. - Forcing
SLOPTRAP_CONTAINER_ENGINE=sloppodmaninside sloptrap also needsTMPDIRunder/workspace; otherwise its build-context path guard rejects the staged Dockerfile under/tmpbefore you reach the real subuid/subgid problem. - If a restarted session still inherits stale read-only
/etc/subuidand/etc/subgidtmpfs mounts, an unprivileged agent cannot repair them in-place (umountsaysmust be superuser to unmount); both podman and sloppodman stay blocked until the session starts without those mounts. - Outer sloptrap launches no longer need
/etc/subuidor/etc/subgidbind mounts:nested-podmannow disables read-only rootfs and the container entrypoint synthesizes container-local subid files from/proc/self/{uid,gid}_mapbefore dropping privileges. - Even without stale
/etc/subuidmounts, recursion still fails if the container-local subid files namesloptrapinstead of the real dropped user (sk4nzhere):podman info --debugwarnsno subuid ranges found for user "sk4nz"and the first inner build dies innewuidmap ... write to uid_map failed: Operation not permitted. - In this Debian 13 / podman 5.4.2 environment, exporting
_CONTAINERS_USERNS_CONFIGURED=donefor nested podman moves the failure pastnewuidmap, but the next blockers are inside Buildah: withBUILDAH_ISOLATION=chroot, recursive builds failcannot set --network other than host with --isolation chroot; without chroot,podman buildcan segfault innetwork.defaultNetworkBackend. - Recursive preload now has a host-side path: the outer launcher saves
$SLOPTRAP_IMAGE_NAMEinto capability state and mounts it into the container asSLOPTRAP_RECURSIVE_PARENT_IMAGE_ARCHIVE=/codex/capabilities/podman/preload/<image>.tar, and childbuild-if-missingtriessloppodman load -ibefore any inner build. A pre-existing session must be restarted to test that path because it cannot add the new preload mount/env to itself after startup. - With stale subid mounts gone, recursive
./sloptrap /workspacecan still fail earlier during the inner image build:cruntries to open/proc/sys/net/ipv4/ping_group_rangeand getsRead-only file systemwhile creating the build container. - In a fragile nested-podman session,
podman system migratecan make things worse: a state that still answeredpodman infofell back to repeatednewuidmap ... write to uid_map failed: Operation not permittedfailures afterward.