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

Update to LEDE 17.01.1 and Node 6.10.3 #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update to LEDE 17.01.1 and Node 6.10.3 #72

wants to merge 2 commits into from

Conversation

kevinmehall
Copy link
Member

@kevinmehall kevinmehall commented May 14, 2017

LEDE is a fork of OpenWrt. The projects may soon re-merge.

  • This updates the kernel and all software, so all functionality should be thoroughly tested.

  • The updated LEDE patches have moved to the tessel/lede repo. We should get some of these into upstream LEDE.

  • Depends on Fixes for LEDE upgrade t2-firmware#234 (Note: This PR bumps the t2-firmware dependency version, which also brings in other t2-firmware changes)

  • I disabled the bootloader (uboot) build, since it fails to compile with the updated toolchain; I did not investigate. uboot is only needed for factory install or t2 restore, and you can use the existing binaries.

  • LEDE switches the libc to musl, which fixes the issues we had with Node on uclibc. This also makes it simpler to build Rust programs, as mipsel-unknown-linux-musl is available through rustup target add mipsel-unknown-linux-musl, instead of needing to build libstd.

  • The Node binary package builds will need to be updated to use the SDK with the updated toolchain.

Test build: Sysupgrade | SDK

SSH password auth is disabled, but LEDE stil complains about it.
@tikurahul
Copy link

@kevinmehall this is amazing !!

@tikurahul tikurahul requested a review from jiahuang May 15, 2017 18:16
@tikurahul
Copy link

Sorry, did not mean to change the review state at all. I have no idea how to undo the review request from @jiahuang. Sorry for the noise :(

@tikurahul tikurahul removed the request for review from jiahuang May 15, 2017 18:17
@rwaldron
Copy link
Contributor

I'm really excited about this :)

@huseyinkozan
Copy link
Contributor

Me too, me too : ^ )

--shared-zlib \
--shared-openssl \
--prefix=/usr \
--with-intl=none
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@rwaldron
Copy link
Contributor

The Node binary package builds will need to be updated to use the SDK with the updated toolchain.

This will take a bit of time, but shouldn't be problematic. cc @reconbot

@rwaldron
Copy link
Contributor

