From c9bb9e899be14c09607cc3f15253eef7f0fd8a8a Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Wed, 21 Feb 2018 12:33:08 -0800 Subject: [PATCH 1/4] base-image: update nodejs to v8.9.0 Switch from meta-nodejs to OpenEmbedded since it now officially maintained. Also updated the base system to rocko and bitbabke to 1.36 Signed-off-by: Petros Angelatos --- .gitmodules | 7 +++---- Dockerfile | 6 +++++- base-image/bitbake | 2 +- base-image/build/conf/bblayers.conf | 2 +- base-image/build/conf/local.conf | 2 +- base-image/meta-nodejs | 1 - base-image/meta-oe | 1 + base-image/oe-core | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) delete mode 160000 base-image/meta-nodejs create mode 160000 base-image/meta-oe diff --git a/.gitmodules b/.gitmodules index e75276c05..94d401148 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "base-image/meta-nodejs"] - path = base-image/meta-nodejs - url = https://github.com/imyller/meta-nodejs.git - branch = krogoth [submodule "base-image/oe-core"] path = base-image/oe-core url = git://git.openembedded.org/openembedded-core @@ -9,3 +5,6 @@ [submodule "base-image/bitbake"] path = base-image/bitbake url = git://git.openembedded.org/bitbake +[submodule "base-image/meta-oe"] + path = base-image/meta-oe + url = git://git.openembedded.org/meta-openembedded diff --git a/Dockerfile b/Dockerfile index e586aec85..dd48a83ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,11 @@ RUN apt-get -qq update \ sudo \ && rm -rf /var/lib/apt/lists/* -RUN locale-gen en_US.UTF-8 +RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && echo "LANG=en_US.UTF-8" > /etc/locale.conf \ + && locale-gen en_US.UTF-8 + ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 diff --git a/base-image/bitbake b/base-image/bitbake index 25859009b..686a230d4 160000 --- a/base-image/bitbake +++ b/base-image/bitbake @@ -1 +1 @@ -Subproject commit 25859009b710cb35ac8f9ee9eb3a7305f9e13402 +Subproject commit 686a230d48ca666bdc0b0565f8e55cc890b90c5f diff --git a/base-image/build/conf/bblayers.conf b/base-image/build/conf/bblayers.conf index a3f8e0ef3..9ea2f0ade 100644 --- a/base-image/build/conf/bblayers.conf +++ b/base-image/build/conf/bblayers.conf @@ -7,6 +7,6 @@ BBFILES ?= "" BBLAYERS ?= " \ ${TOPDIR}/../oe-core/meta \ - ${TOPDIR}/../meta-nodejs \ + ${TOPDIR}/../meta-oe/meta-oe \ ${TOPDIR}/../meta-resin-supervisor \ " diff --git a/base-image/build/conf/local.conf b/base-image/build/conf/local.conf index 7518e0304..845ff753a 100644 --- a/base-image/build/conf/local.conf +++ b/base-image/build/conf/local.conf @@ -222,4 +222,4 @@ CONF_VERSION = "1" IMAGE_INSTALL_append += " btrfs-tools ca-certificates iptables nodejs rsync" VIRTUAL-RUNTIME_init_manager="busybox" VIRTUAL-RUNTIME_dev_manager="busybox-mdev" -PREFERRED_VERSION_nodejs = "6.5.0" +# PREFERRED_VERSION_nodejs = "8.9.0" diff --git a/base-image/meta-nodejs b/base-image/meta-nodejs deleted file mode 160000 index 65ccd459e..000000000 --- a/base-image/meta-nodejs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 65ccd459ecff3fd5958509e535426135fa1381be diff --git a/base-image/meta-oe b/base-image/meta-oe new file mode 160000 index 000000000..2f7de9318 --- /dev/null +++ b/base-image/meta-oe @@ -0,0 +1 @@ +Subproject commit 2f7de931885c1b9e63c4e4238f0f7ad1388e8b6d diff --git a/base-image/oe-core b/base-image/oe-core index dd330056a..a8eb060cb 160000 --- a/base-image/oe-core +++ b/base-image/oe-core @@ -1 +1 @@ -Subproject commit dd330056ace289c8a9c5d77b6bb6e860b9f0913e +Subproject commit a8eb060cbbbb00581e8260dd6bfc31cff5558e8f From b5a9b6459d4c9e0656b276f850075d6b7369d707 Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Sun, 4 Mar 2018 17:28:47 -0800 Subject: [PATCH 2/4] clean leftover image since armel got disabled Signed-off-by: Petros Angelatos --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dd48a83ab..3ab3237d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,7 +108,6 @@ RUN rsync -a --delete /go/bin/gosuper /build/ # specified in the base-image subdirectory in the project FROM resin/rpi-node:6.5-slim as rpi-node-base FROM resin/armv7hf-node:6.5-slim as armv7hf-node-base -FROM resin/armel-node:6.5-slim as armel-node-base FROM resin/aarch64-node:6.5-slim as aarch64-node-base FROM resin/amd64-node:6.5-slim as amd64-node-base From 32c87cd33b43cfe9872e8491ef1d9f441261df58 Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Thu, 22 Feb 2018 21:33:49 -0800 Subject: [PATCH 3/4] introduce workaround until nodejs becomes RFC 3484 compliant Signed-off-by: Petros Angelatos --- Dockerfile | 10 +++++----- src/app.coffee | 11 +++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3ab3237d5..4693255f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,15 +106,15 @@ RUN rsync -a --delete /go/bin/gosuper /build/ # The node version here should match the version of the runtime image which is # specified in the base-image subdirectory in the project -FROM resin/rpi-node:6.5-slim as rpi-node-base -FROM resin/armv7hf-node:6.5-slim as armv7hf-node-base -FROM resin/aarch64-node:6.5-slim as aarch64-node-base +FROM resin/rpi-node:8.9-slim as rpi-node-base +FROM resin/armv7hf-node:8.9-slim as armv7hf-node-base +FROM resin/aarch64-node:8.9-slim as aarch64-node-base -FROM resin/amd64-node:6.5-slim as amd64-node-base +FROM resin/amd64-node:8.9-slim as amd64-node-base RUN echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-start && chmod +x /usr/bin/cross-build-start \ && echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-end && chmod +x /usr/bin/cross-build-end -FROM resin/i386-node:6.5-slim as i386-node-base +FROM resin/i386-node:8.9-slim as i386-node-base RUN echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-start && chmod +x /usr/bin/cross-build-start \ && echo '#!/bin/sh\nexit 0' > /usr/bin/cross-build-end && chmod +x /usr/bin/cross-build-end diff --git a/src/app.coffee b/src/app.coffee index 2f98d7726..ab5ccfe82 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -1,3 +1,14 @@ +do -> + # Make NodeJS RFC 3484 compliant for properly handling IPv6 + # See: https://github.com/nodejs/node/pull/14731 + # https://github.com/nodejs/node/pull/17793 + dns = require('dns') + { lookup } = dns + dns.lookup = (name, opts, cb) -> + if typeof cb isnt 'function' + return lookup(name, { verbatim: true }, opts) + return lookup(name, Object.assign({ verbatim: true }, opts), cb) + require('log-timestamp') process.on 'uncaughtException', (e) -> console.error('Got unhandled exception', e, e?.stack) From 8eb3e6a8dd2f800cfb52cc12b1886e986ef84e5b Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Sun, 4 Mar 2018 17:30:48 -0800 Subject: [PATCH 4/4] base-image: enable logs when building the yocto image Signed-off-by: Petros Angelatos --- base-image/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-image/build.sh b/base-image/build.sh index c97927dff..84ae2bf97 100755 --- a/base-image/build.sh +++ b/base-image/build.sh @@ -44,7 +44,7 @@ sudo -H -u builder \ && cp -r $SOURCE_DIR/* $BUILD_DIR/ \ && cd $BUILD_DIR \ && source oe-core/oe-init-build-env build bitbake \ - && DL_DIR=$SHARED_DOWNLOADS SSTATE_DIR=$SHARED_SSTATE MACHINE=$TARGET_MACHINE $BUILD_DIR/bitbake/bin/bitbake core-image-minimal > /dev/null" + && DL_DIR=$SHARED_DOWNLOADS SSTATE_DIR=$SHARED_SSTATE MACHINE=$TARGET_MACHINE $BUILD_DIR/bitbake/bin/bitbake core-image-minimal" tar xzf $BUILD_DIR/build/tmp-glibc/deploy/images/$TARGET_MACHINE/core-image-minimal-$TARGET_MACHINE.tar.gz -C $DEST_DIR # Delete the sstate and downloads directory so that the resulting image isn't huge # If https://github.com/moby/moby/issues/32507 gets implemented we can start using