Welcome! Log In Create A New Profile

Advanced

Debian on WD MyCloud EX 4100

Posted by saschadd 
Re: Debian on WD MyCloud EX 4100
June 10, 2017 12:41PM
hmartin,

> @bodhi: your u-boot is for Yellowstone, but I esta
> blished the EX2100 is Yosemite. Perhaps saschadd c
> an try to kwboot his EX4100? I don't know the code
> name for that unit.
>

Yes, saschadd should try both u-boot binaries. Yellowstone is the EX4100. I've run the x_build.sh in their GPL for the EX4100, and looked at the log.

My stock u-boot build has a patch to remove the code that stops USB. The offending code is in bootm.c. Why would they want to do this before starting the kernel? There is no good reason. I guess to prevent people from starting a diffent OS :))

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 06/10/2017 12:44PM by bodhi.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 01:25PM
bodhi Wrote:
-------------------------------------------------------
> Here is the new DTB and its DTS.
>
> I've looked at that EX2 Ultra DTS. It came from th
> e same mainline version I'm basing on. There is no
> t much difference, except for the flash partitions
> .
>
> Please try this version I attached here. See if th
> e kernel find the correct partitions.
>
> And for the bootargs mtdparts, you can go back to
> the previous definition:
>
>
> setenv mtdparts 'mtdparts=armada-nand-0:5m(u-boot)
> ro,5m@5m(kernel),5m@10m(uRamdisk),441m@15m(image.c
> fs),15m@456m(rescue_fw),20m@471m(config),10m@491m(
> reserve1),10m@501m(reserve2)'
>
>
> Note that I've corrected the DTS/DTB name to 388.

There the magic is ;)

cat /proc/mtd
dev: size erasesize name
mtd0: 00500000 00020000 "U-Boot"
mtd1: 00a00000 00020000 "uImage"
mtd2: 00f00000 00020000 "uRamdisk"
mtd3: 1c800000 00020000 "image.cfs"
mtd4: 03800000 00020000 "rescue_fw"
mtd5: 02900000 00020000 "config"
mtd6: 01500000 00020000 "reserve1"
mtd7: 00b00000 00020000 "reserve2"

fw_printenv
Warning: Bad CRC, using default environment
bootargs=
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=3
baudrate=115200
stdin=serial,cros-ec-keyb
stdout=serial,lcd
stderr=serial,lcd
Re: Debian on WD MyCloud EX 4100
June 10, 2017 01:27PM
saschadd,

> cat /proc/mtd
> dev: size erasesize name
> mtd0: 00500000 00020000 "U-Boot"
> mtd1: 00a00000 00020000 "uImage"
> mtd2: 00f00000 00020000 "uRamdisk"
> mtd3: 1c800000 00020000 "image.cfs"
> mtd4: 03800000 00020000 "rescue_fw"
> mtd5: 02900000 00020000 "config"
> mtd6: 01500000 00020000 "reserve1"
> mtd7: 00b00000 00020000 "reserve2"
>

Great!

> fw_printenv
> Warning: Bad CRC, using default environment
> bootargs=
> bootcmd=bootp; setenv bootargs root=/dev/nfs nfsro
> ot=${serverip}:${rootpath} ip=${ipaddr}:${serverip
> }:${gatewayip}:${netmask}:${hostname}::off; bootm
> bootdelay=3
> baudrate=115200
> stdin=serial,cros-ec-keyb
> stdout=serial,lcd
> stderr=serial,lcd

This is expected. We need to find the location of the env on mtd0.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 02:10PM
Here is the ARM version for kwboot with the Kevin Smith's patch that hmartin found previously.

-bodhi
===========================
Forum Wiki
bodhi's corner
Attachments:
open | download - kwboot_arm.tar (20 KB)
Re: Debian on WD MyCloud EX 4100
June 10, 2017 02:25PM
> This is expected. We need to find the location of the env on mtd0.

I don't know if you can blindly trust Western Digital, but these are the u-boot defaults on my unit:
mtdparts=orion_nand:1M(u-boot),512K(uboot_env),512K(key_store),512K(info),10M(etc),10M(kernel_1),48896K(rootfs1),10M(kernel_2),-(rootfs2)

