Jump to content

Recommended Posts

Posted (edited)

Hi,

 

My apologies if this is not the right sub forum.

I have a DLink  DNS-340L with the specs as below;

 

CPU Marvell Armada 370 88F6707-A1 C120 @ 1.2GHz
RAM 512 MB Hynix DDR3 (x2)
Flash 128 MB Hynix
Ethernet Marvell 88E1518 Gigabit Ethernet (x2)
USB 3.0 Etron Tech EJ168A
SATA Marvell 88SE9215 4 port PCIe 2.0 SATA 6Gb/s and PATA Host Controller

 

#cat /proc/cpuinfo

 

Processor : Marvell PJ4Bv7 Processor rev 1 (v7l)
BogoMIPS : 1196.85
Features : swp half thumb fastmult vfp edsp vfpv3 vfpv3d16 tls
CPU implementer : 0x56
CPU architecture: 7
CPU variant : 0x1
CPU part : 0x581
CPU revision : 1

 

I plan to wipe out all the Dlink stuff and install armbian with just cron, ssh and rsync.
Is this possible with armbian ?

Kindly advise.

Thanks,

 

p.s. - I did try to ask this on the debian forum but couldnt even get registered... damnnnnn

Marco
 

Edited by czenmarco
Update
Posted

Possible yes, but perhaps not in the short term.

 

ARM devices vary wildly, and it is unlikely that two boards that share the same processor can use the same image. If there is not yet a build for that specific device, it may be easy, or there may be some substantial work required to make things work there.

 

The list of devices that currently have builds ready to go is here: https://www.armbian.com/download/

 

If your device is not in that list, you can ask nicely under feature requests. But unless someone's been funded to do the work, or has the hardware, time, and interest, you may be waiting some time.

 

You are also welcome to start from one of the existing Armada builds, and try modifying it for your needs. At minimum, you'd likely need to modify the system's Device Tree (DTB), and may need to make substantial bootloader (u-boot) changes as well (see: Espressobin).

Posted (edited)

Hi ... replies below ...

 

Quote

ARM devices vary wildly, and it is unlikely that two boards that share the same processor can use the same image. If there is not yet a build for that specific device, it may be easy, or there may be some substantial work required to make things work there.

 

 

Noted....

 

2 hours ago, tparys said:

If your device is not in that list, you can ask nicely under feature requests. But unless someone's been funded to do the work, or has the hardware, time, and interest, you may be waiting some time.

 

 

Noted...

 

2 hours ago, tparys said:

You are also welcome to start from one of the existing Armada builds, and try modifying it for your needs. At minimum, you'd likely need to modify the system's Device Tree (DTB), and may need to make substantial bootloader (u-boot) changes as well (see: Espressobin).


Ohhh ... from your experience, what should be the image that i can use as a starting point ? Thanks !

Edited by czenmarco
Posted

There are no Armada 370 devices currently supported by Armbian. You can try to adopt one of the Armada 385 devices (helios4 & clearfog) or check if there ever were other Armada devices supported (dont think so). 

 

Probably you want to check here first: 

https://github.com/armbian/build/tree/master/config/boards

https://github.com/armbian/build/tree/master/config/sources/families

(mvebu)

 

You can also check out my build tree for the WD MyCloud (which is Armada 375 based) 
https://github.com/heisath/wdmc2-kernel

Posted

Hi ...

 

18 hours ago, Heisath said:

There are no Armada 370 devices currently supported by Armbian. You can try to adopt one of the Armada 385 devices (helios4 & clearfog) or check if there ever were other Armada devices supported (dont think so). 

 

 

 

Noted. That's clear .. I am aloneeeeeeeee.... crapppppp ....

 

18 hours ago, Heisath said:

 

 

Will do.

18 hours ago, Heisath said:

You can also check out my build tree for the WD MyCloud (which is Armada 375 based) 
https://github.com/heisath/wdmc2-kernel

 

Since this is a Armada 375, will this possibly be a better starting point for me ?

Thanks.

 

 

 

 

 

 

Posted
15 hours ago, czenmarco said:

Since this is a Armada 375, will this possibly be a better starting point for me ?

It might be. At least there you can check for an uncluttered way of building kernel and custom initramfs.

 

But you seem to already have access to some linux terminal. So my suggestion is to:

- gather information about the system from there (which kernel is it running, which modules, what partition layout, grab the device tree etc. ) ( see lsblk, lsmod, uname ...)

- try to prepare a debian (with debootstrap or similar) on a usb stick. Insert the usb stick into the DLink and chroot over to your debian. Then you can try how it works w/o removing the old system.

- look for a hardware uart (serial interface) and have a look at the bootup. Without a hardware serial it will be hard / dangerous to do any permanent changes as you will not be able to see boot errors

- if you have access to hw uart:

- try to stop in uboot and look at the version and parameters there. I would probably not recommend reflashing the uboot

- try to get uboot to load the linux kernel from an alternative source (usb stick for example, often possible for FW recovery)

- if it is possible to boot from somewhere else (uboot on flash, kernel on usb stick) try to compile a mainline kernel and initrd for the device, put on usb stick and try to load that

- if it is not possible to boot from somewhere else, I'd seriously think about going further. If you break it, you might not be able to fix it. Maybe check if the DLINK page has recovery instructions via usb? If it has, you might at least have a way back.

 

- if you get a boot from seperate device (usb stick or internal hdd) and everything works, I'd prepare the root system on the usb stick (easy to swap into other computer to add files etc.). Afterwards if you're happy with the system, try to replicate the steps on the internal flash. (or just keep running from USB, would not make a big difference probably).

 

EDIT: As I'm personally interested in the device, is it available somewhere cheaply? Like used one without hdd on ebay?   

Also if you have gathered the information from the first steps, post it. I will look at it and try to help.

 

EDIT2: I found this on the interwebs: https://jamie.lentin.co.uk/devices/dlink-dns325/ 

Is meant for DNS325 but has a good step-by-step explanation how this guy found the serial port etc.

Posted
12 hours ago, Heisath said:

It might be. At least there you can check for an uncluttered way of building kernel and custom initramfs.

 

But you seem to already have access to some linux terminal. So my suggestion is to:

- gather information about the system from there (which kernel is it running, which modules, what partition layout, grab the device tree etc. ) ( see lsblk, lsmod, uname ...)

- try to prepare a debian (with debootstrap or similar) on a usb stick. Insert the usb stick into the DLink and chroot over to your debian. Then you can try how it works w/o removing the old system.

- look for a hardware uart (serial interface) and have a look at the bootup. Without a hardware serial it will be hard / dangerous to do any permanent changes as you will not be able to see boot errors

- if you have access to hw uart:

- try to stop in uboot and look at the version and parameters there. I would probably not recommend reflashing the uboot

- try to get uboot to load the linux kernel from an alternative source (usb stick for example, often possible for FW recovery)

- if it is possible to boot from somewhere else (uboot on flash, kernel on usb stick) try to compile a mainline kernel and initrd for the device, put on usb stick and try to load that

- if it is not possible to boot from somewhere else, I'd seriously think about going further. If you break it, you might not be able to fix it. Maybe check if the DLINK page has recovery instructions via usb? If it has, you might at least have a way back.

 

- if you get a boot from seperate device (usb stick or internal hdd) and everything works, I'd prepare the root system on the usb stick (easy to swap into other computer to add files etc.). Afterwards if you're happy with the system, try to replicate the steps on the internal flash. (or just keep running from USB, would not make a big difference probably).

 

EDIT: As I'm personally interested in the device, is it available somewhere cheaply? Like used one without hdd on ebay?   

Also if you have gathered the information from the first steps, post it. I will look at it and try to help.

 

EDIT2: I found this on the interwebs: https://jamie.lentin.co.uk/devices/dlink-dns325/ 

Is meant for DNS325 but has a good step-by-step explanation how this guy found the serial port etc.



Wow ... that is a gold Mine of Info.....  Pls give me a couple of days to look into this ... I can now see that this is not a trivial task ...

my friend got the device online - when it was launched but cant remember if it was amazon or ebay  or somewhere else ...

 

 

Posted
5 hours ago, czenmarco said:

I can now see that this is not a trivial task ...

 

