Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ _zram_algorithm="lzo-rle"
Remember that the ZRAM device size references uncompressed data, real memory
utilization should be ~2-3x smaller than the zram device size due to compression.

If you run `install.sh` in a automatic script, like ansible, use `SET_CONFIG_UPDATE=[(I)nstall, (K)eep] ./install.sh` to skip the interactive-prompt.

#### A quick note RE: compression algorithms:

The default configuration using lz4 should work well for most people. lzo may
Expand Down
12 changes: 10 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@ _install() {
echo "Install package default configuration? Local config will be saved as /etc/default/zram-swap.oldconfig"
while true; do
echo "(I)nstall package default / (K)eep local configuration / View (D)iff"
printf "[i/k/d]: "
read yn
set +u
if [ -n "$SET_CONFIG_UPDATE" ]; then
yn=$SET_CONFIG_UPDATE
unset SET_CONFIG_UPDATE
else
printf "[i/k/d]: "
read yn
fi
set -u
case "$yn" in
[Ii]*)
echo "Installing package default ..."
Expand All @@ -76,6 +83,7 @@ _install() {
;;
[Kk]*) break ;;
[Dd]*) printf "%s\n\n" "$configdiff" ;;
*) ;;
esac
done
fi
Expand Down