This also matches the DTB for the EX2U and what was populated on my EX2100:
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00080000 00020000 "uboot_env"
mtd2: 00080000 00020000 "key_store"
mtd3: 00080000 00020000 "info"
mtd4: 00a00000 00020000 "etc"
mtd5: 00a00000 00020000 "kernel_1"
mtd6: 02fc0000 00020000 "rootfs1"
mtd7: 00a00000 00020000 "kernel_2"
mtd8: 02fc0000 00020000 "rootfs2"



Edited 1 time(s). Last edit at 06/10/2017 02:26PM by hmartin.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 02:47PM
hmartin,

> I don't know if you can blindly trust Western Digi
> tal, but these are the u-boot defaults on my unit:
>
> mtdparts=orion_nand:1M(u-boot),512K(uboot_env),512
> K(key_store),512K(info),10M(etc),10M(kernel_1),488
> 96K(rootfs1),10M(kernel_2),-(rootfs2)
>
>
> This also matches the DTB for the EX2U and what wa
> s populated on my EX2100:
>
> dev:    size   erasesize  name
> mtd0: 00100000 00020000 "u-boot"
> mtd1: 00080000 00020000 "uboot_env"
> mtd2: 00080000 00020000 "key_store"
> mtd3: 00080000 00020000 "info"
> mtd4: 00a00000 00020000 "etc"
> mtd5: 00a00000 00020000 "kernel_1"
> mtd6: 02fc0000 00020000 "rootfs1"
> mtd7: 00a00000 00020000 "kernel_2"
> mtd8: 02fc0000 00020000 "rootfs2"
>

It is a much saner definition than the EX4100's.

In your case the /etc/fw_env.config should be:

# MTD device name	Device offset	Env. size 	Flash sector size	Number of sectors
/dev/mtd1 	 	 	0x0000 	 	0x80000 	 	0x20000

And beware of the spaces/tabs in this file, separation should be spaces, but there should be no space at the end of line.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 06/10/2017 03:15PM by bodhi.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 02:47PM
bodhi Wrote:
-------------------------------------------------------
> Here is the ARM version for kwboot with the Kevin
> Smith's patch that hmartin found previously.

Looks like the handshake is working at first try.

kwboot works but sometimes the output is a bit "defective"

pi@raspberrypi:~ $ sudo ./kwboot -f -t -B 115200 /dev/ttyAMA0 -b u-boot-a38x-Yellowstone_2014T30p6_bodhi-tld-1-nand-uart.bin -s 0 -q 1
Sending boot message. Please reboot the target...-SI Read for Marvell Board ID failed (57)
        Using default board ID



Gnraiiili  ein ..
ihsedH  Vso:2

 |   3    |  06   |  SATA3      |
 |   4    |  05   |  USB3 HOST0 |
 |   5    |  06   |  SATA2      |                                              \mvSysEnvGetTopologyUpdateInfo: TWSI Read failed                                |stPath Window
DDR3 Training Sequence - Ended Successfully                                    -____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
     _     ____              _| |
        | | | |   | __ )  ___   ___ | |_
        | | | |___|  _ \ / _ \ / _ \| __|
        | |_| |___| |_) | (_) | (_) | |_
         \___/    |____/ \___/ \___/ \__|
 ** LOADER **


