From 41296ae80b88581ffe6cc331c323d53ba46674cb Mon Sep 17 00:00:00 2001
From: j1nx
Date: Tue, 27 Jul 2021 20:59:00 +0200
Subject: [PATCH] Remove ramdisk mount system files
---
buildroot-external/rootfs-overlay/ramdisk/.empty | 0
.../usr/lib/systemd/system/ramdisk.mount | 16 ----------------
.../usr/lib/systemd/system/zram-ramdisk.service | 15 ---------------
.../rootfs-overlay/usr/libexec/ovos-zram | 6 ++----
4 files changed, 2 insertions(+), 35 deletions(-)
delete mode 100644 buildroot-external/rootfs-overlay/ramdisk/.empty
delete mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/ramdisk.mount
delete mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/zram-ramdisk.service
diff --git a/buildroot-external/rootfs-overlay/ramdisk/.empty b/buildroot-external/rootfs-overlay/ramdisk/.empty
deleted file mode 100644
index e69de29b..00000000
diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/ramdisk.mount b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/ramdisk.mount
deleted file mode 100644
index 75bd91f9..00000000
--- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/ramdisk.mount
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=OVOS ZRAM ramdisk
-DefaultDependencies=no
-Requires=zram-ramdisk.service
-After=zram-ramdisk.service
-Before=umount.target
-Conflicts=umount.target
-
-[Mount]
-What=/dev/zram1
-Where=/ramdisk
-Type=ext4
-Options=rw,nobarrier,strictatime,nosuid,nodev
-
-[Install]
-WantedBy=local-fs.target
diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/zram-ramdisk.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/zram-ramdisk.service
deleted file mode 100644
index 917e6d55..00000000
--- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/zram-ramdisk.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=OVOS ZRAM ramdisk
-DefaultDependencies=no
-Before=ramdisk.mount
-RefuseManualStart=true
-RefuseManualStop=true
-
-[Service]
-Type=oneshot
-ExecStart=/usr/libexec/ovos-zram -t fs -m ramdisk -s 20M
-RemainAfterExit=true
-StandardOutput=null
-
-[Install]
-WantedBy=ovos-zram.target
diff --git a/buildroot-external/rootfs-overlay/usr/libexec/ovos-zram b/buildroot-external/rootfs-overlay/usr/libexec/ovos-zram
index 7ef94408..33214203 100755
--- a/buildroot-external/rootfs-overlay/usr/libexec/ovos-zram
+++ b/buildroot-external/rootfs-overlay/usr/libexec/ovos-zram
@@ -43,12 +43,10 @@ fi
# Lookup device
if [ "$TYPE" = "swap" ]; then
DEVICE="/dev/zram0"
-elif [ "$MOUNT" = "ramdisk" ]; then
- DEVICE="/dev/zram1"
elif [ "$MOUNT" = "var" ]; then
- DEVICE="/dev/zram2"
+ DEVICE="/dev/zram1"
#elif [ "$MOUNT" = "tmp" ]; then
-# DEVICE="/dev/zram3"
+# DEVICE="/dev/zram1"
else
echo "[Error] No device for lookup!"
exit 1