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

Merge pull request #31 from kroese/dev

Minor fixes
parents fcc77eed 7d4cff14
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,5 +22,5 @@ jobs:
      - name: Run ShellCheck
        uses: ludeeus/action-shellcheck@master
        env:
          SHELLCHECK_OPTS: -e SC2001 -e SC2002 -e SC2116 -e SC2034 -e SC1091 -e SC2143 -e SC2223 -e SC2086 -e SC2145 -e SC2015 -e SC2268 -e SC2207
          SHELLCHECK_OPTS: -e SC2001 -e SC2002 -e SC2116 -e SC2034 -e SC1091 -e SC2143 -e SC2223 -e SC2086 -e SC2145 -e SC2015 -e SC2268 -e SC2207 -e SC2064 
+3 −4
Original line number Diff line number Diff line
@@ -15,12 +15,10 @@ RUN apt-get update && apt-get -y upgrade && \
	wget \
	unzip \
	procps \
	ethtool \
	dnsmasq \
	iptables \
	iproute2 \
	xz-utils \
	qemu-utils \
	btrfs-progs \
	bridge-utils \
	netcat-openbsd \
@@ -35,6 +33,7 @@ COPY serial.sh /run/
COPY server.sh /run/
COPY install.sh /run/
COPY network.sh /run/

COPY agent/agent.sh /agent/
COPY agent/service.sh /agent/

@@ -61,9 +60,9 @@ EXPOSE 445
EXPOSE 5000
EXPOSE 5001

ENV RAM_SIZE 512M
ENV DISK_SIZE 16G
ENV CPU_CORES 1
ENV DISK_SIZE 16G
ENV RAM_SIZE 512M

#ENV URL https://global.synologydownload.com/download/DSM/beta/7.2/64216/DSM_VirtualDSM_64216.pat
#ENV URL https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat
+3 −3
Original line number Diff line number Diff line
@@ -122,6 +122,9 @@ mkdir -p $LOC
cp /agent/service.sh $LOC/agent.sh
chmod +x $LOC/agent.sh

# Store agent version
echo "2" > "$IMG"/agent.ver

if [ "$PRIVILEGED" = false ]; then

  echo "Install: Installing system partition..."
@@ -137,9 +140,6 @@ fi

rm -rf $MOUNT

# Store agent version
echo "2" > "$IMG"/agent.ver

mv -f "$BOOT" "$IMG"/"$BASE".boot.img
mv -f "$SYSTEM" "$IMG"/"$BASE".system.img

+2 −4
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@ set -eu
: ${VM_NET_MAC:=''}
: ${VM_NET_IP:='20.20.20.21'}

: ${DNS_SERVERS:=''}
: ${DNSMASQ:='/usr/sbin/dnsmasq'}
: ${DNSMASQ_OPTS:=''}
: ${DNSMASQ_CONF_DIR:='/etc/dnsmasq.d'}
: ${DNS_SERVERS:=''}

# ######################################
#  Functions
@@ -66,9 +66,7 @@ fi
#If environment variabele not set fall back to file
if [ -z "$VM_NET_MAC" ]; then
  FILE="${IMG}/guest.mac"
  if [ ! -f "$FILE" ]; then
    echo "00:11:32:2C:A7:85" > "$FILE"
  fi
  [ ! -f "$FILE" ] && echo "00:11:32:2C:A7:85" > "$FILE"
  VM_NET_MAC=$(cat "${FILE}")
fi

+4 −8
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ _QEMU_SHUTDOWN_COUNTER=/run/qemu.counter
_trap(){
    func="$1" ; shift
    for sig ; do
        trap '$func $sig' "$sig"
        trap "$func $sig" "$sig"
    done
}

@@ -22,16 +22,12 @@ _graceful_shutdown(){
  local QEMU_POWERDOWN_TIMEOUT="${QEMU_POWERDOWN_TIMEOUT:-120}"

  set +e
  echo "Trapped $1 signal"
  echo "Received $1 signal.."
  echo 0 > "${_QEMU_SHUTDOWN_COUNTER}"

  FILE="${IMG}/agent.ver"
  if [ ! -f "$FILE" ]; then
    AGENT_VERSION="1"
    echo "$AGENT_VERSION" > "$IMG"/agent.ver
  else
  [ ! -f "$FILE" ] && echo "1" > "$FILE"
  AGENT_VERSION=$(cat "${FILE}")
  fi

  # Don't send the powerdown signal because Synology ignores it
  # echo 'system_powerdown' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}">/dev/null
Loading