U-Boot 2013.01_v1.06 (Jan 08 2015 - 10:04:46\ Read from S@R failed
Board: DB-88F6820-BP
  ung2UMV88F6828 Rev A
  Access, DLB Enabled, ECC Disabled
DRAM:  2 GiB
       BSS:                     0x7ffef254
       Stack:                   0x7f9cdf20
       Heap:                    0x7f9ce000:0x7fece000
as:    agtnal # 8 caugh
   U-o nion:    0x0000:x0000(NAND)
                                                                               | on "nand0":Mi
0x00001f500000-0x00001ff00000 : "mtd=7"
UBI: attaching mtd1t b0
B:pyilelksie  307 ye (8B
U:sletfahIO uit  08296bts
B: I edroffse:     08 aI: MTD device name:            "mt="
UI MTD device size:            10 MiB
UBI: numbs   80
UI a.aloe a Es
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 2/0
8 KiB, 3 MiB, 32 LEBs)
UBIFS: journal size:       1015809 bytes (992 KiB, 0 MiB, 6 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
 a  aennok90 a9e 91 root:  200807 bytes (1 o x2000 ihiz 36 00002).
e a  WakOLno                                                                   |-|--------------|
| egiga0 |   RGMII   |     0x00     |
eia[RME, gg1 SGMII   |     0x01
i an e t tpuooo |fset 0x500000, size 0x5|read: device 0 offset 0xa00000, size 0x500000                                                                         |ing image at 00ated:      2016-08-12   7:59:44 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4093188 Bytes = 3.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ...-Image Name:   Ramdisk
   Created:      2017-03-21   7:59:17 UTC
   Image Type:   ARM Linux RAMDiIaegi opesd)
 EtyPit00000000. i
  rfigCeku.|ng kernel ...
                                                                               -subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux verson31.9(mnkmhn gc eio464(LiaoGC rac46..MrlGCC e 211struction cache
Machine: Marvell Armada 380/381/382/385/388 (Device Tree), model: Marvell Armada 385 Development Board
Memory poliy Csbld aa cewieallo
PIha al tis:06 od:-,1 ye)50n  oapge:6
etyacehs al ne:117de:4 2em
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff8000   (  32 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0800000 - 0xfff00000   ( 247 MB)
    lowmem  : 0xc0000000 - 0xf0700000   ( 775 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0000c747  71 B
  nt:00180  x0a8  (2B
   .aa:0c0c0 -0cad0 (3ache controller enabled
l2x0: 16 ways, CACHE_ID 0x410054c9, AUX_CTRL 0x16070000, Cache size: 1048576 B
Console: colour dummy device 80x30
Calibrating delay loop... 3188.32 BogoMIPS (lpj=15941632)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 4096
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys blkio
Sttn psacidnity map for 0xc056c230 - 0xc056c288
mvebu-pmsu: Initializing Power Management Service Unit
Initializing CPU Reset module
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (6376.65 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
mvebu-soc-id: MVEBU SoC ID=0x6828, Rev=0x4
xor: measuring softwar hcsm spe
  3rg   10.0 B/sc
o:sn ucin r4eg 70.0 Bsc
N: gsee rotocol family 16
DMA0
raid6: int32x1    427 MB/s
raid6: int32x2    417 MB/s
aid:i2x  461M/    537 MB/s
ad sigagithmresource [bus 00-ff]
PCI: bus0: Fast back to back transfers disabled
pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
pci 0000:00:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring
PCI: bus1: Fast back to back transfers enabled
PCI: bus2: Fast back to back transfers enabled
pci 0000:00:01.0: PCI bridge to [bus 01]
pci 0000:00:02.0: PCI bridge to [bus 02]
PCI: enabling device 0000:pyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.22)
SGI XFS with security attributes, large block/inode numbers, no debug enabled
msgmni has been set to 1524
B layrCS eeic(s)divri0. od mjr 5)
iohdue f eitrd(eal
armada38-inr 1080pntl:rn use descriptors!
mv_xor f1060900.xor: Marvell XOR: ( crc32c )
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
f1012000.serial: ttS0aMIOxf000 iq  4i  150A
onl ttS nbld
110.eia:ty1a MOlum part sxs
scsi0 : ahci_mv_platform
scsi1 : ahci_mv_platform
ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 58
ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 58
ahci_mv f10e0000.sata: AHCI 0001.0000 32 sloprs6sx p lfr oe
him e00sa:flg:64bi cq sntf le nyppfsi slmpr sssi  hi_vpatform
scsi3 : ahci_mv_platform
ata3: SATA max UDMA/133 mmio [mem 0xf10e0000-0xf10e1fff] port 0x100 irq 60
ata4: SATA max UDMA/133 mmio [meblock table found at page 262016, version 0x01
nn_ed_bt bad blk  x000b00at 0x00000dcc0000
adradbt dbc 000280
adea_b:a block at 0x0000139a0000
nand_read_bbt: bad block at 0x000017880000
nand_read_bbt: bad block at 0x0000178a0000
nand_read_bbt: bad block at 0x00001a640000
nand_read_bbt: bad block at 0x00001e9c0000
8 ofpart partitions found on MTD device armada-nand
Creating 8 MTD partitions on "armada-nand":
0x000000000000-0x0000000x6828, revision = 0x4
  o XQeesuprortedon uprt Eald
  o Transmit checksum offload supported
  o Driver ER staitics ald
o rvrIO statistics enabled
  o Driver DEBUG statistics enabled

port #0: is_sgmii=0, is_rgmii=1, phy_addr=0
  o Loading network interface(s) for port #0: cpu_mask=0x3, tx_csum_limit=9800

  o Port 0 is connected to Linux netdevice
    o egiga0, ifindex = 2, GbE port = 0
        giga p=0: mtu=1500, mac=00:50:43:02:02:01 (platform)

ptform driver
ehci-orion: EHCI rost Controller
xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 3
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
rol 300)
ata4: SATA link down (SStatus 0 SControl 300)                                  \    ATA      ST3250318AS      CC44 PQ: 0 ANSI: 5
sd 2:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/232 GiB)
sd 2:0:0:0: Attached scsi generic sg0 type 0
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: ecce:eald ontspor POo U
sa d1                                                                          | new SuperSpeed  Power management will be impacted.
hub 3-1:1.0: USB hub found
hub 3-1:1.0: 4 ports detce
.rtc as rtc0                                                                   /nality registered for level 0
md: raid1 personality registered for level 1
ub2:ne i-sedUBdvieme  g xc-hdm: a5 personality registered for level 5
md: raid4 personality registered for level 4
device-mapper: ioctl: 4.24.0-otal CESA HW channels supported 2
mvant cans2, session=640, queue=256cs EAfeatue han0
hub 2-1:1.0: USB hub found
hub 2-1:1.0: 4 ports detected
armada-cesa-ocf f109d000.crypto: cesa_ocf_probe: CESA driver operate in ocf(0) mode
cesadev_init(c0734f0c)
TCP: cubic registered
m:Wiin or aldvie ob valbebeore atdtctC(491728sasvesn
d fyudon't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
RAMDISK: gzip image founds: mounted
Freeing unused kernel memory: 256K (c0718000 - c0758000)
init started: BusyBox 2. 21-035280 S)                                          -lag=1,vaule_flagaching mtd5 to uf1018140 : 00700000
size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good a E 1,crutdPB: 0
UI  oume: 1, intea oue ,max. volumes count: 128
UBI: max/mean erase counter: 24/14, WL threshold: 4096, image sequence number: 854877737
UBI: available PEBs: 12, total reserved PEBs: 147, PEBs reserved for bad PEB handling: 19                                                                      \, volume 0, name "config"
UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bye/08 tUIS: Sie 1424btatest is w4/r0), UUID CA6C4BAB-A767-40BD-8190-380C535C4A0E, small LPT model
ve '/usr/local/tmp/image.cfs': No such file or directory
umount: can't umount /usr/local/tmp: Invalid argument
first good block is 0
image len = 96858112 , image checksum = 9707d888
umount: can't umount /usr/local/tmp: Invalid a|s -o loop /usr/local/tmp/image.cfs /usr/local/modules                                                           /bnatpmp.so: File exists
ln: /lib/./libpam.so.0.81.6: File exists                                       |ists                                                                           | Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 npEhent Wa(0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:194

Do Lan Port Switch
egiga1: mac address changed                                                    /loaded at bf000000
 0000000f
ufsd: driver (lke_9.2.0 lke_9.2.0_r256412_b49, build_host("fsd-linux-bs06b"), acl, ioctl, bdi, sd2(0), fua, bz, tr, rsrc) loaded at bf020000
otiie:sedBild_fr__elosoek.03_0-6lk_20r542b9

Btrfs lo4 Max Krasnyansky <maxk@qualcomm.com>                                  -;36m/usr/sbin//raid_config -> /usr/sbin/diskmgr
/usr/sbin/diskmgr
lrwxrwxrwx    1 root     0               17 Jun 10 20:41 /usr/sbin/radepddss - 3RPC eitfst0810 = 000   7Jn1 2:4 sr/bn/ri_pt_o >2/s/dsmr[m
 C egserofe 011000
eetn S eie dvbus/s0302
usb 3-1:int called with disabled ep eedff5c0                                   \Reset suc384 Kbytes
Used size     = 220 Kbytes
Free size     = 12164 Kbytes
percentage = 2
/usr/local/config free size is 12455936                                        \bi1
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 80, bad PEBs: 0, corrupta.voume ont 2
B:mamea rscutr /,Wtso 0 LEBs (2285568 bytes, 2.2 MiB), LEB size 126976 bytes (124.0 KiB)                                                                       | 2048 bytes/2048 bytes
UBIFS: FS size: 3047424 bytes (2 MiB, 24 LEBs), journal size 1015809 bytes (0 MiB, 6 LEBs)
UBIFS: reserved for root: 143937 bytes (140 KiB)
UBIFS: media format: w4/r0 (latest is w4/r0), UUID D26023modl
UIF:nmutUIdvc 1vlme0
n./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 80, bad PEBs: 0, corrupted PEBs: 0
UI cgond thread "ubi_bgt2d" started, PID 3240
UBI device number 2, total 80 LEBs (10158080 bytes, 9.7 MiB), available 6 LEBs (761856 bytes, 744.0 KiB), LEB size 126976 byt|dev/mtd7: File e3                /6 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS: FS size: 4063232 bytes (3 MiB, 32 LE) junlsze1189 yID DA85EEA8-3B41-440D-BCDF-6D0EC49EAC66, small LPT model
/dev/mtd7 muto(b)onfig egiga0 hw ether 00:90:A9:E5:19:1E
lan0:ifconfig egiga1pool #1: pkt_size=1536, buf_size=1600 - 2048 of 2048 buffers added
 hw ether 00:90:egiga0: link up
A9:E5:19:1F
egiga0: started
egg1satd8o 04 uffede
[d_radsra.62]Ra ea nume fo lh.
w_ed_eial.:10 eil ubr: NG7046
idnecyto:0                                                                     -: No such file or directory                                                    |erting '/usr/local/modules/driver/sit.ko': -1 Unknown symbol in module
v6.conf.egiga0.accept_dad = 2
net.ipv6.conf.deftdatasis=1
ntiv.of.ia.a_rasusr/local/etc': File exists                                    / restart}                                                                      /onding: MII link monitoring set to 500 ms                                      -own link.
or directory                                                                   \n.
wget: unable to resolve host address 'download.wdc.com'
pnpInit -- -208                                                                | bond0: up!
IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready                       \lash ****                                                                      | (-0100) +0.846044 +/- 0.6337\ directory
sysinfod: disk connectei77, 5\ such file or directoc/bus/usb does not exist    /|:80... I/O warning : failed to load external entity "/var/www/xml/internal_backup.xml"
kill
killall: traceroute: no process killed                                         \  / 0.4s

2017-06-10 22:42:18 (145 KB/s) - '/var/www/xml/app_info.m'sed[41/41]
                                                                               -WDMyCloudEX4100_HDD_Blacklist.xmlp_pa.m"
gono..o..3.6..7 5..329
necting to downloa|5119.77|:80.../Time                                         |port = 49otDevice Registered
Initializing State Table
State Table Initialized
Starting atopacctd                                                             -init.d/onbrdnetloccommd - Start                                                |load /usr/local/modules/driver/nf_nat_masquerade_ipv4.ko                       /y/stp.ko
failed to load /usr/local/modules/driver/br_netfilter.ko                       /directory. Are you trying to connect to a TLS-enabled daemon withoutTS         |ker_daemon.sh: line 196: /var/lib/docker/docker.log: No such file or directory
Docker pid 59
Stopping wappmwapg saraysopd
trig dpmr                                                                      /
Re: Debian on WD MyCloud EX 4100
June 10, 2017 02:54PM
Quote
saschadd
> Looks like the handshake is working at first try.
>
> kwboot works but sometimes the output is a bit "de
> fective"

Cool! excellent works hmartin :) I'm going to try this on the NAS326 when I have time.

@saschadd, can you interrupt u-boot and printenv?

Update:

No, it does not look like it's working at all for saschadd.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 06/10/2017 03:00PM by bodhi.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:02PM
I might need to rebuild kwboot. I'm using u-boot-master.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:07PM
saschadd,

In your Ex4100 try this /etc/fw_env.config:

# MTD device name	Device offset	Env. size 	Flash sector size	Number of sectors
/dev/mtd0 0x100000 0x80000 0x20000

and
fw_printenv

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 06/10/2017 03:16PM by bodhi.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:32PM
Quote

I might need to rebuild kwboot. I'm using u-boot-master.

kwboot is the same between master and 2017.05. So the version I've compiled and attached above should be OK.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:35PM
bodhi Wrote:
-------------------------------------------------------
> @saschadd, can you interrupt u-boot and printenv?

Can't interrupt u-boot by pressing 1 like in picocom.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:38PM
saschadd,

> Can't interrupt u-boot by pressing 1 like in picoc
> om.

I did not look at the log carefully! the hanshake did not occur. Please try running it as many time as you can.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:44PM
On the slim chance of there might be some differences.

Attached here is the binary built with the exact kwboot source that hmartin used: built with the patch applied to the 2017.05 source tree.

-bodhi
===========================
Forum Wiki
bodhi's corner
Attachments:
open | download - kwboot_arm_2017.05.tar (20 KB)
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:47PM
bodhi Wrote:
-------------------------------------------------------
> saschadd,
>
> > Can't interrupt u-boot by pressing 1 like in pic
> oc
> > om.
>
> I did not look at the log carefully! the hanshake
> did not occur. Please try running it as many time
> as you can.

What happens when the handshake occurs?
Any different output that indicates that handshake worked?

UPDATE:
Could it be that the BootROM version 1.73 is not compatible with kwboot?
@hmartin: could you check your BootROM version?



Edited 1 time(s). Last edit at 06/10/2017 03:58PM by saschadd.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 03:55PM
> What happens when the handshake occurs?
> Any different output that indicates that handshake
> worked?

You would see

Sending boot image...
  0 % [......................................................................]
 99 % [...................................]
[Type Ctrl-\ + c to quit]


And then the new u-boot starts.

On the envs subject:

please try the /etc/fw_env.config I've posted above. I am confident that will work.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 04:01PM
bodhi Wrote:
-------------------------------------------------------
> > What happens when the handshake occurs?
> > Any different output that indicates that handsha
> ke
> > worked?
>
> You would see
>
>
> Sending boot image...
> 0 % [...........................................
> ...........................]
> 99 % [...................................]
> [Type Ctrl-\ + c to quit]
> 
>
>
> And then the new u-boot starts.
>

Okay, will see. But seems that uboot is starting right away.

> On the envs subject:
>
> please try the /etc/fw_env.config I've posted abov
> e. I am confident that will work.

Should i make a new file /etc/fw_env.config with the info you posted?
Re: Debian on WD MyCloud EX 4100
June 10, 2017 04:13PM
> Should i make a new file /etc/fw_env.config with t
> he info you posted?

You can edit the existing file on the SATA rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 04:21PM
bodhi Wrote:
-------------------------------------------------------
> > Should i make a new file /etc/fw_env.config with
> t
> > he info you posted?
>
> You can edit the existing file on the SATA rootfs.

Okay, so i boot to debian and edit that file on the SATA rootfs and try fw_printenv

Correct?
Re: Debian on WD MyCloud EX 4100
June 10, 2017 04:38PM
> Okay, so i boot to debian and edit that file on th
> e SATA rootfs and try fw_printenv
>
> Correct?

Correct.

It is a non-destructive test. If the location is wrong then you'll get a CRC error.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 06/10/2017 04:39PM by bodhi.
Re: Debian on WD MyCloud EX 4100
June 10, 2017 04:42PM
bodhi Wrote:
-------------------------------------------------------
> > Okay, so i boot to debian and edit that file on
> th
> > e SATA rootfs and try fw_printenv
> >
> > Correct?
>
> Correct.
>
> It is a non-destructive test. If the location is w
> rong then you'll get a CRC error.

Tried that and it gave me an CRC as earlier above.

Also tried to copy the fw_env.config from SATA /etc to stock rom /etc
but fw_printenv gives me

-sh: fw_printenv: not found
Re: Debian on WD MyCloud EX 4100
June 10, 2017 05:09PM
saschadd,

Did you make sure that /etc/fw_env.config has correct spacing and no space at the end?

/dev/mtd0 0x100000 0x80000 0x20000

You could copy the file from your NAS326 and edit it.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 05:23PM
>
> /dev/mtd0 0x100000 0x80000 0x20000
>
>

Hold on. I think I need to double check these numbers.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 10, 2017 05:32PM
Ok. Looks like I've found some better info. Please try:


The content of /etc/fw_env.config

/dev/mtd0 0x500000 0x80000 0x20000


This number does not seem to make sense (it overlaps the uImage) . But the GPL said so! so try.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 06/10/2017 05:36PM by bodhi.
Re: Debian on WD MyCloud EX 4100
June 11, 2017 03:19AM
Quote
saschadd
UPDATE:
Could it be that the BootROM version 1.73 is not compatible with kwboot?
@hmartin: could you check your BootROM version?

I have BootROM version 1.73, kwboot does work.

Your log shows that the device booted normally, meaning kwboot did not succeed with the right timing. This happens a lot. I need to try maybe 10 times before it works correctly.

When it does work, you will see output like:
Sending boot message. Please reboot the target...-�$�"Ufw�$�"U����$
Dfw�$�"U�\�$�"U����$�DUf�$�"Uw��"U����$4"U���$�"Uw�$�"U���$�DUf|fD�&T���$�"U�E�$�"Df3DD�DU�E7$�"U����$4"U���$�"U�E�4"U�/7@� ��$DUw�$�"U����$�DUff�$�"D��fD$U��
Sending boot image...
  0 % [......................................................................]
  1 % [..

A lot of patience and resetting of the device is required.

kwboot will always output the console of the device, so if you do NOT see "Sending boot image..." followed by maybe a minute of transferring, then you're seeing the default u-boot on NAND loading and executing. It's true, you cannot interrupt u-boot by pressing 1, because kwboot is only printing the output (because it's still trying to transmit the handshake).

If you do not see the "Sending boot image" text, then you need to power cycle the EX4100 and try to kwboot again (meaning ctrl+c kwboot and run it again before re-applying power to the EX4100).

Ignore the garbage before "Sending boot image" this is random and will be different each time you attempt.



Edited 2 time(s). Last edit at 06/11/2017 03:23AM by hmartin.
Re: Debian on WD MyCloud EX 4100
June 11, 2017 03:26AM
hmartin Wrote:
-------------------------------------------------------
>
Quote
saschadd
> UPDATE:
> Could it be that the BootROM version 1.73 is not c
> ompatible with kwboot?
> @hmartin: could you check your BootROM version?
>
>
> I have BootROM version 1.73, kwboot does work.
>
> Your log shows that the device booted normally, me
> aning kwboot did not succeed with the right timing
> . This happens a lot. I need to try maybe 10 times
> before it works correctly.
>
> When it does work, you will see output like:
>
> Sending boot message. Please reboot the target...-
> �$�"Ufw�$�"U����$
> Dfw�$�"U�\�$�"U����$�DUf�$�"Uw��"U����$4"U���$�"
> Uw�$�"U���$�DUf|fD�&T���$�"U�E�$�"Df3DD�DU�E7$�"
> U����$4"U���$�"U�E�4"U�/7@� ��$DUw�$�"U����$�D
> Uff�$�"D��fD$U��
> Sending boot image...
> 0 % [...........................................
> ...........................]
> 1 % [..
>
>
> A lot of patience and resetting of the device is r
> equired.
>
> kwboot will always output the console of the devic
> e, so if you do NOT see "Sending boot image..." fo
> llowed by maybe a minute of transferring, then you
> 're seeing the default u-boot on NAND loading and
> executing. It's true, you cannot interrupt u-boot
> by pressing 1, because kwboot is only printing the
> output (because it's still trying to transmit the
> handshake).
>
> If you do not see the "Sending boot image" text, t
> hen you need to power cycle the EX4100 and try to
> kwboot again (meaning ctrl+c kwboot and run it aga
> in before re-applying power to the EX4100).
>
> Ignore the garbage before "Sending boot image" thi
> s is random and will be different each time you at
> tempt.

Thanks for the info. Never used kwboot yet so i didnt know.

So everytime if there is no handshake
ctrl-c to end kwboot
power off nas
start kwboot
power on nas
Re: Debian on WD MyCloud EX 4100
June 11, 2017 03:38AM
/dev/mtd0 0x100000 0x80000 0x20000

gives

Warning: Bad CRC, using default environment
bootargs=
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=3
baudrate=115200
stdin=serial,cros-ec-keyb
stdout=serial,lcd
stderr=serial,lcd

/dev/mtd0 0x500000 0x80000 0x20000

gives

Cannot read bad block mark: Invalid argument
Re: Debian on WD MyCloud EX 4100
June 11, 2017 03:46AM
Cool, kwboot is running now!!! :)

UPDATE:

i am using

sudo ./kwboot -f -t -B 115200 /dev/ttyAMA0 -b u-boot-a38x-Yellowstone_2014T30p6_bodhi-tld-1-nand-uart.bin -s 0 -q 1

with your first kwboot for arm (not the 2017-05 version)

First try was 3 times i think.
Second try was more than 10 times 12 or 13, forgot to count from 10 onwards. ;)
Last try was at 5th try.


printenv gives me
CASset=max
MALLOC_len=5
MPmode=SMP
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=root=/dev/ram console=ttyS0,115200
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read.e 0xa00000 0x500000 0x500000;nand read.e 0xf00000 0xa00000 0x500000;bootm 0xa00000 0xf00000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=1
cacheShare=no
console=console=ttyS0,115200
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:58:31:3c
eth1mtu=1500
eth2addr=00:50:43:58:54:3c
eth2mtu=1500
eth3addr=00:50:43:31:54:58
eth3mtu=1500
ethact=egiga0
ethaddr=00:50:43:54:31:3c
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
filesize=24
ide_path=/
image_name=uImage
initrd_name=uInitrd
ipaddr=2.66.66.203
kernel_addr_r=2080000
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
mtddevname=u-boot
mtddevnum=0
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:5m(u-boot)ro,5m@5m(kernel),5m@10m(uRamdisk),441m@15m(image.cfs),15m@456m(rescue_fw),20m@471m(config),10m@491m(reserve1),10m@501m(reserve2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:3c:54:58
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
partition=nand0,0
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serverip=2.66.66.32
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
usb0Mode=host
usbActive=0
usbType=3
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81

Environment size: 3202/524284 bytes



Edited 2 time(s). Last edit at 06/11/2017 06:50AM by saschadd.
Re: Debian on WD MyCloud EX 4100
June 11, 2017 05:17AM
saschadd,

Congrats:) you are running my patched uboot image loaded by kwboot!

Now please modify the post to describe:

1. which kwboot binary you are using.
2. how many time you were trying until this good run
3. can you repeat this? and describe the sequence.
4. execute printenv output at the prompt and post output.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on WD MyCloud EX 4100
June 11, 2017 05:55AM
Quote
bodhi
3. can you repeat this? and describe the sequence.

This could take a while ;-)

I suspect the successful sequence will be:
Quote
saschadd
So everytime if there is no handshake
ctrl-c to end kwboot
power off nas
start kwboot
power on nas

The timing parameters are still not right. I don't know if there is a better way, I have not found more reliable delay parameters.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: