1
1
mirror of https://github.com/OpenVoiceOS/OpenVoiceOS synced 2025-06-05 22:19:21 +02:00

Add var zram system and preperation for r/w FS overlay system

This commit is contained in:
j1nx
2021-03-11 09:29:17 +01:00
parent 5712beb181
commit 95984efb37
5 changed files with 44 additions and 9 deletions

View File

@ -45,8 +45,10 @@ if [ "$TYPE" = "swap" ]; then
DEVICE="/dev/zram0"
elif [ "$MOUNT" = "ramdisk" ]; then
DEVICE="/dev/zram1"
elif [ "$MOUNT" = "var" ]; then
DEVICE="/dev/zram2"
#elif [ "$MOUNT" = "tmp" ]; then
# DEVICE="/dev/zram2"
# DEVICE="/dev/zram3"
else
echo "[Error] No device for lookup!"
exit 1
@ -69,3 +71,13 @@ fi
if [ "$TYPE" = "fs" ]; then
mkfs.ext4 -L "ovos-$MOUNT" -O ^has_journal "$DEVICE"
fi
# Copy persistent file structures into zram device
if [ "$MOUNT" = "var" ]; then
# Check if this is a first run
if [ ! -d /mnt/data/var ]; then
mkdir -p /mnt/data/var
cp -af /var/* /mnt/data/var/
fi
cp -af /mnt/data/var/* "$DEVICE"
fi