pentoo-system: update pentoo-zram to show which step is being slow

This commit is contained in:
Rick Farina (Zero_Chaos) 2018-06-07 22:14:54 -04:00
parent 5765e86780
commit dd93527788
No known key found for this signature in database
GPG key ID: A5DD1427DD11F94A
2 changed files with 13 additions and 2 deletions

View file

@ -14,9 +14,20 @@ start() {
echo $(nproc) >/sys/devices/virtual/block/zram0/max_comp_streams || REVAL=$?
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm || RETVAL=$?
echo "${ZRAM_ABSOLUTE/\.??/}" > /sys/devices/virtual/block/zram0/disksize || RETVAL=$?
eindent
if [ -d /sys/firmware/efi ]; then
ebegin "Formatting swap"
else
ebegin "Formatting swap (this is much faster if you boot uefi)"
fi
mkswap /dev/zram0 > /dev/null || RETVAL=$?
swapon /dev/zram0 -p 10 > /dev/null || RETVAL=$?
eend ${RETVAL}
eend ${RETVAL}
eoutdent
if [ "${RETVAL}" = "0" ]; then
ebegin "Activating ZRAM swap device"
swapon /dev/zram0 -p 10 > /dev/null || RETVAL=$?
eend ${RETVAL}
fi
}
# Swap gets torn down without help from this init script