diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | installer/functions.sh | 2 | ||||
-rwxr-xr-x | makeself/build-x86_64-static.sh | 24 | ||||
-rwxr-xr-x | makeself/build.sh | 23 | ||||
-rwxr-xr-x | makeself/jobs/99-makeself.install.sh | 3 | ||||
-rwxr-xr-x | makeself/setup-x86_64-static.sh | 23 |
6 files changed, 55 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore index 0169e93165..b0cbf6151c 100644 --- a/.gitignore +++ b/.gitignore @@ -93,6 +93,7 @@ profile/benchmark-dictionary profile/benchmark-registry *.pyc +*.run diagrams/*.png diagrams/*.svg diff --git a/installer/functions.sh b/installer/functions.sh index 1710d1a315..6968490dc7 100644 --- a/installer/functions.sh +++ b/installer/functions.sh @@ -144,7 +144,7 @@ run_failed() { run_logfile="/dev/null" run() { - local user="${USER}" dir="${PWD}" info info_console + local user="${USER:-}" dir="${PWD}" info info_console if [ "${UID}" = "0" ] then diff --git a/makeself/build-x86_64-static.sh b/makeself/build-x86_64-static.sh new file mode 100755 index 0000000000..9d48bc9a41 --- /dev/null +++ b/makeself/build-x86_64-static.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +set -e + +if ! sudo docker inspect netdata-package-x86_64-static > /dev/null 2>&1 +then + # To run interactively: + # sudo docker run -it netdata-package-x86_64-static /bin/sh + # (add -v host-dir:guest-dir:rw arguments to mount volumes) + # To remove images in order to re-create: + # sudo docker rm -v $(sudo docker ps -a -q -f status=exited) + # sudo docker rmi netdata-package-x86_64-static + sudo docker run -v `pwd`:/usr/src/netdata.git:rw alpine:3.5 \ + /bin/sh /usr/src/netdata.git/makeself/setup-x86_64-static.sh + id=`sudo docker ps -l -q` + sudo docker commit $id netdata-package-x86_64-static + fi +sudo docker run -v `pwd`:/usr/src/netdata.git:rw netdata-package-x86_64-static \ + /bin/sh /usr/src/netdata.git/makeself/build.sh + +if [ "$USER" ] +then + sudo chown -R "$USER" . +fi diff --git a/makeself/build.sh b/makeself/build.sh index 5c1e060709..eee77f77f5 100755 --- a/makeself/build.sh +++ b/makeself/build.sh @@ -1,25 +1,8 @@ #!/usr/bin/env sh -# this script should be running in alpine linux -# install the required packages -apk add \ - bash \ - wget \ - curl \ - ncurses \ - git \ - netcat-openbsd \ - alpine-sdk \ - autoconf \ - automake \ - gcc \ - make \ - pkgconfig \ - util-linux-dev \ - zlib-dev \ - libmnl-dev \ - libnetfilter_acct-dev \ - || exit 1 +# First run setup-x86_64-static.sh under alpine linux to install +# the required packages. build-x86_64-static.sh will do this for you +# using docker. cd $(dirname "$0") || exit 1 diff --git a/makeself/jobs/99-makeself.install.sh b/makeself/jobs/99-makeself.install.sh index 5c57ec8fbd..5bdc88576c 100755 --- a/makeself/jobs/99-makeself.install.sh +++ b/makeself/jobs/99-makeself.install.sh @@ -81,3 +81,6 @@ rm "${NETDATA_INSTALL_PATH}/sbin" \ ./system/post-installer.sh \ ${NULL} +# ----------------------------------------------------------------------------- +# copy it to the netdata build dir +cp "${NETDATA_INSTALL_PATH}.gz.run" . diff --git a/makeself/setup-x86_64-static.sh b/makeself/setup-x86_64-static.sh new file mode 100755 index 0000000000..1aa68bb560 --- /dev/null +++ b/makeself/setup-x86_64-static.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +# this script should be running in alpine linux +# install the required packages +apk update +apk add --no-cache \ + bash \ + wget \ + curl \ + ncurses \ + git \ + netcat-openbsd \ + alpine-sdk \ + autoconf \ + automake \ + gcc \ + make \ + pkgconfig \ + util-linux-dev \ + zlib-dev \ + libmnl-dev \ + libnetfilter_acct-dev \ + || exit 1 |