Building a Debian or Ubuntu image is relatively easy. But getting the boot sequence right is often time challenging. Often times there's little patches here and there to handle some "little thing" the hardware designers did, and if they didn't mainline whatever they did (which doesn't always happen), you're stuck with resolving changes by both the Linux kernel developers and the vendor's software team. This consumes a fair bit of maintainers' time, and is the primary reason it's not easy to just add one more board.

 

If you can get a shell to the vendor's software image, and can't find the device tree (DTB), do something like this:

 

$ dtc -I fs -o dump.dts /proc/device-tree

 

You can compare it to what's in the current mainline kernel here: https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/armada-370.dtsi. To give you an idea of what the file does, it basically tells the kernel what's on the board. Power regulators, operating points, which buses are enabled, etc ...

 

The other option is to see if you can find the vendor's published kernel sources. Per the GPL, they're required to publish any modified changes. Often times these are listed as Armbian "legacy" kernels. However, this isn't always the easiest to find. If you can find the version number for the kernel and u-boot, that will make your life a lot easier to resolve any differences with mainline.

 

And to reiterate what @Heisath mentioned, be careful overwriting parts of the boot sequence. Recovering a CPU with a broken boot sequence is no fun. It may be required to set up a TFTP server and boot via PXE, or load the boot loader serially.

Posted

DLINK has pretty easily accessible sources, go to their product page: https://eu.dlink.com/uk/en/products/dns-340l-sharecenter-4-bay-cloud-network-storage-enclosure

And to their "GPL Support" page: https://tsd.dlink.com.tw/dlist?OS=GPL

If you search for the device there, you actually get the tar.gz. with all the used files for building the firmware. Good way to figure out the kernel, uboot and compiler version used.

Posted
On 4/17/2021 at 2:39 PM, Heisath said:

DLINK has pretty easily accessible sources, go to their product page: https://eu.dlink.com/uk/en/products/dns-340l-sharecenter-4-bay-cloud-network-storage-enclosure

And to their "GPL Support" page: https://tsd.dlink.com.tw/dlist?OS=GPL

If you search for the device there, you actually get the tar.gz. with all the used files for building the firmware. Good way to figure out the kernel, uboot and compiler version used.

 

 

Hi @Heisath  / @tparys

 

I went to the link you suggested. Pic attached below...The last  red arrow marks
GPL: DNS-340L A1 for F/W 1.00   which is the nearest match to mine (  GPL: DNS-340L A1 for F/W 1.01 )

 

 

DLinkGPL.png

Posted

Hi Guys,

 

I finally got my data backed up.

 

And downloaded the GPL Source Code as mentioned by @Heisath

 

DescriptionGPL: DNS-340L A1 for F/W 1.00

Download : DNS-340L_GPL_v1.00_04252014.tgz

 

From the source code:

kernel : linux-3.2.40

uboot :        u-boot-2011.12

compiler : gcc ?

 

I couldnt see any file called compil;er or gcc or equivalent but from build_fw

i have:

 

    tar jxvf armv7-marvell-linux-gnueabi-softfp_i686_64K_Dev_20131002.tar.bz2

    WORKDIR=$(pwd)
    export WORKDIR
    PATH=${WORKDIR}/armv7-marvell-linux-gnueabi-softfp_i686_64K_Dev_20131002/bin:$PATH
    export PATH
    CC=arm-marvell-linux-gnueabi-gcc
    export CC
   export CROSS_COMPILE=arm-marvell-linux-gnueabi-
   CXX=${CROSS_COMPILE}g++
   export CXX
   RANLIB=${CROSS_COMPILE}ranlib
   export RANLIB
   LD=${CROSS_COMPILE}ld
   export LD
   STRIP=${CROSS_COMPILE}strip
   export STRIP
  tar zxvf ramdisk.tgz
  tar zxvf merge.tgz
  cd merge
  /merge

 

 

Next;

 

root@DLINK-340L:~# uname -a
Linux DLINK-340L 3.2.40 #1 Fri May 9 16:33:59 CST 2014 armv7l GNU/Linux

 

And:

 

root@DLINK-340L:~# dtc -I fs -o dump.dts /proc/device-tree
-sh: dtc: command not found

 

 

And;

 

root@DLINK-340L:~# lsblk
NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0       7:0    0  43.8M  0 loop  /usr/local/modules
mtdblock0  31:0    0     5M  0 disk  
mtdblock1  31:1    0     5M  0 disk  
mtdblock2  31:2    0     5M  0 disk  
mtdblock3  31:3    0   206M  0 disk  
mtdblock4  31:4    0    15M  0 disk  
mtdblock5  31:5    0    10M  0 disk  
mtdblock6  31:6    0    10M  0 disk  
sda         8:0    0   3.7T  0 disk  
|-sda1      8:1    0   512M  0 part  
| `-md0     9:0    0   512M  0 raid1 [SWAP]
|-sda2      8:2    0   3.7T  0 part  
| `-md1     9:1    0   7.3T  0 raid5 /mnt/HD/HD_a2
|-sda3      8:3    0     1G  0 part  
`-sda4      8:4    0     1G  0 part  /mnt/HD_a4
sdb         8:16   0   3.7T  0 disk  
|-sdb1      8:17   0   512M  0 part  
| `-md0     9:0    0   512M  0 raid1 [SWAP]
|-sdb2      8:18   0   3.7T  0 part  
| `-md1     9:1    0   7.3T  0 raid5 /mnt/HD/HD_a2
|-sdb3      8:19   0     1G  0 part  
`-sdb4      8:20   0     1G  0 part  /mnt/HD_b4
sdc         8:32   0   3.7T  0 disk  
|-sdc1      8:33   0   512M  0 part  
| `-md0     9:0    0   512M  0 raid1 [SWAP]
|-sdc2      8:34   0   3.7T  0 part  
| `-md1     9:1    0   7.3T  0 raid5 /mnt/HD/HD_a2
|-sdc3      8:35   0     1G  0 part  
`-sdc4      8:36   0     1G  0 part  /mnt/HD_c4
sdd         8:48   0   3.7T  0 disk  
|-sdd1      8:49   0   512M  0 part  
| `-md0     9:0    0   512M  0 raid1 [SWAP]
|-sdd2      8:50   0   3.7T  0 part  
| `-md1     9:1    0   7.3T  0 raid5 /mnt/HD/HD_a2
|-sdd3      8:51   0     1G  0 part  
`-sdd4      8:52   0     1G  0 part  /mnt/HD_d4

 

 

And;

root@DLINK-340L:~# lsmod
Module                  Size  Used by
iscsi_tcp               7462  0 
libiscsi_tcp           10398  1 iscsi_tcp
libiscsi               28745  2 iscsi_tcp,libiscsi_tcp
scsi_transport_iscsi    29251  3 iscsi_tcp,libiscsi
ipip                    6432  0 
xfrm6_mode_tunnel       1342  0 
xfrm6_mode_transport      952  0 
xfrm6_mode_beet         1420  0 
ip6_tunnel             10979  0 
tunnel6                 1762  1 ip6_tunnel
sit                     8287  0 
tunnel4                 1947  2 ipip,sit
ipv6                  220200  26 xfrm6_mode_tunnel,xfrm6_mode_beet,ip6_tunnel,tunnel6,sit
ufsd                  369071  0 
cryptodev              30283  1 
reg                     1161  0 

 

 

And;

 

.....

What do I do next ? Lost cause ?

 

Posted

Ok, so now you know that the box is running linux kernel 3.2, something you probably do not want to use, when building/running your own stuff. Uboot 2011 is not that horrible, and it supports the hardware so I'd leave that alone for the time beeing.

 

I checked the GPL sources, but also couldn't figure out how to easily build an image from them. Doesnt matter though, because you wouldn't want to build from them anyway (as you'd then get the same kernel thats on the box right now).

 

For the next steps, I'd go with what I wrote before. Check the web resources linked in previous posts, try to get a serial log from bootup (regarding uboot, probably try to grab the uboot vars on the way) and then try to prepare mainline debian and chroot into it. Go from there.

It is hard to really tell you exact steps, as we don't know the exact results you get. Work like this is very much experimental :)

Posted

I admit i am intimidated ...
I got ffp to run on this 4 years ago ...and that took a couple days of researching etc ... but I got it working finally ...

This seems like at least 1 month+  of time which i am kinda tight on now ...

Is there no easy way to repurpose this box ? Android maybe ? Hehehehe ... Something on a usb drive that i can just plug in , format the disks ( get rid

of all the dlink stuff ) and just have ssh and rsync on it ?

 

Posted
19 hours ago, czenmarco said:

Something on a usb drive that i can just plug in , format the disks ( get rid

of all the dlink stuff ) and just have ssh and rsync on it ?

Sure, you can first build a debian on an usb stick and try to boot or chroot from it.

 

Only other way, I could think of, would be, to pay someone else (or at least provide a/the DNS340 to them).

Posted
3 hours ago, Heisath said:

Sure, you can first build a debian on an usb stick and try to boot or chroot from it.

 

Only other way, I could think of, would be, to pay someone else (or at least provide a/the DNS340 to them).


Thanks @Heisath

 

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines