Welcome! Log In Create A New Profile

Advanced

Debian Stretch on Sata disk in WD MyCloud EX2 Ultra

Posted by LinAdmin 
Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 06, 2018 07:40AM
In this forum I have found several interesting threads about modifications of this NAS.

I have an USB stick attached where initrd and kernel 4.9.y are stored and a serial cable connected where I can boot from USB with the rest of Debian in a file system on Disk.

This system is pretty small and has excellent benchmarks for reading and writing via samba and nfs. The small footprint leaves enough RAM for efficient disk caching without need for swap.

Now, I would like to get a permanent solution where initrd and kernel no longer are on USB but on a small boot partition on disk.

Unfortunately the original uBoot from WD seems not to support Sata and also lacks saveenv which in the long term might be useful.

Therefore I would like to generate a new uBoot which would read kernel and initrd from bootP on sda1. This could be tested first using kwboot and then flashed once into mtd0: (An even more sophisticated approach would also change the primary boot order and other $bootargs).

This brings the important advantage that future updates of the LTS kernel 4.9.xx which is supported for many years can be installed without any further writing to the flash memory.
Do you think that this approach is possible and how should I proceed?
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 06, 2018 03:08PM
LinAdmin,

> Unfortunately the original uBoot from WD seems not
> to support Sata and also lacks saveenv which in
> the long term might be useful.
>
> Therefore I would like to generate a new uBoot
> which would read kernel and initrd from bootP on
> sda1. This could be tested first using kwboot and
> then flashed once into mtd0: (An even more
> sophisticated approach would also change the
> primary boot order and other $bootargs).

> Do you think that this approach is possible and
> how should I proceed?

It is possible. The quickest way to get there is to rebuild stock u-boot to enable saveenv (GPL is available from WD). As for SATA, it is most likely that it's just not powered up by stock WD u-boot. Not because it is not supported. This can be solved by poking the GPIO with u-boot mw.

So I think all it'd take is getting the GPL, change a few lines of code, rebuild, kwboot it, and flash to mtd0.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 07, 2018 12:35PM
Many thanks bodhi for your motivating reply.

I built u-boot from latest WDMyCloud_Ex2Ultra_GPL_v2.30.193_20180502 running xbuild.
This produces the file u-boot-a38x-GrandTeton_2014T3_PQ-nand-uart_512M which I renamed to u-boot.bin.

The MyColud EX2 got one disk partitioned with fdisk holding a small bootP with stored uImage and initrd as used before on the USB stick.

When giving the commands at the console to init scsi and load both files and then booting: Heureka it booted!

However, the command "scsi init" also produced the unexpected error message "Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found". This 1B4B address can be found in cmd_scsi.c (line 58) probably as a default and in armada_38x.h (line 249) in a multiple list.

Do you have an idea what must be modified to get rid of that error message?

I have two 8 TB red disks to be used and when i formatted them using gdisk and GPT, then "scsi init "after the expected output
Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
the uboot hangs forever. In armada_38x.h there is
#define CONFIG_SYS_64BIT_LBA	/* Support disk over 2TB */
#define CONFIG_LBA48
so I hoped that GPT would be supported?
What must I do in order to use the 8TB disks?

Looking forward to your advice.
LinAdmin



Edited 1 time(s). Last edit at 09/07/2018 12:56PM by LinAdmin.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 07, 2018 02:43PM
LinAdmin,

> However, the command "scsi init" also produced the
> unexpected error message "Error: SCSI
> Controller(s) 1B4B:9215 1B4B:9235 not found".

We've always seen this error during boot. But it never seem to affect the disk spin up. Did you issue a mw command to power up SATA?

For example, on the NAS326 with u-boot
uboot_version=U-Boot 2013.01-svn48797 (Jan 18 2016 - 03:10:12) Marvell version: 2014_T3.0p6

