-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offline installation enhancements #950
Changes from all commits
dcdce24
90fcff2
39aa2b0
3bd89d0
19b293a
7fecb00
a57c636
c684d90
f0d1809
967663e
ec0d075
5e6d4b2
f8327de
147db38
13e8ee2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
## install code needed to compile ZRAM tools at installation time | ||
## can be called standalone from build.bash or during install from init_zram_mounts() | ||
## argument is destination directory | ||
## | ||
## install_zram_code(String dir) | ||
## | ||
install_zram_code() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fetch zram source code and dependencies to location given in $1 (will create folder)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a comment what the function does/has as arguments like Ethan does |
||
local ZRAMGIT=https://github.com/mstormi/openhabian-zram | ||
local OVERLAYFSGIT=https://github.com/kmxz/overlayfs-tools | ||
local TAG=openhabian_v1.6 | ||
cond_redirect apt-get install -y -q --no-install-recommends make libattr1-dev | ||
|
||
mkdir -p "$1" | ||
cd $1 || return 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like that defensive way of coding! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kudos go to shellcheck :-| |
||
git clone -q "$OVERLAYFSGIT" | ||
git clone -q --branch "$TAG" "$ZRAMGIT" | ||
cd - || return 1; | ||
} | ||
|
||
init_zram_mounts() { | ||
local introtext="You are about to activate the ZRAM feature.\\nBe aware you do this at your own risk of data loss.\\nPlease check out the \"ZRAM status\" thread at https://community.openhab.org/t/zram-status/80996 before proceeding." | ||
local text_lowmem="Your system has less than 1 GB of RAM. It is definitely NOT recommended to run ZRAM (AND openHAB) on your box. If you proceed now you will do so at your own risk !" | ||
local ZRamInstallLocation | ||
|
||
if [ "$1" == "install" ]; then | ||
if [ -z "$UNATTENDED" ]; then | ||
# display warn disclaimer and point to ZRAM status thread on forum | ||
|
@@ -13,19 +34,18 @@ init_zram_mounts() { | |
fi | ||
fi | ||
|
||
local ZRAMGIT=https://github.com/mstormi/openhabian-zram | ||
local TAG=openhabian_v1.5 | ||
TMP="$(mktemp -d /tmp/openhabian.XXXXX)" | ||
ZRamInstallLocation=/opt/zram | ||
|
||
/usr/bin/git clone -q --branch "$TAG" "$ZRAMGIT" "$TMP" | ||
cond_redirect apt-get install -y -q --no-install-recommends make | ||
cd "$TMP" || return 1 | ||
install_zram_code "$ZRamInstallLocation" | ||
cd "$ZRamInstallLocation"/overlayfs-tools || return 1 | ||
make | ||
cd "$ZRamInstallLocation" || return 1 | ||
/bin/sh ./install.sh | ||
/usr/bin/install -m 644 "${BASEDIR:=/opt/openhabian}"/includes/ztab /etc/ztab | ||
service zram-config start | ||
rm -rf "$TMP" | ||
|
||
cond_redirect systemctl start zram-config | ||
else | ||
service zram-config stop | ||
cond_redirect systemctl stop zram-config | ||
/bin/sh /usr/local/share/zram-config/uninstall.sh | ||
rm -f /etc/ztab | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need --force here? It will enforce new download, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not that I am aware, but we need it simply because without it'll break install when Inet is unavailable. Haven't found a better way around so far.