Skip to content

Commit

Permalink
Only auto-update zram once
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Dec 18, 2024
1 parent 9307e20 commit dbcdb6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions build-image/openhabian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ java_opt=17

# install zram per default, set to "disable" to skip installation
zraminstall=enable
zram_reset=done # remove when zram is no longer needed to auto update

# start comitup hotspot if internet is not reachable
hotspot=enable
Expand Down
2 changes: 1 addition & 1 deletion functions/zram.bash
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ init_zram_mounts() {
if ! cond_redirect rm -rf /usr/local/lib/zram-config; then echo "FAILED (zram-config lib)"; return 1; fi
if ! cond_redirect rm -f /var/log/zram-config; then echo "FAILED (zram-config link)"; return 1; fi
if cond_redirect rm -f /etc/logrotate.d/zram-config; then echo "OK"; else echo "FAILED (logrotate)"; return 1; fi
elif zram_is_installed; then
elif zram_is_installed && [[ -z $zram_reset ]]; then
echo -n "$(timestamp) [openHABian] Updating zram service... "
if ! cond_redirect systemctl stop zram-config.service; then echo "FAILED (stop zram)"; return 1; fi
if ! cond_redirect mkdir -p /usr/local/lib/zram-config/; then echo "FAILED (create directory)"; return 1; fi
Expand Down
2 changes: 1 addition & 1 deletion openhabian-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ else
load_create_config
openhabian_console_check
openhabian_update_check
zram_is_installed && init_zram_mounts "update" # update zram to fix potential issues
zram_is_installed && init_zram_mounts "update"; echo "zram_reset=done" >> /etc/openhabian.conf # update zram to fix potential issues
jsscripting_npm_check "openhab"
jsscripting_npm_check "openhab_rules_tools"
while show_main_menu; do
Expand Down

0 comments on commit dbcdb6c

Please sign in to comment.