We needed to do this (one of the 2 commands powered up SATA, but I don't remember which one).
setenv sata_init 'mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init'

Note that the GPIO base addresss such as f1018100 and f1018140 are the same for all these Armada boxes, but the GPIO bits might be different between Zyxel and WD implementations.

And BTW, I recall that these u-boot versions do support GPT.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/07/2018 02:50PM by bodhi.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 08, 2018 03:15AM
I have further investigated the problem:

When u-boot waits on the serial console, the sata hardware is already powered up without giving any 'mw' command.

However, 'scsi init' some times reports the disk id's with erroneous texts and and only after 'scsi reset' it eventually brings the correct text. After that, booting the small disk with partition table in mbr works as expected.

I then ran 'gdisk /dev/sda' on that disk and it reported the correct partitioning in mbr. Pressing 'w' wrote the GPT tables on that disk saying that it kept a protective mbr. Starting again gdisk and 'fdisk -l' both reported the GPT partitioning.

After that I again entered 'scsi init' and the command hung forever, the same way as it was before with the 8 TB disk initially partitioned with GPT without protective mbr.

Therefore I come to the conclusion that this version of u-boot does not support GPT.

(WD avoids this problem by storing kernel and initrd in flash ram. When the kernel runs the support for GPT is loaded.)

I am really disappointed that so close at the goal there seems to be a huge problem. What can be done?

PS: I have now verified in the code: include/part.h does not know of GPT.



Edited 3 time(s). Last edit at 09/10/2018 12:57PM by LinAdmin.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 08, 2018 03:15PM
LinAdmin,

I'm not convinced that this u-boot can't handle GPT. From what you said, this u-boot is the same as other WD MyCould and Zyxel Armada boxes. It is circa 2013 and I don't recall GPT was a problem.

Do you have a small HDD that you can format with a single GPT partition and test it? boot with USB and try to spin it up at serial console.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 08, 2018 04:28PM
I had described before that an old (750 G) disk partitioned with fdisk did work as excepted and when the partitioning was changed to GPT the 'scsi init' with the same disk hung. Other disks (small and up to 8 TB) partitioned with GPT show the same behavior.

As said before, in part.h of WD u-boot there is no sign of GPT code visible. GPT is mentioned only in the context of efi and I do not think that this helps booting a GPT disk with scsi.

PS1: I have just now learned about hybrid GPT and fully hope that this will work in my EX2...

PS2: I was able to create a hybrid partition. When the MBR table has an additional protective entry, u-boot command 'scsi init' hangs. When I remove that 'unnecessary' protective entry, booting works. However the linux system only uses the MBR information and the last big partition in the GPT table is not used. Proof: partprobe -s /dev/sda only shows MBR entries.

So the question remains: How to create a hybrid partitioning that satifyes u-boot but still forces the kernel to use the GPT data???

PS3: @bodhi: With a 750G disk partitioned with one GPT entry 'scsi init' hangs.



Edited 5 time(s). Last edit at 09/10/2018 01:00PM by LinAdmin.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 10, 2018 04:56AM
Conclusion about this u-boot and GPT:

a) With GPT this u-boot does not work at all.

b) With hybrid GPT, but without protective entry in the MBR table, this u-boot works. Linux however does not see the GPT and we need a trick to force Linux to use GPT although the protective entry in MBR table is missing. I did not find any such hints, but I still could imagine that some magic in the boot args or in initrd might be able to help.

c) With hybrid GPT including a protective entry in the MBR table, this u-boot does not work. We would need a trick to get it working and I have not yet tested if Linux would use GPT with such a disk.

(An intriguing side mark: WD MyCloud Gen 2 with single disk has one GPT disk with rootFS and boot directory in GPT sda3 and ext4 files system. Unfortunately they violate GPL and do not distribute source code of that u-boot.)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 10, 2018 02:46PM
LinAdmin,

> PS3: @bodhi: With a 750G disk partitioned with one
> GPT entry 'scsi init' hangs.

You meant you wiped out the disk with parted, and create 1 GPT partition? i.e. no protective MBR remained?

Perhaps this u-boot version is different from other WD NAS boxes u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 10, 2018 04:13PM
bodhi, the MBR of that disk was filled with zeros to make sure nothing was left from hybrid partitioning and then using gdisk one partition created.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 10, 2018 04:42PM
LinAdmin Wrote:
-------------------------------------------------------
> bodhi, the MBR of that disk was filled with zeros
> to make sure nothing was left from hybrid
> partitioning and then using gdisk one partition
> created.

