pentoo-system: add a timeout to mkswap, it is failing randomly and I have no clue why

This commit is contained in:
Rick Farina (Zero_Chaos) 2018-06-10 21:08:14 -04:00
parent e33c6687dd
commit bd0562757d
No known key found for this signature in database
GPG key ID: A5DD1427DD11F94A
2 changed files with 12 additions and 3 deletions

View file

@ -16,8 +16,17 @@ start() {
echo "${ZRAM_ABSOLUTE/\.??/}" > /sys/devices/virtual/block/zram0/disksize || RETVAL=$?
eindent
ebegin "Formatting swap"
mkswap /dev/zram0 > /dev/null || RETVAL=$?
eend ${RETVAL}
timeout -k 31 30 mkswap /dev/zram0 > /dev/null || RETVAL=$?
if [ "${RETVAL}" = "124" ]; then
cmdline="$(cat /proc/cmdline)"
if [ "${cmdline#*cdroot}" != "${cmdline}" ]; then
eend 124 "mkswap timed out, if you see this a lot \"rc-service del pentoo-zram\""
else
eend ${RETVAL} "mkswap timed out, no ZRAM available"
fi
else
eend ${RETVAL}
fi
eoutdent
if [ "${RETVAL}" = "0" ]; then
ebegin "Activating ZRAM swap device"

View file

@ -189,7 +189,7 @@ src_install() {
newinitd "${FILESDIR}"/pentoo-linux-symlinks.initd pentoo-linux-symlinks
newinitd "${FILESDIR}"/pentoo-powersave.initd pentoo-powersave
newinitd "${FILESDIR}"/pentoo-zram.initd-r2 pentoo-zram
newinitd "${FILESDIR}"/pentoo-zram.initd-r3 pentoo-zram
newconfd "${FILESDIR}"/pentoo-zram.confd pentoo-zram
dosym /var/lib/layman/pentoo/scripts/pentoo-updater.sh /usr/sbin/pentoo-updater