Here's how I confirmed this build:

  1. SSH to Tessel 2

    t2 root
    
  2. Move to tmp and get the bin

    cd ~
    wget https://dl.dropboxusercontent.com/u/3531958/lede-ramips-mt7620-tessel-squashfs-sysupgrade.bin
    

    or

    cd ~
    wget https://kevinmehall.net/tmp/lede-ramips-mt7620-tessel-squashfs-sysupgrade-bc3316c.bin
    
  3. Upgrade the OS

    sysupgrade lede-ramips-mt7620-tessel-squashfs-sysupgrade.bin
    

    or

    sysupgrade lede-ramips-mt7620-tessel-squashfs-sysupgrade-bc3316c.bin
    

    Which should look something like this...

    root@ash:~# sysupgrade lede-ramips-mt7620-tessel-squashfs-sysupgrade-bc3316c.bin
    Saving config files...
    killall: watchdog: no process killed
    Sending TERM to remaining processes ... logd rpcd netifd odhcpd dbus-daemon mdnsd dnsmasq mDNSResponder ntpd ubusd askfirst
    Sending KILL to remaining processes ... askfirst
    Switching to ramdisk...
    Performing system upgrade...
    Unlocking firmware ...
    
    Writing from <stdin> to firmware ...
    Appending jffs2 data from /tmp/sysupgrade.tgz to firmware...
    Writing from <stdin> to firmware ...
    Upgrade completed
    Rebooting system...
    packet_write_wait: Connection to 10.31.0.102 port 22: Broken pipe
    

    That last line occurred when I unplugged/replugged the Tessel 2. Once it was back up...

    rwaldron in ~
    $ t2 root
    INFO Looking for your Tessel...
    INFO Connected to ash.
    INFO Starting SSH Session on Tessel. Type "exit" at the prompt to end.
    
    
    BusyBox v1.25.1 () built-in shell (ash)
    
    Tessel 2  /  Built on LEDE
    root@ash:~# node -v
    v6.10.3
    root@ash:~#
    

    (Celebrate!)

  4. Upgrade t2-firmware

    cd t2-firmware
    git fetch upstream && git checkout -b lede upstream/lede
    make clean && make 
    

    (assumes you have a remote called "upstream" that points at https://github.com/tessel/t2-firmware)

    Once complete: unplug the Tessel 2, press and hold the button on the board while plugging back in. The board will now be in dfu mode

    dfu-util -aFlash -d 1209:7551 -D build/firmware.bin
    

    This should look something like this...

    $ dfu-util -aFlash -d 1209:7551 -D build/firmware.bin
    dfu-util 0.9
    
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2016 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
    
    dfu-util: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
    Opening DFU capable USB device...
    ID 1209:7551
    Run-time device DFU version 0101
    Claiming USB DFU Interface...
    Setting Alternate Setting #0 ...
    Determining device status: state = dfuIDLE, status = 0
    dfuIDLE, continuing
    DFU mode device DFU version 0101
    Device returned transfer size 256
    Copying data from PC to DFU device
    Download  [=========================] 100%        15072 bytes
    Download done.
    state(7) = dfuMANIFEST, status(0) = No error condition is present
    dfu-util: unable to read DFU status after completion
    

    Don't worry about the last line. The Tessel 2 is now rebooting. Once it's rebooted...

    t2 list
    

    Which looks like...

    rwaldron in ~/clonez/t2-firmware on lede
    $ t2 list
    INFO Searching for nearby Tessels...
      USB ash
    

    Strangely... The wifi light is on and I can connect via SSH, but the Tessel 2 doesn't appear in the list results.

@reconbot
Copy link
Member

The existing binaries are only key on node version, not toolchain version. We'll need to make another breaking change with the urls. We'll also want to consider supporting the newer and older tool chains. All doable.

Do we have a a concept of "version" for the Tessel OS? That might make sense tracking in package releases.

@huseyinkozan
Copy link
Contributor

@rwaldron :

Strangely... The wifi light is on and I can connect via SSH, but the Tessel 2 doesn't appear in the list results.

Due to firewall ? At Ubuntu, I need to allow Tessel IP address for all ports. Dont know which one for mdns.

@rwaldron
Copy link
Contributor

@huseyinkozan ah, it's very possible that something is amiss with the network at this office... I heard through the grapevine here that there has been configuration problems. I will try again from another network as soon as I get out from under this test262 work that I'm doing

@rwaldron
Copy link
Contributor

I'm on a different, but very reliable network today and I'm noticing that Tessel 2 with LEDE is dropping the connection a lot

@rwaldron
Copy link
Contributor

Check this out...

(The Tessel with LEDE)

root@lede:/# ubus call iwinfo info '{"device":"wlan0"}'
{
        "phy": "phy0",
        "ssid": "Bocoup",
        "bssid": "44:D9:E7:03:34:55",
        "country": "00",
        "mode": "Client",
        "channel": 6,
        "frequency": 2437,
        "txpower": 20,
        "quality": 67,
        "quality_max": 70,
        "signal": -43,
        "bitrate": 6500,
        "encryption": {
                "enabled": true,
                "wpa": [
                        2
                ],
                "authentication": [
                        "psk"
                ],
                "ciphers": [
                        "ccmp"
                ]
        },
        "htmodes": [
                "HT20",
                "HT40"
        ],
        "hwmodes": [
                "b",
                "g",
                "n"
        ],
        "hardware": {
                "name": "Generic MAC80211"
        }
}

Compared to:

(The Tessel with OpenWrt)

root@openwrt:~# ubus call iwinfo info '{"device":"wlan0"}'
{
	"phy": "phy0",
	"ssid": "Bocoup",
	"bssid": "44:D9:E7:03:34:55",
	"country": "00",
	"mode": "Client",
	"channel": 6,
	"frequency": 2437,
	"txpower": 20,
	"quality": 61,
	"quality_max": 70,
	"signal": -49,
	"bitrate": 57800,
	"encryption": {
		"enabled": true,
		"wpa": [
			2
		],
		"authentication": [
			"psk"
		],
		"ciphers": [
			"ccmp"
		]
	},
	"hwmodes": [
		"b",
		"g",
		"n"
	],
	"hardware": {
		"name": "Generic MAC80211"
	}
}

Notice the bitrate discrepancy? LEDE @ 6500 vs OpenWrt @ 57800 Honestly, I know very little about network device admin, so that might be meaningless.

@rwaldron
Copy link
Contributor

And... just as I posted that, I saw this go by:

root@lede:/# [  390.107369] wlan0: authenticate with 34:68:95:fa:de:8d
[  390.136917] wlan0: send auth to 34:68:95:fa:de:8d (try 1/3)
[  390.147537] wlan0: authenticated
[  390.161138] wlan0: associate with 34:68:95:fa:de:8d (try 1/3)
[  390.171754] wlan0: RX AssocResp from 34:68:95:fa:de:8d (capab=0x1411 status=0 aid=2)
[  390.179954] wlan0: associated
[  393.136639] wlan0: deauthenticated from 34:68:95:fa:de:8d (Reason: 15=4WAY_HANDSHAKE_TIMEOUT)
[  396.989959] wlan0: authenticate with 44:d9:e7:03:34:55
[  397.004662] wlan0: send auth to 44:d9:e7:03:34:55 (try 1/3)
[  397.012701] wlan0: authenticated
[  397.017152] wlan0: associate with 44:d9:e7:03:34:55 (try 1/3)
[  397.025451] wlan0: RX AssocResp from 44:d9:e7:03:34:55 (capab=0x431 status=0 aid=1)
[  397.033623] wlan0: associated

(I'm connected to the board via serial)

And now...

root@lede:/# ubus call iwinfo info '{"device":"wlan0"}'
{
        "phy": "phy0",
        "ssid": "Bocoup",
        "bssid": "44:D9:E7:03:34:55",
        "country": "00",
        "mode": "Client",
        "channel": 6,
        "frequency": 2437,
        "txpower": 20,
        "quality": 63,
        "quality_max": 70,
        "signal": -47,
        "bitrate": 39000,
        "encryption": {
                "enabled": true,
                "wpa": [
                        2
                ],
                "authentication": [
                        "psk"
                ],
                "ciphers": [
                        "ccmp"
                ]
        },
        "htmodes": [
                "HT20",
                "HT40"
        ],
        "hwmodes": [
                "b",
                "g",
                "n"
        ],
        "hardware": {
                "name": "Generic MAC80211"
        }
}

@huseyinkozan
Copy link
Contributor

@rwaldron Maybe dmesg output more info ?

@rwaldron
Copy link
Contributor

@huseyinkozan will do... I had a meeting I had to jump into

@rwaldron
Copy link
Contributor

@huseyinkozan
Copy link
Contributor

@rwaldron
Copy link
Contributor

FWIW, there have been several deauthentications since I posted that pastebin https://pastebin.com/UVnYreNR

@rwaldron
Copy link
Contributor

Does your password have non ASCII chars

Nope

And other, maybe not related bugs :

I'll have a look, thanks

@huseyinkozan
Copy link
Contributor

Dont know but can this be the problem --with-intl=none ?

Ok. Good luck

@rwaldron
Copy link
Contributor

Dont know but can this be the problem --with-intl=none ?

No, I'm not running anything with node at the moment, I'm just watching the serial dmesg logs go by

I also found this: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/548992

@huseyinkozan
Copy link
Contributor

Any progress ?
Do we have a TODO list for migration ?

@huseyinkozan
Copy link
Contributor

#73

@rwaldron
Copy link
Contributor

@huseyinkozan until there's a solution to the network deauth'ing issue, this can't move forward (which is really disappointing)

@rwaldron
Copy link
Contributor

I've done some long-running tests where I simply connect my Tessel 2 w/ Lede to a network and monitor the connection over long periods of time. I'm not seeing the deauth issue now, but the bitrates are still much lower than the Tessel 2 w/ Openwrt

@rwaldron rwaldron mentioned this pull request Jun 16, 2017
@johnnyman727
Copy link
Contributor

This build may break existing LED functionality (the 4 connected to OpenWRT). I put this build on a board and I could no longer control any of the LEDs through the JavaScript API. It may be just a beaten up T2 though so someone else should confirm.

@huseyinkozan
Copy link
Contributor

huseyinkozan commented Jul 30, 2017

I am trying to build node with inspector support, but getting the error below.

To enable inspector I needed to enable icu support (https://github.com/nodejs/node/blob/v6.x/configure#L1291). I found this : https://github.com/openwrt/packages/tree/master/libs/icu and successfully built with --with-intl=system-icu, with some small modifications.

It seems uClibc is causing this. After some digging, could not find a patch for this error. Any idea ?

  mipsel-openwrt-linux-uclibc-g++  -I/home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include -I../deps/v8_inspector/third_party/v8_inspector -I../deps/v8/include -I../deps/v8 -I/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink  -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/.deps//home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj.target/v8_inspector_stl/gen/blink/platform/v8_inspector/protocol/Debugger.o.d.raw  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kec -mdsp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float  -I/home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include -I/home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/include -I/home/hk/p/openwrt-tessel/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/hk/p/openwrt-tessel/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include  -c -o /home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj.target/v8_inspector_stl/gen/blink/platform/v8_inspector/protocol/Debugger.o /home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/v8_inspector/protocol/Debugger.cpp
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::intToStr(int, char*, size_t)':
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:23:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%d", number);
     ^
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::doubleToStr(double, char*, size_t)':
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:28:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%f", number);
     ^
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::doubleToStr3(double, char*, size_t)':
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:33:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%.3g", number);
     ^
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::doubleToStr6(double, char*, size_t)':
/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:38:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%.6g", number);
     ^
deps/v8_inspector/third_party/v8_inspector/platform/v8_inspector/v8_inspector_stl.target.mk:118: recipe for target '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj.target/v8_inspector_stl/gen/blink/platform/inspector_protocol/InspectorProtocol.o' failed
make[4]: *** [/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out/Release/obj.target/v8_inspector_stl/gen/blink/platform/inspector_protocol/InspectorProtocol.o] Error 1
make[4]: *** Waiting for unfinished jobs....
rm 33eb92234851344b8992ea5826a49ba24e458a44.intermediate
make[4]: Leaving directory '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/out'
Makefile:73: recipe for target 'node' failed
make[3]: *** [node] Error 2
make[3]: Leaving directory '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1'
Makefile:110: recipe for target '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/.built' failed
make[2]: *** [/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.11.1/.built] Error 2
make[2]: Leaving directory '/home/hk/p/openwrt-tessel/package/node/node'
package/Makefile:191: recipe for target 'package/feeds/tessel/node/compile' failed
make[1]: *** [package/feeds/tessel/node/compile] Error 2
make[1]: Leaving directory '/home/hk/p/openwrt-tessel/openwrt'
Build failed - please re-run with -j1 to see the real error message
/home/hk/p/openwrt-tessel/openwrt/include/toplevel.mk:181: recipe for target 'package/node/compile' failed
make: *** [package/node/compile] Error 1

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.

6 participants