Have you tried parted/gparted?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 11, 2018 07:43AM
I have wiped the disk and using gparted created a single GPT-partition.
It would have been too surprising if 'scsi init' would not hang as with every GPT :-(

Questions regarding Zyxel NAS326:

- With their u-boot and without anything on USB, what does 'scsi init' with 1 and 2 disk(s) partitioned with several GPT entries show?

- If their u-boot does correctly handle it, where can I download sources of their u-boot (Zyxel seems very complicated about that?)

- If have red something about a timeout value having been patched from 3 to 200 ms in order to allow detecting 2 sata disks?

Thx!!
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 11, 2018 04:09PM
LinAdmin,

> Questions regarding Zyxel NAS326:
>
> - With their u-boot and without anything on USB,
> what does 'scsi init' with 1 and 2 disk(s)
> partitioned with several GPT entries show?

I can't recall whether I have tested this in the NAS326. When I have a chance (found a spare drive) I will test it.

>
> - If their u-boot does correctly handle it, where
> can I download sources of their u-boot (Zyxel
> seems very complicated about that?)

Not really. The actually responded to my email request within a couple days. They just need the serial number to make sure you actually own the box. If you still have problem getting GPL sources, send me a PM.

> - If have red something about a timeout value
> having been patched from 3 to 200 ms in order to
> allow detecting 2 sata disks?

Yes, I've found that reading the GPL code, when some users had problem booting with 2 HDDs. These Marvell u-boot versions (all of these boxes u-boot derived from the same uboot version) use an old ACHI driver which sets the timeout at 3ms. The current (2017 ish) u-boot AHCI driver uses 200ms.

In the mean time, you could keep the rootfs on a GPT drive, and load the kernel from USB. I know it is a workaround only, but it is good work around when you will have solved this problem, you only need to adjust u-boot envs to boot completley from HDD.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 26, 2018 07:18AM
Hybrid partitioning did not succeed and I have given up. So the question remains how WD MyCloud Gen2 (single drive) with only a small flash storage can boot with a GPT disk. In the GPL source from WD u-boot is not included, but I can not imagine how the Grub source included should do the job?

So it still would be very helpful to know if NAS326 can boot on GPT?
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 26, 2018 10:43AM
LinAdmin Wrote:
-------------------------------------------------------
> This system is pretty small and has excellent benchmarks for reading and writing via samba and nfs.
>
I am interested to know what kind of excellent benchmarks performance you get from this setup.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 26, 2018 01:36PM
LinAdmin,

> So the question remains how WD MyCloud
> Gen2 (single drive) with only a small flash
> storage can boot with a GPT disk.

> but I can not imagine how the Grub source included should do the job?

Usually very simple. The kernel files are stored in flash. After booted, U-Boot (not Grub) stars the kernel. The kernel mounts the rootfs from the HDD. Similarly, a USB drive can be set up to store kernel files only and u-boot will boot from there.

Power up interrupt the count down and,

printenv


> So it still would be very helpful to know if
> NAS326 can boot on GPT?

Will see if I can.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/26/2018 05:05PM by bodhi.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
September 27, 2018 11:54PM
LinAdmin ,

> > So it still would be very helpful to know if
> > NAS326 can boot on GPT?

I've looked, but I don't have any spare HDD right now. So I can't check that for you.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
October 21, 2018 12:51PM
I finally found a work around for using the 8 TB disk with the old u-boot which does not understand GPT:

Normally, when a disk is partitioned with a GPT table, the first entry in the MBR table gets a so called "protective entry" allocating the maximum space of 2 TB of the old addressing scheme as a type "0xec". This entry also instructs Linux to use GPT instead of MBR partition information.

For some special cases gdisk does allow to have so called "hybrid partitioning": You first create a new GPT with all your smaller partitions below the 2 TB limit and as last entries the partitions above 2 TB. After that using the 'recovery menu' -> 'hybrid entries' you report max. 3 partitions to the MBR and in the last entry again type "0xec".

This last entry is important to instruct Linux to use the GPT, but it also results in u-boot not to accept the partitioning of such disks :(

By patching the code of u-boot I managed to get it discarding that protective entry and using all MBR entries in front of it.

That new u-boot with save_env enabled allows to have initrd and root file system on the first disk partitions.
The Debian kernel armmp from stretch works as expected when the module sdhci_pxav3 is blacklisted. This is necessary in order to avoid unnecessary high CPU load when idle.

If anybody is interested in the patches I can download them. In a later phase I still hope to find a suitable u-boot that understands GPT!
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 24, 2022 07:32AM
Bumping this topic to avoid create more.

I have the Ex2 Ultra, with the uart working, I have created my own uImage and uRamdisk, basically using theses steps: https://github.com/Heisath/wdmc2-kernel but using the 385 file for the ultra I found here in other thread. I have also patched the u-boot.

I'm trying to boot from usb first, to test them, but doesn't works:

Marvell>> usb storage                                                                                                                     
  Device 0: Vendor: PNY      Rev: 1100 Prod: USB 2.0 FD                                                                                   
            Type: Removable Hard Disk                                                                                                     
            Capacity: 3894.1 MB = 3.8 GB (7975296 x 512)                                                                                  
Marvell>> fatload usb 0:1 0xa00000 uImage                                                                                                 
reading uImage                                                                                                                            
Marvell>> fatload usb 0:1 0x2000000 uRamdisk                                                                                              
reading uRamdisk                                                                                                                          
1622632 bytes read in 70 ms (22.1 MiB/s)                                                                                                  
Marvell>> bootm 0xa00000 0x2000000                                                                                                        
## Booting image at 00a00000 ...                                                                                                          
## Booting kernel from Legacy Image at 00a00000 ...                                                                                       
   Image Name:   WDMC-Gen2                                                                                                                
   Created:      2022-11-23  15:00:20 UTC                                                                                                 
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                    
   Data Size:    3886291 Bytes = 3.7 MiB                                                                                                  
   Load Address: 00008000                                                                                                                 
   Entry Point:  00008000                                                                                                                 
   Verifying Checksum ... OK                                                                                                              
## Loading init Ramdisk from Legacy Image at 02000000 ...                                                                                 
   Image Name:   Custom initramfs                                                                                                         
   Created:      2021-07-28   7:11:31 UTC                                                                                                 
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)                                                                                
   Data Size:    1622568 Bytes = 1.5 MiB                                                                                                  
   Load Address: 00e00000                                                                                                                 
   Entry Point:  00000000                                                                                                                 
   Verifying Checksum ... OK

And stops there... any tips? below my printevn

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 videol
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none                                                                               
bootargs_root=root=/dev/nfs rw                                                                                                            
bootcmd=nand read.e 0x02000020 0x0500000 0x0500000; nand read.e 0x2900000 0x0a00000 0x0500000; bootm 0x02000020 0x2900000                 
bootcmd_auto=stage_boot $boot_order                                                                                                       
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath i;
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:36:2c:34                                                                                                                
eth1mtu=1500                                                                                                                              
eth2addr=00:50:43:36:98:34                                                                                                                
eth2mtu=1500                                                                                                                              
eth3addr=00:50:43:2c:98:36                                                                                                                
eth3mtu=1500                                                                                                                              
ethact=egiga2                                                                                                                             
ethaddr=00:50:43:98:2c:34                                                                                                                 
ethmtu=1500                                                                                                                               
ethprime=egiga2                                                                                                                           
fdt_addr=2040000                                                                                                                          
fdt_skip_update=no                                                                                                                        
fdtaddr=0x1000000                                                                                                                         
fdtfile=armada-38x-modular.dtb                                                                                                            
filesize=12                                                                                                                               
ide_path=/                                                                                                                                
image_name=uImage                                                                                                                         
initrd_name=uInitrd                                                                                                                       
ipaddr=192.168.11.110                                                                                                                     
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),185m@15m(image.cfs),15m@200m(rescue_fw),20m@215m(config),10m@23)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500                                                                          
mv_pon_addr=00:50:43:34:98:36                                                                                                             
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=192.168.11.114                                                                                                                   
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_;
stderr=serial                                                                                                                             
stdin=serial                                                                                                                              
stdout=serial                                                                                                                             
usb0Mode=host                                                                                                                             
usbActive=1                                                                                                                               
usbType=3                                                                                                                                 
vxworks_en=no                                                                                                                             
yuk_ethaddr=00:00:00:EE:51:81                                                                                                             
                                                                                                                                          
Environment size: 3221/524284 bytes

Thanks
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 24, 2022 08:12AM
New attempt, with different memory address to load the uRam and the uImage

Marvell>> usb start                                                                                                                       
(Re)start USB...                                                                                                                          
USB0:   Port (usbActive) : 1    Interface (usbType = 3) : USB XHCI 1.00                                                                   
scanning bus 0 for devices... 2 USB Device(s) found                                                                                       
       scanning usb for storage devices... 1 Storage Device(s) found                                                                      
       scanning usb for ethernet devices... 0 Ethernet Device(s) found                                                                    
Marvell>> fatload usb 0:1 0x02000020  uImage                                                                                              
reading uImage                                                                                                                            
3886355 bytes read in 147 ms (25.2 MiB/s)                                                                                                 
Marvell>> fatload usb 0:1 0x2900000  uRamdisk                                                                                             
reading uRamdisk                                                                                                                          
1622632 bytes read in 76 ms (20.4 MiB/s)                                                                                                  
Marvell>> bootm 0x02000020 0x2900000                                                                                                      
## Booting image at 02000020 ...                                                                                                          
## Booting kernel from Legacy Image at 02000020 ...                                                                                       
   Image Name:   WDMC-Gen2                                                                                                                
   Created:      2022-11-23  15:00:20 UTC                                                                                                 
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                    
   Data Size:    3886291 Bytes = 3.7 MiB                                                                                                  
   Load Address: 00008000                                                                                                                 
   Entry Point:  00008000                                                                                                                 
   Verifying Checksum ... OK                                                                                                              
