fvdw-sl on WD My Cloud

fvdw-sl on WD My Cloud

Postby matt_max » Tue Jun 07, 2022 11:57 am

Hi guys,
i just got a used drive and I'm wondering if it is possible to run fvdw-sl on WD MyCloud 6TB drive like this one.

I really appreciate all that hard work on this great project :applause

Code: Select all
SIECIOWY:~# cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 1 (v7l)
processor       : 0
BogoMIPS        : 1299.25

processor       : 1
BogoMIPS        : 1292.69

Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 1

Hardware        : Comcerto 2000 EVM
Revision        : 0001
Serial          : 0000000000000000


Code: Select all
SIECIOWY:~# cat /proc/meminfo
MemTotal:         232320 kB
MemFree:           56000 kB
Buffers:            5632 kB
Cached:            44992 kB
SwapCached:        17536 kB
Active:            58432 kB
Inactive:          46080 kB
Active(anon):      25024 kB
Inactive(anon):    36096 kB
Active(file):      33408 kB
Inactive(file):     9984 kB
Unevictable:        8064 kB
Mlocked:            8064 kB
SwapTotal:        500672 kB
SwapFree:         397376 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         55808 kB
Mapped:            28608 kB
Shmem:              4864 kB
Slab:              22208 kB
SReclaimable:      11520 kB
SUnreclaim:        10688 kB
KernelStack:       11968 kB
PageTables:        18304 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      616832 kB
Committed_AS:     508672 kB
VmallocTotal:     516096 kB
VmallocUsed:       39552 kB
VmallocChunk:     458688 kB
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Tue Jun 07, 2022 4:13 pm

I think it should be possible. That device has a armada 370 cpu. Similar to the one used by seagate personal cloud. (Sgpc1)
Maybe the kernel compiled for this seagate also runs on the WD...however in case the motherboard contains different pheripals like for instance another ethernet chip the sg pc1 kernel migth miss some drivers and needs recompile to support your motherboard. Also we will need info on how the kernel and root file system is loaded. When this is the same way as in sg pc1 we could do a trial with that kernel. In the sg pc subforum you can read how fvdw-sl is installed on that device you could try if that procedure also works on th WD.
I do not have a WD so I can try or investigate.
Th
fvdw
Site Admin - expert
 
Posts: 13230
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Wed Jun 08, 2022 12:49 pm

OK :thumbup
So before I try to install fvdw-sl firmware for the seagate drive maybe I can get you more information about this device. If you need something in particular just tell me and I do my best.

Code: Select all
SIECIOWY:/boot# uname -a
Linux SIECIOWY 3.2.26 #1 SMP Thu Jul 9 11:14:15 PDT 2015 wd-2.4-rel armv7l GNU/Linux

Code: Select all
SIECIOWY:/boot# cat /proc/partitions
major minor  #blocks  name

   8        0 5860522584 sda
   8        1    1999872 sda1
   8        2    1999872 sda2
   8        3     500736 sda3
   8        4 5855807488 sda4
   8        5      97280 sda5
   8        6      98304 sda6
   8        7       1024 sda7
   8        8       2048 sda8
   9        0    1999808 md0


There is no lshw and dmesg also wasn't very helpful.

I found that my device is v4.x Firmware (first generation single bay My Cloud). As you can check here there is an opensource firmware available. Maybe that's gonna be helpfull.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Thu Jun 09, 2022 2:29 pm

This link seems to contain the required information
https://forum.doozan.com/read.php?2,95069

It shows uboot is accesible via serial interface.
If you can access uboot terminal you can let it boot anyway you want. I need to study the info to see how to modifu bootcmd to let it boot an fvdw-sl disk

Are you able to connect to the serial port?
fvdw
Site Admin - expert
 
Posts: 13230
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Sun Jun 12, 2022 9:49 am

Finally I was able to open the drive case and remove main pcb.

Front:
pcb1.jpg

Back:
pcb2.jpg


This is the heart of the device. Comcerto M86200G-12 Cortex A-9 dual-core processor.
main.jpg


Network chip:
bcm54612e.jpg

