Skip to content

Commit

Permalink
vm: fix directory paths
Browse files Browse the repository at this point in the history
  • Loading branch information
pktpls committed Nov 20, 2023
1 parent 894dc39 commit d215805
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: ./vm.sh <location> [<imagedir>]
location - Name of a BBB location config file stored at location/<location>.yml.
imagedir - Image output directory of BBB-Configs, where *-generic-kernel.img
and *-generic-ext4-rootfs.img images for <location> can be found.
Default: /tmp/ansible-openwrt/tmp/imagebuild/<location>-core/bin/targets/x86/64
Default: ./tmp/build/<location>-core/bin/targets/x86/64
This script starts a Firecracker micro VM for a given BBB-Configs location's corerouter.
The VM starts very fast, doesn't need root permissions, and gives access to its console.
Expand Down Expand Up @@ -66,11 +66,11 @@ set -o pipefail
[ -n "$1" ] && location="$1" || usage
host="$(cat "locations/$location.yml" | yq -r '.hosts[] | select(.role == "corerouter") | .hostname')"

[ -n "$2" ] && imgdir="$4" || imgdir="/tmp/ansible-openwrt/tmp/imagebuild/$host/bin/targets/x86/64"
[ -n "$2" ] && imgdir="$4" || imgdir="./tmp/build/$host/bin/targets/x86/64"

# get kernel and rootfs

vmdir="/tmp/ansible-openwrt/vm/$host"
vmdir="./tmp/vm/$host"
mkdir -p "$vmdir"

wget -nv -O "$vmdir/extract-vmlinux.sh" https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux
Expand Down Expand Up @@ -197,4 +197,4 @@ echo "Done."
#
# https://docs.podman.io/en/latest/markdown/podman-run.1.html#network-mode-net
#
# podman run -it --rm --name="pktpls-core" -v "/tmp/ansible-openwrt/vm/pktpls-core:/vmdir:Z" --user=root --userns=keep-id --device=/dev/kvm --device=/dev/net/tun --security-opt="label=disable" --cap-add=NET_ADMIN --cap-add=NET_RAW --network=pasta docker.io/library/alpine:3.18
# podman run -it --rm --name="pktpls-core" -v "./tmp/vm/pktpls-core:/vmdir:Z" --user=root --userns=keep-id --device=/dev/kvm --device=/dev/net/tun --security-opt="label=disable" --cap-add=NET_ADMIN --cap-add=NET_RAW --network=pasta docker.io/library/alpine:3.18

0 comments on commit d215805

Please sign in to comment.