## Loading init Ramdisk from Legacy Image at 02900000 ...                                                                                 
   Image Name:   Custom initramfs                                                                                                         
   Created:      2021-07-28   7:11:31 UTC                                                                                                 
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)                                                                                
   Data Size:    1622568 Bytes = 1.5 MiB                                                                                                  
   Load Address: 00e00000                                                                                                                 
   Entry Point:  00000000                                                                                                                 
   Verifying Checksum ... OK                                                                                                              
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 24, 2022 01:37PM
and another

Marvell>> fatload usb 0:1 0x00a00000 boot_mio/uimage                                                                                        
reading boot_mio/uimage                                                                                                                     
3886355 bytes read in 154 ms (24.1 MiB/s)                                                                                                   
Marvell>> fatload usb 0:1 0x00f00000 boot_mio/uramdisk                                                                                      
reading boot_mio/uramdisk                                                                                                                   
1622632 bytes read in 87 ms (17.8 MiB/s)                                                                                                    
Marvell>> bootm 0x00a00000 0x00f00000                                                                                                       
## Booting image at 00a00000 ...                                                                                                            
## Booting kernel from Legacy Image at 00a00000 ...                                                                                         
   Image Name:   WDMC-Gen2                                                                                                                  
   Created:      2022-11-23  15:00:20 UTC                                                                                                   
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                      
   Data Size:    3886291 Bytes = 3.7 MiB                                                                                                    
   Load Address: 00008000                                                                                                                   
   Entry Point:  00008000                                                                                                                   
   Verifying Checksum ... OK                                                                                                                
## Loading init Ramdisk from Legacy Image at 00f00000 ...                                                                                   
   Image Name:   Custom initramfs                                                                                                           
   Created:      2021-07-28   7:11:31 UTC                                                                                                   
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)                                                                                  
   Data Size:    1622568 Bytes = 1.5 MiB                                                                                                    
   Load Address: 00e00000                                                                                                                   
   Entry Point:  00000000                                                                                                                   
   Verifying Checksum ... OK   
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 24, 2022 02:48PM
i5Js,

Since you are using patched u-boot and can use USB drive, you don't need to boot that old kernel. The rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2 should work.

When booting Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2, try these addresses:

Quote

uImage 0x800000
uInitrd 0x2100000

and also

setenv initrd_high 0xffffffff

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 04:01AM
Hey Bodhi,

Thanks for your answer, it didn't work

