-
Notifications
You must be signed in to change notification settings - Fork 11
/
Justfile
61 lines (54 loc) · 1.45 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
set shell := ["/bin/bash", "-uc"]
setup:
#!/bin/bash
set -e
just build-kernel
just build-rootfs
run:
#!/bin/bash
CARGO_PATH=$(which cargo)
sudo -E capsh --keep=1 --user=$USER --inh=cap_net_admin --addamb=cap_net_admin -- -c \
'RUST_BACKTRACE=1 '$CARGO_PATH' run --bin vmm -- cli --memory 512 --cpus 1 \
--kernel tools/kernel/linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin \
--iface-host-addr 172.29.0.1 --netmask 255.255.0.0 --iface-guest-addr 172.29.0.2 \
--initramfs=../virt-do/initramfs.img'
build-kernel:
#!/bin/bash
pushd tools/kernel
./mkkernel.sh
popd
build-agent args = "":
#!/bin/bash
docker run --rm \
-v cargo-cache:/root/.cargo \
-v $PWD:/volume \
-w /volume \
-t clux/muslrust \
cargo build --release --bin agent {{args}}
build-musl-agent args = "":
#!/bin/bash
rustup target add x86_64-unknown-linux-musl
cargo build --release --bin agent --target=x86_64-unknown-linux-musl
build-rootfs mode = "dev":
#!/bin/bash
set -e
if [ "{{mode}}" = "dev" ]; then
echo "Building rootfs in debug mode"
just build-agent "--features debug-agent"
else
echo "Building rootfs in release mode"
just build-agent
fi
pushd tools/rootfs
./mkrootfs.sh
popd
configure-slip pts_num:
#!/bin/bash
if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
slattach -L /dev/pts/{{pts_num}} &
sleep 5
ip a add 172.30.0.10/16 dev sl0
ip l set sl0 up