@@ -34,7 +34,7 @@ run_hook() {
3434 if [ " ${mounts_zram%% * } " != " $root :/" ]; then
3535 return 0
3636 fi
37- printf ' \e[1;32m==> \e[1;37mChecking memory resources...\n'
37+ printf ' \e[1;32m==> \e[1;37mChecking memory resources ...\n'
3838
3939 # check mounts_zram:
4040 for mount in $mounts_zram ; do
@@ -57,8 +57,10 @@ run_hook() {
5757 ps_default=' n'
5858 fi
5959 if (! echo " $ps_timeout " | grep -Ei \
60- ' ^[2 -9]+[0-9]*$' & > /dev/null); then
60+ ' ^[1 -9]+[0-9]*$' & > /dev/null); then
6161 ps_timeout=8
62+ elif [ $ps_timeout -lt 3 ]; then
63+ ps_timeout=3
6264 elif [ $ps_timeout -gt 32 ]; then
6365 ps_timeout=32
6466 fi
@@ -107,7 +109,7 @@ run_hook() {
107109 # 10% free space reserved for root:
108110 zram=$(( zram* 110 / 100 ))
109111
110- printf ' \e[1;34m -> \e[1;37maval: %dM\n\e[1;34m -> ' $ram
112+ printf ' \e[1;34m -> \e[1;37maval: %dM\n\e[1;34m -> ' $ram
111113 printf ' \e[1;37mreqd: %dM\n' $(( zram+ zram_min+ ram_min))
112114 # WARM: not enough ram
113115 if [ $(( ram- ram_min- zram- zram_min)) -le 0 ]; then
@@ -125,14 +127,14 @@ run_hook() {
125127 fi
126128
127129 # prompt for input:
128- printf " \e[1;34m:: \e[1;37mLoad root file system to zram? "
130+ printf " \e[1;34m::> \e[1;37mLoad root file system to zram? "
129131 if [ " $ps_default " = ' y' ]; then
130132 printf ' [Y/n] '
131133 else
132134 printf ' [y/N] '
133135 fi
134136 # visual countdown:
135- s=0
137+ s=1
136138 while [ $s -lt $ps_timeout ]; do
137139 printf ' .'
138140 s=$(( s+ 1 ))
@@ -144,7 +146,7 @@ run_hook() {
144146 if [ $? -eq 0 ]; then
145147 s=$ps_timeout
146148 fi
147- printf ' \b\b \b '
149+ printf ' \b\b '
148150 s=$(( s+ 1 ))
149151 done
150152 ps_input=" ${ps_input:- $ps_default } "
@@ -202,7 +204,7 @@ run_hook() {
202204 mount_path=" ${mount#*: } "
203205 if [ " $flag_quiet " != true ]; then
204206 printf ' \e[1;32m==> \e[1;37mLoading %s %s\e[0;37m\n' \
205- " $mount_path " ' to zram...'
207+ " $mount_path " ' to zram ...'
206208 fi
207209 mount " $mount_id " /local_root
208210 mkdir -p " /zram_root$mount_path "
0 commit comments