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:
@ -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
|
||||
|
Reference in New Issue
Block a user