#!/bin/sh # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Zygmunt Krynicki set -eu GARDEN_QEMU_SYSTEM=x86_64 # NOTE The difference between _ and -. GARDEN_COMPONENT=qemu-x86-64 # If the component is not installed, fail with an error message. if [ ! -d "$SNAP"/../components/"$SNAP_REVISION"/"$GARDEN_COMPONENT" ]; then echo "install $GARDEN_COMPONENT component to use $GARDEN_QEMU_SYSTEM emulation" >&2 exit 1 fi # Execute qemu-system-$GARDEN_QEMU_SYSTEM through the symbolic link created above. exec "$SNAP"/components/"$GARDEN_COMPONENT"/bin/qemu-system-$GARDEN_QEMU_SYSTEM "$@"