mirror of
https://github.com/Noratrieb/captain.git
synced 2026-01-14 22:45:01 +01:00
Initial commit
This commit is contained in:
commit
f0ffa77500
24 changed files with 802 additions and 0 deletions
1
ahoy/.gitignore
vendored
Normal file
1
ahoy/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/rootfs
|
||||
1
ahoy/README.md
Normal file
1
ahoy/README.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
# testing the system in a container
|
||||
30
ahoy/build-root.sh
Executable file
30
ahoy/build-root.sh
Executable 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
13
ahoy/run.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue