Skip to content
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

Merged
merged 15 commits into from
Jun 10, 2020
Merged

Conversation

mstormi
Copy link
Contributor

@mstormi mstormi commented Jun 8, 2020

Fixes #825

Signed-off-by: Markus Storm [email protected]

@mstormi mstormi changed the title Offline installation Offline installation enhancements Jun 8, 2020
@mstormi mstormi marked this pull request as draft June 8, 2020 19:40
This was referenced Jun 8, 2020
mstormi added 2 commits June 9, 2020 16:38
Signed-off-by: Markus Storm <[email protected]>
Signed-off-by: Markus Storm <[email protected]>
Signed-off-by: Markus Storm <[email protected]>
@holgerfriedrich
Copy link
Member

holgerfriedrich commented Jun 9, 2020

@mstormi did you consider that the base image might not contain everything you need to compile the zram packages?

My requirements would be

  • no cross compilation during image build.
  • no package installation during build (cannot call apt of the target image)
  • separate what is to be done during image build (x86) and what during first-boot (arm/arm64)

If really needed, we could separate the compilation step out and build deb packes for zram separately. Much simpler would be to clone on build and compile during first-boot script (though I never liked the compiler toolchains on my home server, and it is not that complicated to create packages with packaging helper tools...)

For req 2 we might need to cache some Deb packages (but sure what is missing, might be a set of dependencies required)

@mstormi
Copy link
Contributor Author

mstormi commented Jun 10, 2020

I'm targeting to (git-)download the (source only) code on image build and to compile during installation. Effectively it's 2 routines, first (download) one is called on image build AND installation, second (install) on installation only.
That would satisfy your requirements I guess.

Still busy double-checking but seems compiler tools are part of both images so compilation on install on target system should work.

@mstormi mstormi marked this pull request as ready for review June 10, 2020 20:34
@mstormi mstormi requested a review from holgerfriedrich June 10, 2020 20:34
Copy link
Member

@holgerfriedrich holgerfriedrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can call zram_code_install already in build.bash, but not sure if we have make and gcc....

@@ -36,8 +36,8 @@ frontail_setup() {
if [ -d "$frontail_base" ]; then
cond_redirect npm uninstall -g frontail
fi
if ! cond_redirect npm install -g frontail; then echo "FAILED (frontail)"; return 1; fi
cond_redirect npm update -g frontail
if ! cond_redirect npm install --force -g frontail; then echo "FAILED (frontail)"; return 1; fi
Copy link
Member

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?

Copy link
Contributor Author

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.

cond_redirect apt-get install -y -q --no-install-recommends make libattr1-dev

mkdir -p "$1"
cd $1 || return 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like that defensive way of coding!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kudos go to shellcheck :-|

@@ -1,8 +1,23 @@
#!/usr/bin/env bash

install_zram_code() {
Copy link
Member

Choose a reason for hiding this comment

The 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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

@mstormi
Copy link
Contributor Author

mstormi commented Jun 10, 2020

can call zram_code_install already in build.bash, but not sure if we have make and gcc....

Please do. Note it'll not compile there but only ever in init_zram_mounts() when that is called during installation.
I think gcc/make were there when I just checked but please make sure and install them via build.bash. Also add libattr1-dev package there.

Signed-off-by: Markus Storm <[email protected]>
Signed-off-by: Markus Storm <[email protected]>
@mstormi mstormi merged commit 6332900 into openhab:master Jun 10, 2020
@holgerfriedrich
Copy link
Member

holgerfriedrich commented Jun 10, 2020

Installing via build.bash will not work.
It is prefetching in build.bash and actually installing in first-boot.bash in case no internet is available....

Will provide a hook where you can add the required stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offline install
2 participants