12345678910111213141516171819202122232425262728 |
- # shellcheck shell=sh
- (
- [ "${ZRAM_COUNT}" ] && \
- [ "${ZRAM_ALGO}" ] && \
- [ "${ZRAM_SIZE}" ] || \
- exit
- : "${ZRAM_PRI:=10}"
- set --
- msg 'creating ZRAMS'
- i=1; while [ "${i}" -le "${ZRAM_COUNT}" ]; do
- set -- "${@}" "$(zramctl -f -s "${ZRAM_SIZE}" -a "${ZRAM_ALGO}")"
- : $(( i += 1 )); done
- for zram; do
- mkswap "${zram}"
- done
- msg 'mounting ZRAMS'
- for zram; do
- swapon -p "${ZRAM_PRI}" "${zram}"
- done
- ) &
|