Update 'README.md'

This commit is contained in:
fernao 2023-06-15 19:38:58 -03:00
parent 2d2a6e3835
commit 38140127de
1 changed files with 13 additions and 3 deletions

View File

@ -1,9 +1,19 @@
# swapfile
Create and enable a swapfile for devices with USB storage
Create and enable a swapfile for devices with USB support. It is assumed that extra USB storage is already configured via opkg and fstab, as the swapfile most likely won't fit into the MTD storage.
The script must be copied into /etc/init.d/ and given execution permission `chmod +x /etc/init.d/swapfile`
The variable $SWPATH defines where the swapfile is located in the filesystem, so it must be changed accordingly
The variable $SWPATH defines where the swapfile will located in the filesystem, so it must be changed accordingly before the script is executed.
It's assumed that USB storage is already configured via opkg and fstab
Usage: `/etc/init.d/swapfile FUNCTION`
Available functions:
- boot: if swapfile service is enabled, mounts the swapfile on boot and logs the action on syslog;
- start: mounts the swapfile on demand, logs the action on syslog and displays a message on the console;
- stop: stops the swapfile, logs the action on syslog and displays a message on the console;
- restart: stops and restarts the swapfile, logs both actions on syslog and displays a message on the console;
- create: if there is no swap memory already in use, it creates a swapfile which has the same size as the device's RAM and enables it to run at boot time;
- status: checks the status of the swapfile, and is capable of detecting if swap memory is alredy present;
- enable: enables the swapfile service, so it WILL run at boot time;
- disable: disables the swapfile service, so it WILL NOT run at boot time;