rpi-zram-service: Remove recipe as it was moved to meta-oe

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
This commit is contained in:
Andrei Gherzan 2012-09-26 15:23:10 +03:00
parent 5d5cebd8a9
commit 60e6d7474d
3 changed files with 0 additions and 78 deletions

View File

@ -1,30 +0,0 @@
DESCRIPTION = "Linux zram compressed in-memory swap systemd service"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
inherit allarch systemd
PR = "r0"
SRC_URI = "file://rpi-zram.service \
file://rpi-load-zram.sh \
"
do_compile() {
:
}
do_install () {
install -d ${D}/${bindir}
install -m 0755 ${WORKDIR}/rpi-load-zram.sh ${D}/${bindir}
install -d ${D}/${base_libdir}/systemd/system
install -m 0644 ${WORKDIR}/rpi-zram.service ${D}/${base_libdir}/systemd/system/
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "rpi-zram.service"
FILES_${PN} += "${base_libdir}/systemd"

View File

@ -1,36 +0,0 @@
#!/bin/sh
num_cpus=$(grep -c processor /proc/cpuinfo)
[ "$num_cpus" != 0 ] || num_cpus=1
last_cpu=$((num_cpus - 1))
mem_by_cpu=$(awk -v cpus=$num_cpus '/MemTotal/ { print (($2 * 1024) / cpus) }' /proc/meminfo)
if [ "$1" = "--load" ] ; then
echo zram: Trying to load kernel module.
# Linux 3.2 workaround - value name changed :o.
# modprobe -q zram zram_num_devices=$num_cpus
# Linux < 3.2.
modprobe -q zram num_devices=$num_cpus
echo zram: Enable in-memory compressed swap of $mem_by_cpu bytes.
for i in $(seq 0 $last_cpu); do
echo $mem_by_cpu > /sys/block/zram$i/disksize
mkswap /dev/zram$i
swapon -p 100 /dev/zram$i
done
fi
if [ "$1" = "--unload" ] ; then
echo zram: Disable in-memory compressed swap.
for i in $(seq 0 $last_cpu); do
grep -q "/dev/zram$i" /proc/swaps && swapoff /dev/zram$i
done
sleep 1
echo zram: Unload kernel module.
rmmod zram
fi

View File

@ -1,12 +0,0 @@
[Unit]
Description=Enable zram compressed in-memory swap.
After=multi-user.target
[Service]
RemainAfterExit=yes
ExecStart=/usr/bin/rpi-load-zram.sh --load
ExecStop=/usr/bin/rpi-load-zram.sh --unload
Type=oneshot
[Install]
WantedBy=multi-user.target