Skip to content

Commit

Permalink
fix: make it work for weak ubuntu users
Browse files Browse the repository at this point in the history
Co-authored-by: Noé Tarbouriech <[email protected]>
Signed-off-by: Martin Moreira de Jesus <[email protected]>
  • Loading branch information
mmoreiradj and noetarbouriech committed Apr 21, 2024
1 parent b5dbffd commit 5251a49
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,6 @@ $RECYCLE.BIN/

# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,vim,intellij+all,rust,rust-analyzer,visualstudiocode

# RooFs and Kernel
# RootFs and Kernel
kernel/*
rootfs/*
rootfs/*
27 changes: 22 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
set shell := ["/bin/bash", "-uc"]

setup:
pushd tools/rootfs && \
./mkrootfs.sh
#!/bin/bash
pushd tools/rootfs
./mkrootfs.sh
popd

pushd tools/kernel && \
./mkkernel.sh
pushd tools/kernel
./mkkernel.sh
popd

run:
sudo capsh --keep=1 --user=$USER --inh=cap_net_admin --addamb=cap_net_admin -- -c 'RUST_BACKTRACE=1 cargo run --bin vmm -- --memory 512 --cpus 1 --initramfs=/tools/rootfs/initramfs.img --kernel tools/kernel/linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin --network-host-ip 172.29.0.1 --initramfs=/opt/repositories/virt-do/copies/cloudlet/tools/rootfs/initramfs.img --network-host-netmask 255.255.0.0'
#!/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 -- --memory 512 --cpus 1 \
--kernel tools/kernel/linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin \
--network-host-ip 172.29.0.1 --network-host-netmask 255.255.0.0 \
--initramfs=tools/rootfs/initramfs.img'

build-kernel:
#!/bin/bash
pushd tools/kernel/linux-cloud-hypervisor && \
KCFLAGS="-Wa,-mx86-used-note=no" make bzImage -j `nproc`

build-rootfs:
#!/bin/bash
pushd tools/rootfs && \
./mkrootfs.sh

0 comments on commit 5251a49

Please sign in to comment.