diff --git a/.gitmodules b/.gitmodules index cbdc468..e15a832 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "openwrt"] path = openwrt - url = https://github.com/tessel/openwrt.git + url = https://github.com/tessel/lede.git [submodule "upstream-packages"] path = upstream-packages - url = https://github.com/kevinmehall/packages.git + url = https://github.com/openwrt/packages.git diff --git a/config.mk b/config.mk index 7f9f121..080d65c 100644 --- a/config.mk +++ b/config.mk @@ -74,6 +74,7 @@ CONFIG_SDK=y CONFIG_IMAGEOPT=y CONFIG_VERSIONOPT=y -CONFIG_VERSION_REPO="http://downloads.openwrt.org/chaos_calmer/15.05-rc2/%S/packages" +CONFIG_VERSION_REPO="http://downloads.lede-project.org/releases/17.01.1" CONFIG_VERSION_MANUFACTURER="Tessel" CONFIG_VERSION_FILENAMES=n +CONFIG_VERSION_CODE_FILENAMES=n diff --git a/files/etc/banner b/files/etc/banner index 483653c..76968a3 100644 --- a/files/etc/banner +++ b/files/etc/banner @@ -1 +1 @@ -Tessel 2 / Built on OpenWrt +Tessel 2 / Built on LEDE diff --git a/files/etc/shadow b/files/etc/shadow new file mode 100644 index 0000000..0948b24 --- /dev/null +++ b/files/etc/shadow @@ -0,0 +1,6 @@ +root:!:0:0:99999:7::: +daemon:*:0:0:99999:7::: +ftp:*:0:0:99999:7::: +network:*:0:0:99999:7::: +nobody:*:0:0:99999:7::: +tessel:*:0:0:99999:7::: diff --git a/openwrt b/openwrt index 821bd71..d378c4d 160000 --- a/openwrt +++ b/openwrt @@ -1 +1 @@ -Subproject commit 821bd71ed54c98828fed996156103ae086ecad40 +Subproject commit d378c4d3eb14eb32a69caae7124ef5df46998cc5 diff --git a/package/node/node/Makefile b/package/node/node/Makefile index 4bea98c..3a4171a 100644 --- a/package/node/node/Makefile +++ b/package/node/node/Makefile @@ -1,69 +1,115 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + include $(TOPDIR)/rules.mk PKG_NAME:=node -PKG_VERSION:=v4.5.0 +PKG_VERSION:=v6.10.3 PKG_RELEASE:=1 -PKG_SOURCE:=node-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://nodejs.org/dist/${PKG_VERSION}/ -PKG_SHA256SUM:=74ced83b8d890d90e2a8b0d54b0d0e9b5e01d6fd6148cec6e9911ff6eaf0cf21 +PKG_SOURCE:=node-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION} +PKG_MD5SUM:=e82ede32b31a6c5f98659eb1f7b8d8a6 + +HOST_BUILD_DEPENDS:=python/host +PKG_BUILD_DEPENDS:=python/host +PKG_INSTALL:=1 +PKG_USE_MIPS16:=0 +HOST_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_DEPENDS:= +PKG_MAINTAINER:=John Crispin +PKG_LICENSE:= + +include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk define Package/node - DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +zlib - SUBMENU:=Node SECTION:=lang CATEGORY:=Languages - TITLE:=Node is a JavaScript runtime built on Chrome's V8 JavaScript engine - URL:=https://nodejs.org/ + SUBMENU:=Node.js + TITLE:=Node.js is a platform built on Chrome's JavaScript runtime + URL:=http://nodejs.org/ + DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +zlib endef define Package/node/description -Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine + Node.jsĀ® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses + an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' + package ecosystem, npm, is the largest ecosystem of open source libraries in the world. endef -define Package/npm - DEPENDS:=+node - SUBMENU:=Node.js +define Package/node-npm SECTION:=lang CATEGORY:=Languages - TITLE:=Node/io.js Package Manager - URL:=https://npmjs.org/ + SUBMENU:=Node.js + TITLE:=NPM stands for Node Package Manager + URL:=http://npmjs.com/ + DEPENDS:=+node endef -ifeq ($(ARCH),i386) - DEST_CPU=ia32 -else - DEST_CPU=$(ARCH) -endif +define Package/node-npm/description + NPM is the package manager for NodeJS +endef + +CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))) +MAKE_VARS += \ + DESTCPU=$(CPU) -CONFIGURE_ARGS = --dest-cpu=$(DEST_CPU) --dest-os=linux \ - --shared-openssl --shared-openssl-includes="$(STAGING_DIR)/usr/include" --shared-openssl-libpath="$(STAGING_DIR)/usr/lib" \ - --shared-zlib --shared-zlib-includes="$(STAGING_DIR)/usr/include" --shared-zlib-libpath="$(STAGING_DIR)/usr/lib" \ - --v8-options="--max_old_space_size=20 --initial_old_space_size=4 --max_semi_space_size=2 --max_executable_size=5" \ - --without-snapshot +CONFIGURE_ARGS= \ + --dest-cpu=$(CPU) \ + --dest-os=linux \ + --without-snapshot \ + --shared-zlib \ + --shared-openssl \ + --prefix=/usr \ + --with-intl=none -ifeq ($(ARCH),mipsel) - CONFIGURE_ARGS += \ - --with-mips-arch-variant=r2 --with-mips-fpu-mode=fp32 --with-mips-float-abi=soft +ifneq ($(findstring arm,$(ARCH)),) +CONFIGURE_ARGS+= \ + $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard) endif +ifneq ($(findstring mips,$(ARCH)),) +CONFIGURE_ARGS+= \ + $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard) +endif + +HOST_CONFIGURE_VARS:= + +HOST_CONFIGURE_ARGS:= \ + --dest-os=linux \ + --without-snapshot \ + --with-intl=none \ + --prefix=$(STAGING_DIR_HOSTPKG) + +HOST_CONFIGURE_CMD:=python ./configure + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ +endef + define Package/node/install mkdir -p $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/Release/node $(1)/usr/bin/node + $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/ endef -define Package/npm/install - mkdir -p $(1)/usr/lib/node_modules - $(CP) $(PKG_BUILD_DIR)/deps/npm $(1)/usr/lib/node_modules - ln -sf /usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/bin/npm +define Package/node-npm/install + mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules} + $(CP) $(PKG_INSTALL_DIR)/usr/bin/npm $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/ endef +$(eval $(call HostBuild)) $(eval $(call BuildPackage,node)) -$(eval $(call BuildPackage,npm)) - +$(eval $(call BuildPackage,node-npm)) diff --git a/package/node/node/patches/001-hardfloat.patch b/package/node/node/patches/001-hardfloat.patch new file mode 100644 index 0000000..1bb2493 --- /dev/null +++ b/package/node/node/patches/001-hardfloat.patch @@ -0,0 +1,12 @@ +diff --git a/deps/v8/src/base/cpu.cc b/deps/v8/src/base/cpu.cc +index 4f58720..1f3071e 100644 +--- a/deps/v8/src/base/cpu.cc ++++ b/deps/v8/src/base/cpu.cc +@@ -143,6 +143,7 @@ int __detect_fp64_mode(void) { + ".set push\n\t" + ".set noreorder\n\t" + ".set oddspreg\n\t" ++ ".set hardfloat\n\t" + "lui $t0, 0x3FF0\n\t" + "ldc1 $f0, %0\n\t" + "mtc1 $t0, $f1\n\t" diff --git a/package/node/node/patches/002-addr_info.patch b/package/node/node/patches/002-addr_info.patch new file mode 100644 index 0000000..d317bc4 --- /dev/null +++ b/package/node/node/patches/002-addr_info.patch @@ -0,0 +1,10 @@ +--- a/deps/uv/src/unix/getaddrinfo.c ++++ b/deps/uv/src/unix/getaddrinfo.c +@@ -99,6 +99,7 @@ + int err; + + req = container_of(w, uv_getaddrinfo_t, work_req); ++ req->hints->ai_flags &= ~AI_V4MAPPED; + err = getaddrinfo(req->hostname, req->service, req->hints, &req->addrinfo); + req->retcode = uv__getaddrinfo_translate_error(err); + } diff --git a/package/node/node/patches/003-path.patch b/package/node/node/patches/003-path.patch new file mode 100644 index 0000000..0dabeb7 --- /dev/null +++ b/package/node/node/patches/003-path.patch @@ -0,0 +1,12 @@ +--- a/lib/module.js 2017-05-02 18:34:23.000000000 +0200 ++++ b/lib/module.js 2017-05-05 12:07:20.217903258 +0200 +@@ -625,7 +625,8 @@ + } else { + prefixDir = path.resolve(process.execPath, '..', '..'); + } +- var paths = [path.resolve(prefixDir, 'lib', 'node')]; ++ var paths = [path.resolve(prefixDir, 'lib', 'node'), ++ path.resolve(process.execPath, '..', '..', 'lib', 'node_modules')]; + + if (homeDir) { + paths.unshift(path.resolve(homeDir, '.node_libraries')); diff --git a/package/node/node/patches/010-uclib_execinfo.patch b/package/node/node/patches/010-uclib_execinfo.patch deleted file mode 100644 index 3e99c1d..0000000 --- a/package/node/node/patches/010-uclib_execinfo.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/deps/v8/src/base/logging.cc -+++ b/deps/v8/src/base/logging.cc -@@ -4,13 +4,13 @@ - - #include "src/base/logging.h" - --#if V8_LIBC_GLIBC || V8_OS_BSD -+#if (V8_LIBC_GLIBC && !defined(__UCLIBC__)) || V8_OS_BSD - #include - #include - #include - #elif V8_OS_QNX - #include --#endif // V8_LIBC_GLIBC || V8_OS_BSD -+#endif // (V8_LIBC_GLIBC && !defined(__UCLIBC__)) || V8_OS_BSD - - #include - #include -@@ -52,7 +52,7 @@ DEFINE_CHECK_OP_IMPL(GT) - - // Attempts to dump a backtrace (if supported). - void DumpBacktrace() { --#if V8_LIBC_GLIBC || V8_OS_BSD -+#if (V8_LIBC_GLIBC && !defined(__UCLIBC__)) || V8_OS_BSD - void* trace[100]; - int size = backtrace(trace, arraysize(trace)); - OS::PrintError("\n==== C stack trace ===============================\n\n"); -@@ -93,7 +93,7 @@ void DumpBacktrace() { - } - bt_unload_memmap(&memmap); - bt_release_accessor(&acc); --#endif // V8_LIBC_GLIBC || V8_OS_BSD -+#endif // (V8_LIBC_GLIBC && !defined(__UCLIBC__)) || V8_OS_BSD - } - - } // namespace base diff --git a/package/tessel/tools/Makefile b/package/tessel/tools/Makefile index 6a4e0b9..a43b7e8 100644 --- a/package/tessel/tools/Makefile +++ b/package/tessel/tools/Makefile @@ -7,7 +7,7 @@ PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/tessel/t2-firmware.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=fe9165c7137a8c0fe5809c282e39f8f267ec92e1 +PKG_SOURCE_VERSION:=8037907f24d3e0c3f93f46f70fe384395ce4ee7f PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz include $(INCLUDE_DIR)/package.mk @@ -26,11 +26,9 @@ define Package/tessel-tools/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) $(PKG_BUILD_DIR)/soc/spid $(1)/usr/bin/spid - $(INSTALL_BIN) $(PKG_BUILD_DIR)/soc/spid.sh $(1)/usr/bin/spid-start $(INSTALL_BIN) ./files/spid.init $(1)/etc/init.d/spid $(INSTALL_BIN) $(PKG_BUILD_DIR)/soc/usbexecd $(1)/usr/bin/usbexecd - $(INSTALL_BIN) $(PKG_BUILD_DIR)/soc/usbexecd.sh $(1)/usr/bin/usbexecd-start $(INSTALL_BIN) ./files/usbexecd.init $(1)/etc/init.d/usbexecd $(INSTALL_DIR) $(1)/usr/lib/node diff --git a/package/tessel/tools/files/spid.init b/package/tessel/tools/files/spid.init index 81152e5..97f84cd 100644 --- a/package/tessel/tools/files/spid.init +++ b/package/tessel/tools/files/spid.init @@ -3,8 +3,11 @@ START=60 USE_PROCD=1 start_service() { + mkdir -p /var/run/tessel + ln -sf /var/run/tessel/1 /var/run/tessel/port_a + ln -sf /var/run/tessel/2 /var/run/tessel/port_b procd_open_instance - procd_set_param command sh /usr/bin/spid-start + procd_set_param command spid /dev/spidev1.0 2 1 /var/run/tessel procd_set_param respawn procd_close_instance } diff --git a/package/tessel/tools/files/usbexecd.init b/package/tessel/tools/files/usbexecd.init index bbf5548..b63ef01 100644 --- a/package/tessel/tools/files/usbexecd.init +++ b/package/tessel/tools/files/usbexecd.init @@ -1,10 +1,11 @@ #!/bin/sh /etc/rc.common -START=60 +START=61 USE_PROCD=1 start_service() { + ln -sf /var/run/tessel/0 /var/run/tessel/usb procd_open_instance - procd_set_param command sh /usr/bin/usbexecd-start + procd_set_param command /usr/bin/usbexecd /var/run/tessel/usb procd_set_param respawn procd_close_instance } diff --git a/target/v2/config.mk b/target/v2/config.mk index b8a7bee..7308337 100644 --- a/target/v2/config.mk +++ b/target/v2/config.mk @@ -2,11 +2,12 @@ PROFILE=Tessel CONFIG_TARGET_ramips=y CONFIG_TARGET_ramips_mt7620=y -CONFIG_TARGET_ramips_mt7620_Default=y +CONFIG_TARGET_PROFILE="DEVICE_tessel" +CONFIG_TARGET_ramips_mt7620_DEVICE_tessel=y CONFIG_PACKAGE_kmod-rt2800-pci=n CONFIG_PACKAGE_kmod-rt2x00-pci=n PACKAGES+=kmod-spi-dev PACKAGES+=tessel-tools -PACKAGES+=uboot-mt7620-Default +#PACKAGES+=uboot-mt7620-Default diff --git a/upstream-packages b/upstream-packages index 6fce27a..0f81b6e 160000 --- a/upstream-packages +++ b/upstream-packages @@ -1 +1 @@ -Subproject commit 6fce27a2e2c50ebb2a1f1d9f0b0ea5b139e59614 +Subproject commit 0f81b6e9bbdcd4668e546f316522b3bfa2d2d133