diff --git a/Dockerfile b/Dockerfile index a7fb4165..57e1a9de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,11 +44,6 @@ WORKDIR /usr/src/app/node_modules/.bin RUN ln -s ../electron/cli.js electron WORKDIR /usr/src/app -RUN \ - apt-get update \ - && apt-get install -y kmod \ - && rm -rf /var/lib/apt/lists/* - CMD \ ./zram.sh \ && node /usr/src/app/update-config-and-start.js diff --git a/docker-compose.yml b/docker-compose.yml index 098f327c..7f4229b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,6 @@ services: labels: io.balena.features.dbus: 1 io.balena.features.supervisor-api: 1 - io.balena.features.kernel-modules: 1 volumes: - 'etcher_pki:/root/.pki' - 'etcher_cache:/root/.cache' diff --git a/zram.sh b/zram.sh index 3cddcce0..6a054978 100755 --- a/zram.sh +++ b/zram.sh @@ -1,10 +1,13 @@ #!/bin/bash DEVICE=/dev/zram0 +SIZE=1G -if [ ! -b $DEVICE ]; then - modprobe zram - zramctl $DEVICE --size 1024M +CURRENT_SIZE=$(zramctl --raw --noheadings --output DISKSIZE $DEVICE) + +if [ $CURRENT_SIZE != $SIZE ]; then + swapoff $DEVICE + zramctl $DEVICE --algorithm lz4 --size $SIZE mkswap $DEVICE swapon $DEVICE fi