Skip to content

Commit 8d95bec

Browse files
committed
2.0.2
1 parent c3c56af commit 8d95bec

File tree

5 files changed

+11
-46
lines changed

5 files changed

+11
-46
lines changed

NOTES.rst

Lines changed: 0 additions & 31 deletions
This file was deleted.

README.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ that completely loads the root file system to a zram partition
77
during the initramfs_ boot stage.
88

99

10-
WARNING
11-
=======
12-
13-
ramroot is currently not working with any kernel 5.10+.
14-
15-
1610
Usage
1711
=====
1812

usr/lib/initcpio/hooks/ramroot

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

usr/share/man/man5/ramroot.conf.5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RAMROOT.CONF 5 "March 2021" "ramroot 2.0.2" "ramroot.conf manual"
1+
.TH RAMROOT.CONF 5 "2021-08-25" "ramroot 2.0.2" "ramroot.conf manual"
22
.SH NAME
33
ramroot.conf - ramroot initcpio hook configuration file
44
file

usr/share/man/man8/ramroot.8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RAMROOT 8 "March 2021" "ramroot 2.0.2" "Ramroot Manual"
1+
.TH RAMROOT 8 "2021-08-25" "ramroot 2.0.2" "Ramroot Manual"
22
.SH NAME
33
ramroot \- enable/disable ramroot initcpio hook and/or generate config
44
file

0 commit comments

Comments
 (0)