[OpenWrt-Devel] [PATCH] ramips: mt7621: use lzma-loader for D-Link DIR-860L B1

Stijn Segers foss at volatilesystems.org
Tue Apr 21 09:12:53 EDT 2020


Hi Szabolcs,

Op maandag 20 april 2020 om 11:01 schreef Szabolcs Hubai 
<szab.hu at gmail.com>:
> Hello,
> 
> Stijn Segers <foss at volatilesystems.org> ezt írta (időpont: 2020. 
> ápr.
> 20., H, 9:25):
>> 
>>  Hi Szabolcs,
>> 
>>  Op zondag 19 april 2020 om 20u49 schreef Szabolcs Hubai
>>  <szab.hu at gmail.com>:
>>  > This device has trouble extracting big kernel from flash,
>>  > and supports LZMA compressed kernels only.
>>  >
>>  > Using OpenWrt kernel loader saves us 64 KB compared to the 
>> dictionary
>>  > size limiting workaround.
>>  >
>>  > Factory image sizes (commit: 5f126c541a74) with 
>> "CONFIG_ALL_KMODS=y":
>>  > - original ("-d23", default): 4784188 bytes, LZMA ERROR 1
>>  > - with "-d19": 4915260, LZMA ERROR 1
>>  > - with "-d18": 4915260, diff to original: +128 KB
>>  > - with "-d17": 4980796, diff to original: +192 KB
>>  > - with this patch: 4849724, diff to original: +64 KB
>>  >
>>  > To save some CPU cycle, use minimal compression ("-a0") for the 
>> LZMA
>>  > compressed uImage.
>>  >
>>  > The most robust solution would use a different loader,
>>  > which reads the compressed kernel directly from the flash.
>>  > See the thread at [0] for more details!
>> 
>>  Thanks for giving the DIR-860L some love. I'd like to test (in fact 
>> I
>>  already
>>  did with your previous patches) and hook up serial, because first 
>> boot
>>  will
>>  work but any reboot (whether I change settings or not) will just 
>> give
>>  me a
>>  blinking orange LED. Like clockwork.
>> 
>>  Would you happen to have any pointers (or pictures) on how to open 
>> the
>>  case?
>>  I have unscrewed the bottom but there seem to be latches on the 
>> inside
>>  (judging
>>  from the FCC pictures) and I am unable to pry it open.
>> 
>>  Thanks and sorry for the topic hijack :-).
>> 
>>  Stijn
>> 
> 
> I got my clue from the "D-LINK DIR-860L - disassemble" titled YouTube 
> video. [0]
> In short:
> - 3 screws on the bottom, under the pads: if you are looking at the
> bottom of the router, the screws are under the left, the right and the
> bottom pads
> - one, "DIR-860L" titled sticker on the top, with a "cut in" starting
> point in the front, where the leds reside


Thanks! That sticker turned out to be so sturdy - it doesn't look or 
feel like a sticker *at all*. That's what got me.

So, I have serial now. A few things I can tell from my side:
- vanilla master image (yesterday's image): does not boot, which is 
expected of course. Error I'm seeing: "LZMA ERROR 1 - must RESET board 
to recover"
- local master branch image (with your last patch) with default 
.config: boots fine, even after multiple reboots.
- local master branch image (with your last patch) with my own config: 
boots fine the first time. After that, it just barks and says 'Bad 
Header checksum'.

It looks like there's something with my .config that breaks it... The 
(kernel?) image is pretty big (9109444 bytes?) from what I can tell, 
maybe that's still an issue here.

This is what default config prints:

3: System Boot system code via Flash.
## Booting image at bfc50000 ...
addr:80500000
We have SEAMA, Image Size = 2359232
Verifying Checksum ...
Uncompressing SEAMA linux.lzma ... OK

And my custom config (which boots fine the first time after flashing 
somehow, then goes straight to recovery mode somehow):

3: System Boot system code via Flash.
## Booting image at bfc50000 ...
addr:80500000
We have SEAMA, Image Size = 9109444
Verifying Checksum ...
Bad Header Checksum.

Entering HTTP server.


Anyway, I'll send in my tested-by for your patch so hopefully it can 
get merged! Thanks for the work and your help!


Cheers

Stijn

> - 3 screws on the top, under the sticker
> 
> Disassemble:
> - get off the pads (they won't stick back after a few days ;), use
> very thin double sided sticker to help them)
> - get the bottom screws
> - peel off the rounded sticker from the top with thin but flexible
> knife or razor blade, etc ...
> - get the upper screws
> - slide the front and rear half vertically a little
> - separate them
> 
> The serial settings can be found on the wiki [1]:
> - Pinout: TX, GND, 3v3, empty, RX
> - Bits per second: 57600
> - Data bits: 8
> - Parity: None
> - Stop bits: 1
> - Flow control: None
> 
> I have a CP2102 USB to TTL module, and used with "minicom -D 
> /dev/ttyUSB0".
> 
> 
> Intereestingly, when I connected with serial to the router it was
> sometime unstable:
> * refuse to start
> * freeze at boot soon after: "Error applying setting, reverse things
> back" messge
> 
> Other than this, I have no problem with k5.4.
> 
> 
> 
> [0]: https://youtu.be/tf7nMqdUKD4
> [1]: https://openwrt.org/toh/d-link/dir-860l#access_with_serial_cable
> 
> 
> --
> Regards,
> Szabolcs
> 
> 
>> 
>>  >
>>  > [0]
>>  > 
>> http://lists.infradead.org/pipermail/openwrt-devel/2020-April/022926.html
>>  >
>>  > Signed-off-by: Szabolcs Hubai <szab.hu at gmail.com>
>>  > ---
>>  >  target/linux/ramips/image/mt7621.mk | 4 +++-
>>  >  1 file changed, 3 insertions(+), 1 deletion(-)
>>  >
>>  > diff --git a/target/linux/ramips/image/mt7621.mk
>>  > b/target/linux/ramips/image/mt7621.mk
>>  > index aa6836d50a..e954f730da 100644
>>  > --- a/target/linux/ramips/image/mt7621.mk
>>  > +++ b/target/linux/ramips/image/mt7621.mk
>>  > @@ -218,7 +218,9 @@ define Device/dlink_dir-860l-b1
>>  >    $(Device/seama)
>>  >    BLOCKSIZE := 64k
>>  >    SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
>>  > -  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma |
>>  > uImage lzma
>>  > +  LOADER_TYPE := bin
>>  > +  KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | \
>>  > +  relocate-kernel | lzma -a0 | uImage lzma
>>  >    IMAGE_SIZE := 16064k
>>  >    DEVICE_VENDOR := D-Link
>>  >    DEVICE_MODEL := DIR-860L
>>  > --
>>  > 2.17.1
>>  >
>>  >
>>  > _______________________________________________
>>  > openwrt-devel mailing list
>>  > openwrt-devel at lists.openwrt.org
>>  > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>> 
>> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list