init commit
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
#!/sbin/openrc-run
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc modules
|
||||
provide swap
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting zram swap"
|
||||
if [ ! -f /usr/share/misc/source_deviceinfo ]; then
|
||||
eend 1 "deviceinfo not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
zramstart
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
if [ "$RC_RUNLEVEL" = "shutdown" ]; then
|
||||
return 0
|
||||
fi
|
||||
ebegin "Stopping zram swap"
|
||||
zramstop
|
||||
eend $?
|
||||
}
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
depend() {
|
||||
after localmount
|
||||
before display-manager tinydm
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Activating swap file"
|
||||
swapfile
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
if [ "$RC_RUNLEVEL" = "shutdown" ]; then
|
||||
return 0
|
||||
fi
|
||||
ebegin "Deactivating swap file"
|
||||
swapoff /swapfile >/dev/null 2>&1 || true
|
||||
eend 0
|
||||
}
|
||||
|
||||
restart() {
|
||||
ebegin "Restarting swap file"
|
||||
start
|
||||
eend $?
|
||||
}
|
||||
Reference in New Issue
Block a user