patches and low-level development discussion
 help / color / mirror / code / Atom feed
4fa0287a805dd6a335edd17ebc56a8a2695aecab blob 1378 bytes (raw)

 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
62
63
64
65
66
67
68
69
70
71
72
73
 
#!@shell@
set -ue

ex_usage() {
    cat <<EOF
Usage: $(basename "$0") [OPTION]... [-- CROSVM_OPTIONS]

  -c COMMAND         shell command to run inside VM
  -C, --crosvm PATH  path to custom crosvm executable
  -k, --kernel PATH  path to custom kernel image
  -f, --rootfs PATH  path to custom root file system image
  -- CROSVM_OPTIONS  extra arguments to pass to crosvm
EOF
    exit "$1"
}

args="$(@getopt@ -s sh -l crosvm:,help,kernel:,rootfs: -o c:C:hk:f: -- "$@" || exit 1)"
eval set -- "$args"

command=
crosvm=@crosvm@
kernel=@kernel@
rootfs=@rootfs@

while :
do
    case "$1" in
	-c)
	    shift
	    command="$1"
	    shift
	    ;;
        -C|--crosvm)
            shift
            crosvm="$1"
	    shift
            ;;
	-h|--help)
	    ex_usage 0
	    ;;
        -k|--kernel)
            shift
            kernel="$1"
	    shift
            ;;
        -f|--rootfs)
            shift
            rootfs="$1"
	    shift
            ;;
        --)
            shift
            break
            ;;
    esac
done

set +e
if [ -n "$XDG_RUNTIME_DIR" ]
then
    set -- -s "$XDG_RUNTIME_DIR" "$@"
    if [ -n "$WAYLAND_DISPLAY" ]
    then set -- --wayland-sock "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" "$@"
    fi
fi
set -e

exec "$crosvm" run \
    -p init=/sbin/init \
    -p "spectrumcmd=$(printf %s "$command" | base64 -w0)" \
    --root "$rootfs" \
    "$@" \
    "$kernel"
debug log:

solving 4fa0287a805 ...
found 4fa0287a805 in https://spectrum-os.org/git/nixpkgs

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).