28595f72ef
This adds a custom swap file service, which allows specifying a recommended swap size in the deviceinfo file via `deviceinfo_swap_size_recommended`. For the N900 this defaults to 1024 MB now. As the swap file is created in the root partition, we have encrypted swap now (unless encryption is disabled with `--no-fde`).
27 lines
265 B
Text
Executable file
27 lines
265 B
Text
Executable file
#!/sbin/openrc-run
|
|
|
|
depend()
|
|
{
|
|
after localmount
|
|
}
|
|
|
|
start()
|
|
{
|
|
ebegin "Activating swap file"
|
|
/sbin/swapfile
|
|
eend $?
|
|
}
|
|
|
|
stop()
|
|
{
|
|
ebegin "Deactivating swap file"
|
|
/sbin/swapoff -a >/dev/null
|
|
eend $?
|
|
}
|
|
|
|
restart()
|
|
{
|
|
ebegin "Restarting swap file"
|
|
start
|
|
eend $?
|
|
}
|