Marvell>> setenv fdt_skip_update yes                                                                                                        
Marvell>> setenv initrd_high 0xffffffff                                                                                                     
Marvell>> setenv bootargs root=/dev/sda2 console=ttyS0,115200 earlyprintk=serial                                                                                                                             
Marvell>> fatload usb 0:1 0x800000 uimage                                                                                                   
reading uimage                                                                                                                              
5236606 bytes read in 224 ms (22.3 MiB/s)                                                                                                   
Marvell>> fatload usb 0:1 0x2100000 uInitrd                                                                                                 
reading uInitrd                                                                                                                             
9649885 bytes read in 397 ms (23.2 MiB/s)                                                                                                   
Marvell>> bootm 0x800000 0x2100000                                                                                                          
## Booting image at 00800000 ...                                                                                                            
## Booting kernel from Legacy Image at 00800000 ...                                                                                         
   Image Name:   Linux-5.13.8-mvebu-tld-1                                                                                                   
   Created:      2022-11-25   9:49:59 UTC                                                                                                   
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                      
   Data Size:    5236542 Bytes = 5 MiB                                                                                                      
   Load Address: 00008000                                                                                                                   
   Entry Point:  00008000                                                                                                                   
   Verifying Checksum ... OK                                                                                                                
## Loading init Ramdisk from Legacy Image at 02100000 ...                                                                                   
   Image Name:   initramfs-5.13.8-mvebu-tld-1                                                                                               
   Created:      2021-09-24   7:54:32 UTC                                                                                                   
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)                                                                                  
   Data Size:    9649821 Bytes = 9.2 MiB                                                                                                    
   Load Address: 00000000                                                                                                                   
   Entry Point:  00000000                                                                                                                   
   Verifying Checksum ... OK



Edited 1 time(s). Last edit at 11/25/2022 04:04AM by i5Js.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 04:13AM
I have also tried with another address, without luck

Marvell>> setenv fdt_skip_update yes                                                                                                        
Marvell>> setenv initrd_high 0xffffffff                                                                                                     
Marvell>> setenv bootargs root=/dev/sda2 console=ttyS0,115200 earlyprintk=serial                                                            
Marvell>> fatload usb 0:1 0xa00000 uimage                                                                                                   
reading uimage                                                                                                                              
5236606 bytes read in 224 ms (22.3 MiB/s)                                                                                                   
Marvell>> fatload usb 0:1 0x1200000 uInitrd                                                                                                 
reading uInitrd                                                                                                                             
9649885 bytes read in 397 ms (23.2 MiB/s)                                                                                                   
Marvell>> bootm 0xa00000 0x1200000                                                                                                          
## Booting image at 00a00000 ...                                                                                                            
## Booting kernel from Legacy Image at 00a00000 ...                                                                                         
   Image Name:   Linux-5.13.8-mvebu-tld-1                                                                                                   
   Created:      2022-11-25   9:49:59 UTC                                                                                                   
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                      
   Data Size:    5236542 Bytes = 5 MiB                                                                                                      
   Load Address: 00008000                                                                                                                   
   Entry Point:  00008000                                                                                                                   
   Verifying Checksum ... OK                                                                                                                
## Loading init Ramdisk from Legacy Image at 01200000 ...                                                                                   
   Image Name:   initramfs-5.13.8-mvebu-tld-1                                                                                               
   Created:      2021-09-24   7:54:32 UTC                                                                                                   
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)                                                                                  
   Data Size:    9649821 Bytes = 9.2 MiB                                                                                                    
   Load Address: 00000000                                                                                                                   
   Entry Point:  00000000                                                                                                                   
   Verifying Checksum ... OK 
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 07:04AM
I have testes with an smaller Ramdisk, but... same

