| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # SPDX-FileCopyrightText: Zygmunt Krynicki |
| 4 | set -eu |
| 5 | |
| 6 | GARDEN_QEMU_SYSTEM=riscv64 |
| 7 | GARDEN_COMPONENT=qemu-"$GARDEN_QEMU_SYSTEM" |
| 8 | |
| 9 | # If the component is not installed, fail with an error message. |
| 10 | if [scip-shell system . . `[`. ! -d "$SNAP"/../components/"$SNAP_REVISION"/"$GARDEN_COMPONENT" ]; then |
| 11 | echoscip-shell system . . echo. "install $GARDEN_COMPONENT component to use $GARDEN_QEMU_SYSTEM emulation" >&2 |
| 12 | exit 1 |
| 13 | fi |
| 14 | |
| 15 | # Execute qemu-system-$GARDEN_QEMU_SYSTEM through the symbolic link created above. |
| 16 | exec "$SNAP"/components/"$GARDEN_COMPONENT"/bin/qemu-system-$GARDEN_QEMU_SYSTEM "$@" |