Initial commit

This commit is contained in:
nora 2024-09-15 21:02:23 +02:00
commit f0ffa77500
24 changed files with 802 additions and 0 deletions

1
ahoy/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/rootfs

1
ahoy/README.md Normal file
View file

@ -0,0 +1 @@
# testing the system in a container

30
ahoy/build-root.sh Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
target_tuple="$(uname -m)-unknown-linux-musl"
cargo build -p quarterdeck --target "$target_tuple"
cargo build -p cog --target "$target_tuple"
cargo build -p coreutils --target "$target_tuple"
target_dir="../target/$target_tuple/debug"
rm -rf rootfs
mkdir -p rootfs
mkdir -p rootfs/bin
install_bin() {
cp "$target_dir/$1" rootfs/bin
}
install_bin quarterdeck
install_bin cog
install_bin net
install_bin ls
mkdir -p rootfs/etc
cp /etc/resolv.conf rootfs/etc/resolv.conf

13
ahoy/run.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
exec bwrap \
--bind ./ahoy/rootfs / \
--proc /proc \
--dev /dev \
--unshare-user \
--unshare-ipc \
--unshare-pid \
--unshare-uts \
--unshare-cgroup \
--as-pid-1 \
/bin/quarterdeck