Marvell>> setenv fdt_skip_update yes                                                                                                        
Marvell>> setenv initrd_high 0xffffffff                                                                                                     
Marvell>> setenv bootargs root=/dev/sda2 console=ttyS0,115200 earlyprintk=serial                                                            
Marvell>> fatload usb 0:1 0x800000 uimage                                                                                                   
reading uimage                                                                                                                              
5236606 bytes read in 225 ms (22.2 MiB/s)                                                                                                   
Marvell>> fatload usb 0:1 0x2100000 uramdisk                                                                                                
reading uramdisk                                                                                                                            
2679866 bytes read in 129 ms (19.8 MiB/s)                                                                                                   
Marvell>> bootm 0x800000 0x2100000                                                                                                          
## Booting image at 00800000 ...                                                                                                            
## Booting kernel from Legacy Image at 00800000 ...                                                                                         
   Image Name:   Linux-5.13.8-mvebu-tld-1                                                                                                   
   Created:      2022-11-25   9:49:59 UTC                                                                                                   
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                      
   Data Size:    5236542 Bytes = 5 MiB                                                                                                      
   Load Address: 00008000                                                                                                                   
   Entry Point:  00008000                                                                                                                   
   Verifying Checksum ... OK                                                                                                                
## Loading init Ramdisk from Legacy Image at 02100000 ...                                                                                   
   Image Name:   Ramdisk                                                                                                                    
   Created:      2017-02-04  18:43:13 UTC                                                                                                   
   Image Type:   ARM Linux RAMDisk Image (lzma compressed)                                                                                  
   Data Size:    2679802 Bytes = 2.6 MiB                                                                                                    
   Load Address: 00e00000                                                                                                                   
   Entry Point:  00e00000                                                                                                                   
   Verifying Checksum ... OK 
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 10:54AM
This is the out put of my cpuinfo


root@MyCloudEX2Ultra root # cat /proc/cpuinfo 
processor : 0
model name : ARMv7 Processor rev 1 (v7l)
BogoMIPS : 2655.84
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x4
CPU part : 0xc09
CPU revision : 1

processor : 1
model name : ARMv7 Processor rev 1 (v7l)
BogoMIPS : 2655.84
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x4
CPU part : 0xc09
CPU revision : 1

Hardware : Marvell Armada 380/381/382/385/388 (Device Tree)
Revision : 0000
Serial  : 0000000000000000

I have used armada_385 So I guess I’m using the correct file, am not I? Just in case, perhaps, I have created a wrong uImage.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 02:00PM
i5Js,

The rootfs Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2 is created on Ext3 partition.

I can't recall, does this u-boot have ext2load command?

ext2load usb 0:1 0x00800000 /boot/uimage                                                                                                   
ext2load usb 0:1 0x02100000 /boot/uInitrd

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 02:06PM
I have created two partitions, because for some strange reason, at marvel prompt, it doesn’t recognize the ext3 partition. So there are two: one in fat32 with uFiles and ext3 with the rootfs.

I can try ext2load and see….
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 02:20PM
Marvell>> usb start                                                                                                                                                                           
(Re)start USB...                                                                                                                                                                              
USB0:   Port (usbActive) : 1    Interface (usbType = 3) : USB XHCI 1.00                                                                                                                       
scanning bus 0 for devices... 2 USB Device(s) found                                                                                                                                           
       scanning usb for storage devices... 1 Storage Device(s) found                                                                                                                          
       scanning usb for ethernet devices... 0 Ethernet Device(s) found                                                                                                                        
Marvell>> setenv fdt_skip_update yes                                                                                                                                                          
Marvell>> setenv initrd_high 0xffffffff                                                                                                                                                       
Marvell>> setenv bootargs root=/dev/sda2 console=ttyS0,115200 earlyprintk=serial                                                                                                              
Marvell>> ext2load usb 0:1 0x00800000 uimage                                                                                                                                                  
ERROR unknown endpoint state for ep

Marvell>> ext2ls usb 0:1                                                                                                                                                                      
ERROR unknown endpoint state for ep



Edited 1 time(s). Last edit at 11/25/2022 02:22PM by i5Js.
Re: Debian Stretch on Sata disk in WD MyCloud EX2 Ultra
November 25, 2022 02:43PM
At this point, you don't care about initrd yet, just want get pass that kernel booting.

So try

Marvell>> setenv fdt_skip_update yes                                                                                                        
Marvell>> setenv bootargs root=/dev/sda2 console=ttyS0,115200 earlyprintk=serial                                                            
Marvell>> fatload usb 0:1 0x02000000 uimage
and then
bootm 0x02000000

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: