Help/Advice for Clean Install Debian (from scratch)

Hi,
First I want to say thanks for all the work that was put in.
Right now I am using Syncthing to backup my files, but I encrypt it before as I cant verify that the community version is safe. Same for kernels.
I am trying to install debian on a WDMyCloud 2TB (firmware 2.x).

I found many guides about loading somewhere img or kernels.
Does somebody know how to do it from scratch, like only using scripts and debian.org as the source?
Does WD Mycloud need a custom kernel and not the normal armhf from debian?

Greetings and thanks for all your support

If you haven’t seen the following discussion thread, you should take a read through it. Much discussion on installing alternate OS’s, including Debain, to the single bay My Clouds.

User Fox_Exe has some directions on installing Debain to a second gen single bay My Cloud which may or may not apply to what you seeking to accomplish.

https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/Debian/
Howto_en.txt: https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/Debian/_howto_en.txt
Howto_ru.txt: https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/Debian/_howto_ru.txt

thanks, I saw that thread, but as far as I understand I have to use a custom kernel provided from the fox-exe.ru website. I would rather build from source myself or know if the kernel that the device gets shipped can be used.
I tried to look into it, but didnt now where to start.
I dissasembled the closure, so I have access to the harddrive, I backuped the whole disc just to be sure.
I heard about an eMMc, dont know if this is correct, cant find it via mount /dev/sd (not showing any harddrive other than the 2TB and my USB drive).

tbh, the kernel shipped with it is most likely outdated.

if you dig through fox-exe website there are files related to alpine linux that show how to build from source straight from the linux kernel’s website. You can get more info straight from their website. Mainly the issue is building the kernal/OS specifically for cpu the marvell 783 or whatever it is.

There’s no emmc that i know of. I wish there was. Your data would be better protected and the OS would be faster. The OS lives on a partition of the harddrive – sda1, sda2, sda3 something like that. I’ve messed around a little bit with it but I wouldn’t stray too far out of the guides as you could lose all the data on your drive if you accidentally reformat it or something else.

There is no eMMC at all.
MyCloud Gen1 have 512 bytes of SPI-Flash (Nand), where is stored Bootloader. System - on HDD.
MyCloud Gen2 have 1MB Nand with bootloader, system still in HDD.
MyCloud Mirror and other 2+ disk devices have 256MB Nand flash, where stored bootloader, kernel, recovery and compressed system (rootfs in SquashFS).

Thanks for your help, hope you can guide me through, as I am stuck.
I am searching for the armada370-gcc464_glibc215_hard_armada-GPL.txz file (explained in your _how_to_build_kernel.txt for MyCloud Gen2), didnt find it in WD_MyCloud_GPL_v2.41.116_20201117.tar.gz (the newest GPL). Do you know where exactly it should be found?
Also a custom kernel is used, so debian apt upgrades should not be done on kernel and firmware, right? Next update would be after GPL for OS5 is available, right?

Or do I need a newer kernel or something (for like Debian 10, if this is even possible? (any debian at all would be great)

Also at:
git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell which version should be cloned (just this command or master or a specific version)?
E.g. linux-3.10.70-15t1 (linux kernel 3.x) or master (linux kernel 4.x)?

Also do I put the .config file into linux-marvel/.config?
And if I got the armada370-gcc464_glibc215_hard_armada-GPL.txz, do I put it also into linux-marvel/ or in the directory on top and start the commands: # Build kernel: in linux-marvel?

Ok, I now got through https://github.com/theonedemon/wdmc-gen2-imagebuilder the uImage file, I am now thinking about building https://github.com/Johns-Q/wdmc-gen2 the uRamDisk with clean debian.
Also trying to figure out how to build the debian-rootfs, just found your jessie-rootfs.tar.gz but could not figure out how to build it myself (maybe newer version).

I have now kernel 4.13.5 (like in the docker shown, would like to use a newer one, but dont know if this will work, better if it works at all).