BCM54612E: triple-speed 1000BASE-T/100BASE-TX/10BASE-T Energy Efficient Ethernet (IEEE 802.3az) Gigabit (GbE) transceiver integrated into a single monolithic CMOS chip.

Memory:
memory.jpg

Samsung 2Gbit (250MB) DDR3-1600 (11-11-11) SDRAM

BIOS is placed on Windbond 25X40CLVIG.

I don't see any standard serial port but I found something interesting "The mainboard has an edge connector with 4 contacts on both sides. The contacts on the "inner" side are: GND, Rx, Tx, (gap), +3,3V."

P.S.
Success! :woohoo That is the output from serial connection.
You do not have the required permissions to view the files attached to this post.
Last edited by matt_max on Wed Aug 10, 2022 6:57 pm, edited 1 time in total.
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Sun Jun 12, 2022 1:58 pm

Nice :thumbup . Notice the line autoboot
Press a key when you see that to see if you can enter uboot, you should get a prompt like this: marvell>
At that prompt give the command
Code: Select all
printenv
vand post the output. From that we can see what commands are use to boot this device.
Ps it seems to be different from the one posted on the doozan forum...This one doesn't use uboot.

See here for some info http://mybookworld.wikidot.com/my-cloud
Also there some info is given on how to interrupt boot
Also here https://archlinuxarm.org/forum/viewtopic.php?t=8251

The cpu seems to be an arm9 I am not sure if it can deal with arm5 code used for the firmware. Will try to figure that out
fvdw
Site Admin - expert
 
Posts: 13230
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Sun Jun 12, 2022 3:10 pm

That's right - I think it uses Barebox instead of uboot.
I do not have "marvell>" prompt. There is "Barebox-C2K >/"

When I type printenv that was the output:
Code: Select all
Barebox-C2K >/ printenv
locals:
PATH=/env/bin
btn_status=0
uloaderimage=microloader-c2kevm.bin
bareboximage=barebox-c2kevm.bin
autoboot_timeout=1
ip=none
kernel_loc=sata
kernelimage_type=uimage
kernelimage=uImage
rootfs_loc=sata
rootfs_type=ext4
rootfsimage=root.ext4-128k
usb3_internal_clk=yes
bootargs=console=ttyS0,115200n8, init=/sbin/init rootfstype=ext4 rw noinitrd mac_addr=00:11:22:33:44:55 model= serial= board_test= btn_status=0
rxicmp_startup_env=/env/bin/rxicmp_startup_script
model=sq
globals:
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Sun Jun 12, 2022 7:08 pm

This is new field for me :scratch think you have to play around a little at barebox prompt to get some more info on barebox commands

Here you can find command reference https://www.barebox.org/doc/latest/commands.html

It seems many commands are just like in linux


There is apparently a command bootm that can load an kernel image using boot arguments and a root filesystem, that looks very similar to what uboots does.

Try on the prompt commands like
Code: Select all
ls
mount
cat /proc/partitions
dmesg
fvdw
Site Admin - expert
 
Posts: 13230
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: fvdw-sl on WD My Cloud

Postby matt_max » Sun Jun 12, 2022 8:20 pm

