Skip to content

Commit

Permalink
fix: Entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Nov 16, 2023
1 parent 11803be commit fb39235
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ set -Eeuo pipefail
: ${RAM_SIZE:='512M'} # Maximum RAM amount

echo "❯ Starting QEMU for Docker v${VERSION}..."
echo "❯ For support visit https://github.com/qemu-tools/qemu-docker/"

info () { echo -e "\E[1;34m❯ \E[1;36m$1\E[0m" ; }
error () { echo -e >&2 "\E[1;31m❯ ERROR: $1\E[0m" ; }
trap 'error "Status $? while: ${BASH_COMMAND} (line $LINENO/$BASH_LINENO)"' ERR

[ ! -f "/run/run.sh" ] && error "Script must run inside Docker container!" && exit 11
[ ! -f "/run/entry.sh" ] && error "Script must run inside Docker container!" && exit 11
[ "$(id -u)" -ne "0" ] && error "Script must be executed with root privileges." && exit 12

STORAGE="/storage"
KERNEL=$(uname -r | cut -b 1)
MINOR=$(uname -r | cut -d '.' -f2)
ARCH=$(dpkg --print-architecture)
VERS=$(qemu-system-x86_64 --version | head -n 1 | cut -d '(' -f 1)

STORAGE="/storage"
[ ! -d "$STORAGE" ] && error "Storage folder (${STORAGE}) not found!" && exit 13

if [ ! -f "$STORAGE/boot.img" ]; then
. /run/install.sh
fi
cd /run

. /run/disk.sh # Initialize disks
. /run/network.sh # Initialize network
. install.sh # Get bootdisk
. disk.sh # Initialize disks
. network.sh # Initialize network

KVM_ERR=""
KVM_OPTS=""
Expand Down

0 comments on commit fb39235

Please sign in to comment.