Unverified Commit 54978933 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Support image commit (#617)

parent fa2ebf6f
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ echo "❯ For support visit $SUPPORT"

: "${BOOT:=""}"            # URL of the ISO file
: "${DEBUG:="N"}"          # Disable debugging
: "${COMMIT:="N"}"         # Commit to image
: "${MACHINE:="q35"}"      # Machine selection
: "${ALLOCATE:=""}"        # Preallocate diskspace
: "${ARGUMENTS:=""}"       # Extra QEMU parameters
@@ -26,13 +27,13 @@ echo "❯ For support visit $SUPPORT"
: "${DISK_SIZE:="16G"}"    # Initial data disk size
: "${BOOT_MODE:=""}"       # Boot system with UEFI
: "${BOOT_INDEX:="9"}"     # Boot index of CD drive
: "${STORAGE:="/storage"}" # Storage folder location

# Helper variables

PROCESS="${APP,,}"
PROCESS="${PROCESS// /-}"

STORAGE="/storage"
INFO="/run/shm/msg.html"
PAGE="/run/shm/index.html"
TEMPLATE="/var/www/index.html"
@@ -64,6 +65,8 @@ if [ -z "${CPU// /}" ] && grep -qi "model:" <<< "$CPI"; then
fi

CPU="${CPU// CPU/}"
CPU="${CPU// 16 Core/}"
CPU="${CPU// Processor/}"
CPU="${CPU// Quad core/}"
CPU="${CPU// with Radeon Graphics/}"
[ -z "${CPU// /}" ] && CPU="Unknown"
@@ -78,9 +81,14 @@ fi

# Check folder

if [[ "$COMMIT" != [Nn]* ]]; then
  STORAGE="/local"
  mkdir -p "$STORAGE"
else
  if [ ! -d "$STORAGE" ]; then
    error "Storage folder ($STORAGE) not found!" && exit 13
  fi
fi

# Read memory
RAM_SPARE=500000000