Ok. That is all I can get:
Code: Select all
Barebox-C2K >/ help
         . - alias for source
         ? - alias for help
         [ - alias for test
   addpart - adds a partition table to a device
     bootm - boot an application image
     bootu - bootu - start a raw linux image
     bootz - bootz - start a zImage
       cat - concatenate file(s)
        cd - change working directory
     clear - clear screen
      copy - copy command
        cp - copy files
   cpuinfo - Show info about CPU
     crc32 - crc32 checksum calculation
        dd - DDR test
   delpart - delete partition(s)
   devinfo - Show information about devices and drivers.
      dhcp - invoke dhcp client to obtain ip/boot params
      echo - echo args to console
      edit - Usage: (s)edit <file>
     erase - erase FLASH memory
erase_nand - Erase the NAND
erase_old_nand_fmt - Erase old NAND format
    ethact - set current ethernet device
      exit - exit script
     false - do nothing, unsuccessfully
gemac_stats - retrieve GEMAC statistics
get_button_status - get_button_status
    getopt - getopt <optstring> <var>
      help - print online help
 i2c_probe - probe for an i2c device
  i2c_read - read from an i2c device
 i2c_write - write to an i2c device
       led - changes the LED color
   loadenv - Load environment from ENVFS into DIRECTORY (default: /dev/env0 -> /env).
        ls - list a file or directory
        md - memory display
    memcmp - memory compare
    memcpy - memory copy
    memset - memory fill
     mkdir - make directories
     mount - Mount a filesystem of a given type to a mountpoint or list mounted filesystems.
        mw - memory write (fill)
      nand - NAND specific handling
       pfe - pfe <options>
 pfe_stats - retrieve PFE statistics
       phy - PHY status, read and write operation
      ping - ping <destination>
  printenv - Print value of one or all environment variables.
   protect - enable flash write protection
       pwd - print working directory
 read_nand - Read the NAND
  readline - prompt for user input
     reset - Perform RESET of the CPU
        rm - remove files
     rmdir - remove directorie(s)
    rxicmp - rxicmp
      sata - SATA sub system
   sataenv - SATA sub system
  satapart - SATA sub system
   saveenv - save environment to persistent storage
     sedit - alias for edit
        sh - run shell script
   socinfo - print SoC info
    source - execute shell script in current shell environment
    switch - Atheros AR8328 switch read and write operation
      test - minimal test like /bin/sh
      tftp - Load file using tftp protocol
   timeout - wait for a specified timeout
      true - do nothing, successfully
    umount - umount a filesystem
 unprotect - disable flash write protection
update_i2c - update_i2c <src> <off> <size>
update_nand - Flash the NAND
update_nor - Flash the NOR
update_spi - update_spi <src> <sec> <off> <size>
   version - print monitor version
Barebox-C2K >/

As you can see there is no dmesg but ls give me that:
Code: Select all
Barebox-C2K >/ ls -l
drwxrwxrwx          0 .
drwxrwxrwx          0 ..
drwxrwxrwx          0 dev
drwxrwxrwx          0 env

In dev directory:
Code: Select all
Barebox-C2K >/dev ls -l
cr-------- 4294967295 zero
crw-------      12717 defaultenv
crw------- 4294967295 mem
crw-------         64 phy0
crw-------   16777216 spi0
crw-------      65536 env0
crw-------    3145728 mem.uImage
Barebox-C2K >/dev

...and in env directory:
Code: Select all
Barebox-C2K >/env ls -l
drwxrwxrwx          0 .
drwxrwxrwx          0 ..
-rwxrwxrwx        311 config
drwxrwxrwx          0 bin
Barebox-C2K >/env

...and there:
Code: Select all
Barebox-C2K >/env ls -lR
/env:
drwxrwxrwx          0 .
drwxrwxrwx          0 ..
-rwxrwxrwx        311 config
drwxrwxrwx          0 bin
/env/bin:
drwxrwxrwx          0 .
drwxrwxrwx          0 ..
-rwxrwxrwx        442 boot_sata
-rwxrwxrwx        880 _update_help
-rwxrwxrwx       1185 init
-rwxrwxrwx       1522 update
-rwxrwxrwx        240 rxicmp_startup_script
-rwxrwxrwx       1141 _update
-rwxrwxrwx         46 update_barebox
-rwxrwxrwx         45 update_kernel
-rwxrwxrwx       3728 boot
-rwxrwxrwx       2600 static_config
-rwxrwxrwx         45 update_rootfs
-rwxrwxrwx         21 hush_hack
-rwxrwxrwx         46 update_uloader

mount give me this:
Code: Select all
Barebox-C2K >/ mount
none on / type ramfs
none on /dev type devfs
Barebox-C2K >/

There is no proc directory so I cannot list /proc/partitions
I don't know how to copy files from /env/bin directory to my pc but all of them are regular bash scripts AFAIK. I can cat all of them.
For example:
Code: Select all
Barebox-C2K >/ cat /env/config
#!/bin/sh
###############################################################################
# This file contains the barebox Environment variables.                       #
###############################################################################

eth0.ethaddr=00:90:A9:D8:5E:AD
model=sq
serial=
board_test=

or:
Code: Select all
Barebox-C2K >/ cat /env/bin/rxicmp_startup_script
#!/bin/sh
#
# rxicmp_startup_script - TFTP's and executes startup.sh script required for
#                         initiating the rxicmp boot sequence.
#

dhcp
tftp startup.sh
/startup.sh
#tftp $rootpath/$bootfile /dev/mem
#bootm /dev/mem

or...
Code: Select all
Barebox-C2K >/ cat /env/bin/boot_sata
#!/bin/sh
sata
#sata read 3008000 1 5000
satapart 0x3008000 5 0x5000
sata stop
## The following gets set in static_config ##
#bootargs="console=ttyS0,115200n8, init=/sbin/init"
#bootargs="$bootargs root=/dev/sda1 rootfstype=ext4 rw noinitrd"
#bootargs="$bootargs mac_addr=$eth0.ethaddr"
#bootargs="$bootargs model=$model serial=$serial board_test=$board_test btn_status="
#############################################
bootm /dev/mem.uImage

If you wish I can list all of that files. Maybe we can use uboot instead barebox? Is it possible to swap it?
A few more
init file:
Code: Select all
Barebox-C2K >/ cat /env/bin/init
#!/bin/sh

PATH=/env/bin
#export PATH

## Button initial state
btn_status=0
get_button_status

. /env/bin/static_config
. /env/config

# NOTE: rxicmp requires 'rxicmp_startup_env' barebox env variable to be
#       pointing to an executable script (ex: /env/bin/rxicmp_startup_script)
rxicmp

# Western Digital: For now for tftping...
addpart /dev/mem 3M@0x3008000(uImage)

if [ -e /dev/nor0 -a -n "$nor_parts" ]; then
        addpart /dev/nor0 $nor_parts
fi

if [ -e /dev/disk0 -a -n "$disk_parts" ]; then
        addpart /dev/disk0 $disk_parts
fi

if [ -e /dev/nand0 -a -n "$nand_parts" ]; then
        addpart /dev/nand0 $nand_parts

        # Uh, oh, hush first expands wildcards and then starts executing
        # commands. What a bug!
        source /env/bin/hush_hack
fi

if [ -f /env/bin/init_board ]; then
        /env/bin/init_board
fi

echo
echo -n "Hit any key to stop autoboot: "
timeout -a $autoboot_timeout
if [ $? != 0 ]; then
        . /env/bin/_update_help
        exit
fi


#./boot
sata                  # initialize SATA
sataenv run 7         # try to run script from partition 7
sataenv run 8         # try to run script from partition 8
. /env/bin/boot_sata  # if all else fails, use this script to boot
led system_led red


Barebox-C2K >/

Another example: /env/bin/update_barebox leads to /env/bin/update
Code: Select all
Barebox-C2K >/ cat /env/bin/update_barebox
#!/bin/sh

. /env/bin/update -t barebox -d $1

Code: Select all
Barebox-C2K >/ cat /env/bin/update
#!/bin/sh

type=""
device_type=""
check=n
mode=tftp

. /env/config

while getopt "ht:d:f:a:s:m:c" Option
do
if [ ${Option} = t ]; then
        type=${OPTARG}
elif [ ${Option} = d ]; then
        device_type=${OPTARG}
elif [ ${Option} = f ]; then
        imagename=${OPTARG}
elif [ ${Option} = a ]; then
        address=${OPTARG}
elif [ ${Option} = s ]; then
        size=${OPTARG}
elif [ ${Option} = c ]; then
        check=y
elif [ ${Option} = m ]; then
        mode=${OPTARG}
else
        . /env/bin/_update_help
        exit 0
fi
done

if [ x${type} = xkernel ]; then
        image=$kernelimage
elif [ x${type} = xrootfs ]; then
        image=$rootfsimage
elif [ x${type} = xbarebox ]; then
        image=$bareboximage
        if [ x${image} = x ]; then
                image=barebox.bin
        fi
elif [ x${type} = xuloader ]; then
        image=$uloaderimage
elif [ x${type} = xbareboxenv ]; then
        image=$bareboxenvimage
        if [ x${image} = x ]; then
                image=bareboxenv.bin
        fi
        type=env
else
        . /env/bin/_update_help
        exit 1
fi

if [ x${imagename} != x ]; then
        image=${imagename}
fi

if [ x${device_type} = xnand ]; then
        part=/dev/nand0.${type}.bb
elif [ x${device_type} = xnor ]; then
        part=/dev/nor0.${type}
else
        . /env/bin/_update_help
        exit 1
fi

if [ x${mode} != xtftp ] && [ x${mode} != xxmodem ] && [ x${mode} != xddr ]; then
        echo "unsupported mode ${mode}."
        . /env/bin/_update_help
        exit 1
fi

. /env/bin/_update || exit 1

if [ x${check} = xy ]; then
        if [ x${mode} = xddr ]; then
                crc32 -f $part
                crc32 $address+$size
        elif [ x${mode} = xtftp ]; then
                crc32 -f $part
        else
                crc32 -f $image -F $part
        fi
else
        true
fi
Barebox-C2K >/

This is interesting:
Code: Select all
Barebox-C2K >/ cat /env/bin/boot
#!/bin/sh
# This is not used but it was originally called by init script

. /env/bin/static_config
. /env/config

if [ x$1 = xnand ]; then
        rootfs_loc=nand
        kernel_loc=nand
elif [ x$1 = xnor ]; then
        rootfs_loc=nor
        kernel_loc=nor
elif [ x$1 = xsata ]; then
        rootfs_loc=sata
        kernel_loc=sata
elif [ x$1 = xnfs ]; then
        rootfs_loc=net
        kernel_loc=nfs
elif [ x$1 = xtftp ]; then
        rootfs_loc=net
        kernel_loc=tftp
fi

if [ x$ip = xdhcp ]; then
        bootargs="$bootargs ip=dhcp"
elif [ x$ip = xnone ]; then
        bootargs="$bootargs ip=none"
else
        bootargs="$bootargs ip=$eth0.ipaddr::$eth0.gateway:$eth0.netmask:::"
fi


if [ x$rootfs_loc = xnet ]; then
        bootargs="$bootargs root=/dev/nfs nfsroot=$nfsroot,v3,tcp noinitrd"
elif [ x$rootfs_loc = xinitrd ]; then
        bootargs="$bootargs root=/dev/ram0 rdinit=/sbin/init"
elif [ x$rootfs_loc = xsata ]; then
        bootargs="$bootargs rootfstype=$rootfs_type rw noinitrd"
else
        if [ x$rootfs_loc = xnand ]; then
                rootfs_mtdblock=$rootfs_mtdblock_nand
        else
                rootfs_mtdblock=$rootfs_mtdblock_nor
        fi

        if [ x$rootfs_type = xubifs ]; then
                if [ -z $ubiroot ]; then
                        ubiroot="rootfs"
                fi
                if [ x$rootfs_loc = xnand ]; then
                        bootargs="$bootargs root=ubi0:$ubiroot ubi.mtd=$rootfs_mtdblock,4096"
                else
                        bootargs="$bootargs root=ubi0:$ubiroot ubi.mtd=$rootfs_mtdblock"
                fi
        else
                bootargs="$bootargs root=/dev/mtdblock$rootfs_mtdblock"
        fi

        bootargs="$bootargs rootfstype=$rootfs_type rw noinitrd"
fi

if [ -n $nor_parts ]; then
        mtdparts="${mtdparts}${nor_device}:${nor_parts}"
fi

if [ -n $nand_parts ]; then
        if [ -n ${mtdparts} ]; then
                mtdparts="${mtdparts};"
        fi
        mtdparts="${mtdparts}${nand_device}:${nand_parts}"
fi

if [ -n $mtdparts ]; then
        bootargs="${bootargs} mtdparts=${mtdparts}"
fi

if [ -e /dev/ram0 ]; then
if [ ! -e /dev/ram0.kernelraw ]; then
        # arm raw kernel images are usually located at sdram start + 0x8000
        addpart /dev/ram0 8M@0x8000(kernelraw)
fi

if [ ! -e /dev/ram0.kernel ]; then
        # Here we can safely put the kernel without risking of overwriting it
        # while extracting
        addpart /dev/ram0 8M@8M(kernel)
fi
fi

if [ x$kernel_loc = xnfs ] || [ x$kernel_loc = xtftp ]; then
        if [ x$ip = xdhcp ]; then
                dhcp
        fi
        if [ $kernelimage_type = uimage ]; then
                netload="/dev/ram0.kernel"
        elif [ $kernelimage_type = zimage ]; then
                netload="/dev/ram0.kernel"
        elif [ $kernelimage_type = raw ]; then
                netload="/dev/ram0.kernelraw"
        elif [ $kernelimage_type = raw_lzo ]; then
                netload="/dev/ram0.kernel"
        else
                echo "error: set kernelimage_type to one of 'uimage', 'zimage', 'raw' or 'raw_lzo'"
                exit 1
        fi
        $kernel_loc $kernelimage $netload || exit 1
        kdev="$netload"
elif [ x$kernel_loc = xnor ]; then
        kdev="/dev/nor0.kernel"
elif [ x$kernel_loc = xnand ]; then
        kdev="/dev/nand0.kernel.bb"
elif [ x$kernel_loc = xsata ]; then
#       addpart /dev/mem 3M@0x3008000(uImage)
#       sata init
#       sata read 3008000 7800 1c00
#       kdev="/dev/mem.uImage"
#       sata stop
        sata
        sataenv run 7         # try to run script from partition 7
        sataenv run 8         # try to run script from partition 8
        . /env/bin/boot_sata  # if all else fails, use this script to boot
else
        echo "error: set kernel_loc to one of 'nfs', 'tftp', 'nand' or 'nor'"
        exit 1
fi

if [ -n $usb3_internal_clk ]; then
        bootargs="$bootargs usb3_internal_clk=$usb3_internal_clk"
fi

echo "booting kernel of type $kernelimage_type from $kdev"

if [ x$kernelimage_type = xuimage ]; then
        bootm $kdev
elif [ x$kernelimage_type = xzimage ]; then
        bootz $kdev
elif [ x$kernelimage_type = xraw ]; then
        if [ $kernel_loc != net ]; then
                cp $kdev /dev/ram0.kernelraw
        fi
        bootu /dev/ram0.kernelraw
elif [ x$kernelimage_type = xraw_lzo ]; then
        unlzo $kdev /dev/ram0.kernelraw
        bootu /dev/ram0.kernelraw
fi
Barebox-C2K >/

Next fine spot:
Code: Select all
Barebox-C2K >/ cat /env/bin/_update_help
#!/bin/sh

echo "usage: update -t <kernel|rootfs|barebox|bareboxenv> -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] -c"
echo "update tools."
echo ""
echo "options"
echo " -c     to check the crc32 for the image and flashed one"
echo ""
echo "default mode is tftp"
echo "type update -t uloader -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update uloader into flash"
echo "type update -t barebox -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update barebox into flash"
echo "type update -t kernel -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update kernel into flash"
echo "type update -t rootfs -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update rootfs into flash"
echo "type update -t bareboxenv -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update bareboxenv into flash"
Barebox-C2K >/

If we could upload uboot file there I think we can put it on nand:
Code: Select all
Barebox-C2K >/ cat /env/bin/_update
#!/bin/sh

if [ x$mode = xddr ]; then
        if [ -z "$part" -o -z "$address" -o -z "$size" ]; then
                echo "define \$part, \$address and \$size"
                exit 1
        fi
else
        if [ -z "$part" -o -z "$image" ]; then
                echo "define \$part and \$image"
                exit 1
        fi
fi

if [ ! -e "$part" ]; then
        echo "Partition $part does not exist"
        exit 1
fi

if [ x$mode = xtftp ]; then
        if [ x$ip = xdhcp ]; then
                dhcp
        fi

        ping $eth0.serverip
        if [ $? -ne 0 ] ; then
                echo "Server did not reply! Update aborted."
                exit 1
        fi

elif [ x$mode = xxmodem ]; then
        loadb -f $image -c
        if [ $? -ne 0 ] ; then
                echo "loadb failed or cancelled! Update aborted."
                exit 1
        fi
fi

unprotect $part

echo
echo "erasing partition $part"
echo
erase $part

if [ x$mode = xddr ]; then
        echo
        echo "flashing $size@$address to $part"
        echo
else
        echo
        echo "flashing $image to $part"
        echo
fi

if [ x$mode = xtftp ]; then
        tftp $image $part
        if [ $? -ne 0 ] ; then
                echo "!!!Probable use of old NAND layout.!!!"
                echo "Use 'erase_old_nand_fmt' command to clean NAND."
                exit 1
        fi
elif [ x$mode = xddr ]; then
        memcpy $address -d $part 0 $size
else
        cp $image $part
fi

protect $part
Barebox-C2K >/

One more script:
Code: Select all
Barebox-C2K >/ cat /env/bin/static_config

#!/bin/sh
###############################################################################
# This file contains the barebox Environment variables.                       #
# This file was the old config file and contains static things, mostly for    #
# debugging, NFS or TFTPing.                                                  #
#                                                                             #
# This file will be sourced before /env/config to set default values.         #
#                                                                             #
###############################################################################

## barebox and uloader parameters
uloaderimage=microloader-c2kevm.bin
bareboximage=barebox-c2kevm.bin
autoboot_timeout=1

## use 'dhcp' to do dhcp in barebox and in kernel
## use 'none' if you want to skip kernel ip autoconfiguration
ip=none           # TODO: Someone needs to take a look at this configuration
                  #       option as this is perhaps needed for autoconfiguration
                  #       of NAS during bootup

## or set your networking parameters here
#eth0.ipaddr=192.168.1.90
#eth0.netmask=255.255.255.0
#eth0.serverip=192.168.1.99
#eth0.gateway=192.168.2.1
eth0.ethaddr=00:11:22:33:44:55
eth1.ethaddr=00:1A:1B:1C:1D:1E
eth2.ethaddr=00:2A:2B:2C:2D:2E


## set kernel and root file system parameters
kernel_loc=sata           # can be 'nfs', 'tftp', 'nor', 'nand' or 'sata'
kernelimage_type=uimage   # can be 'uimage', 'zimage', 'raw' or 'raw_lzo'
kernelimage=uImage        # kernel image name

rootfs_loc=sata           # can be 'net', 'nor', 'initrd', 'nand' or 'sata'
rootfs_type=ext4          # can be 'jffs2' or 'ubifs'
rootfsimage=root.$rootfs_type-128k  # rootfs image name
#nfsroot="$eth0.serverip:/opt/work/busybox/rootfs_arm"


## NOR setting
#nor_device="comcertoflash.0"
#nor_parts="128k(uloader)ro,512k(barebox)ro,128k(env),4M(kernel),48M(rootfs)"
#rootfs_mtdblock_nor=4


## NAND setting
#nand_device="comcertonand"
#nand_parts="1024k(barebox)ro,1024k(bareboxenv),4M(kernel),-(rootfs)"
#rootfs_mtdblock_nand=8


## USB setting
usb3_internal_clk="yes"


## kernel boot command-line parameters
bootargs="console=ttyS0,115200n8, init=/sbin/init"
bootargs="$bootargs rootfstype=$rootfs_type rw noinitrd"
#bootargs="$bootargs root=/dev/sda1 rootfstype=ext4 rw noinitrd" # this is set in boot
bootargs="$bootargs mac_addr=$eth0.ethaddr"
bootargs="$bootargs model=$model serial=$serial board_test=$board_test btn_status=$btn_status"



## rxicmp settings
rxicmp_startup_env="/env/bin/rxicmp_startup_script"


Barebox-C2K >/

Why there are 3 different MAC addresses? :scratch
matt_max
Donator VIP
Donator VIP
 
Posts: 124
Joined: Fri Apr 03, 2015 9:56 am
Location: Warsaw, Poland

Re: fvdw-sl on WD My Cloud

Postby fvdw » Mon Jun 13, 2022 9:19 pm

thats a lot of info.
this barebox is loaded from flash memory, I would not replace by uboot as you will need a compiled uboot suitable for this motherboard which we don't have.
But I think using barebox to boot fvdw-sl is a possibility. Nevertheless we will need to use the kernel of WD as this is a different cpu than in the seagate personal cloud. Later this week I will have some time to look into in more detail
fvdw
Site Admin - expert
 
Posts: 13230
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron