# Prepare all needed software: apt update apt upgrade apt install build-essential u-boot-tools libncurses5-dev git # Note: For build kernel on regular PC - install cross-tools (for build kernel on device itself its not needed): apt install gcc-5-cross-base # Download latest Linux kernel sources (Stable branch for example): git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-stable # Downoad kernel config wget http://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/kernel.config -o linux-stable/.config # Download DTS file for your device: # WD MyCloud Mirror Gen1 wget http://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/armada-370-wdmc-mirror-gen1.dts -o linux-stable/arch/arm/boot/dts/ # WD MyCloud Mirror Gen2 wget http://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/armada-385-wdmc-mirror-gen2.dts -o linux-stable/arch/arm/boot/dts/ # WD MyCloud Gen2 (One disk, FW v2.xx) wgethttp://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/armada-375-wdmc-gen2.dts -o linux-stable/arch/arm/boot/dts/ # WD MyCloud Ex2 Ultra wgethttp://fox-exe.ru/WDMyCloud/Other/Official_linux_kernel/armada-385-wdmc-Ex2-Ultra.dts -o linux-stable/arch/arm/boot/dts/ # Lets start! # Note: Do not set ARCH and CROSS_COMPILE vars if you build kernel on device itself. # Note: Replace DTS_FILE to your device config (dts name w/o extension) # Note: $DIR_RESULT - output path, where stored result (modules and kernel) # Note: Replace "-j 4" to you processos core's count or remove for auto-detect. export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabi- export DIR_RESULT=../output export DTS_FILE=armada-375-wdmc-gen2 mkdir -p $DIR_RESULT cd linux-stable # Check config for new/outdated/removed entries: make -j 4 oldconfig # Make changes in config via GUI, if you want yo add/remove something: make -j 4 menuconfig # Build kernel, modules and all other dependencies: make -j 4 zImage make -j 4 $DTS_FILE.dtb make -j 4 modules make -j 4 INSTALL_MOD_PATH=$DIR_RESULT modules_install cat arch/arm/boot/zImage arch/arm/boot/dts/$DTS_FILE.dtb > zImage_and_dtb mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n $DTS_FILE -d zImage_and_dtb $DIR_RESULT/uImage rm zImage_and_dtb # Done! See result in $DIR_RESULT folder ("Output" by default)