Welcome! Log In Create A New Profile

Advanced

Linux Kernel 4.13.2 MVEBU package and Debian armhf rootfs

Posted by bodhi 
Linux Kernel 4.13.2 MVEBU package and Debian armhf rootfs
January 19, 2017 01:33AM
Linux Kernel 4.13.2 MVEBU package and Debian rootfs for Zyxel NAS326, WD MyCloud EX4100, WD My Cloud Mirror Gen 2, and all other MVEBU Armada NAS in Linux mainline (armada-xp, armada-39x, armada-38x, armada-37x). Also Experimental (still under tested) supports for Marvell Berlin SoCs (Sony NSZ-GS7, BG2-Q DMP, Google Chromecast/Steam Link).

If you try this kernel and rootfs with Marvell MVEBU Armada or Berlin SoC boards please report your finding so it can be added to list of support boxes.


Latest released rootfs: Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2 (23 Aug 2017)
Latest released kernel: linux-4.13.2-mvebu-tld-1 (29 Sept 2017)

Zyxel NAS326 Installation: 3rd Update 25 Mar 2017 (added Section C), 2nd Update 18 Feb 2017 (added section B), 1st Update 05 Feb 2017.


Summary description:

The released tarball linux-x.xx.x-mvebu-tld-x-bodhi.tar.bz2 includes everything you need to build your own kernel from mainline kernel source tree (patches and config file are all that needed). The kernel image is included in it for users who just want to install kernel.

The released tarball Debian-x.xx.x-mvebu-tld-xx-rootfs-bodhi.tar.bz2 is a basic armhf rootfs (a completed Debian system with kernel already installed) for Marvell EBU (MVEBU) boxes ready to be used. It is a basic system where you can build upon by installing packages. This rootfs was created by Debian debootstrap and then a few packages were installed for user’s convenience. This rootfs is dedicated for the purpose of upgrading and release distribution.


Credit:

- Thanks to rr4m, hean01, musv, Kirsch, and others who developed and tested in Zyxel NAS326 - Debian / Boot from USB thread. In this thread, a lot of good works have been done to build a basic kernel for Ubuntu server, Arch, and Gentoo.
- Thanks to saschadd and hmartin who have contributed in testing, and investigation in: Debian on WD MyCloud EX 4100. The installation instruction for this box will be available in the future.
- Thanks to MM and Peacemaker who have developed and tested the mcm-daemon in: WD MyCloud Mirror Gen2 (BWVZ, GrandTeton). I plan to investigate and make use of MM and Peacemaker works, hopefully for all of WD Mycloud boxes.
- Thanks to mcmg2 and hmartin who have contributed in testing and investigation in: WD My Cloud Mirror Gen2 u-boot. The installation instruction for this box will be available in the future.
- Thanks to hmartin who has contributed in developing, testing, and investigation in: Debian on WD MyCloud EX2100. The installation instruction for this box will be available in the future.


========================================================================

Updated 29 Sept 2017:

Kernel linux-4.13.2-mvebu-tld-1 package has been uploaded.

New capabilities in this version:

- [Experimental] Add initial support for Marvell Berlin SoC (Sony NSZ-GS7, BG2-Q DMP, Google Chromecast/Steam Link).
- Add CPU_FREQUENCY governor options (default is PERFORMANCE).
- Add WD EX4100 and EX2100 DTB (use armada-388-wd-ex4100.dtb and armada-385-wd-ex2100.dtb to boot these 2 boxes). I'm looking at hmartin posts and saschadd posts to identify the one that can be used for installation instruction for these 2 boxes.

Latest Linux kernel 4.x general release information can be found at:
LinuxChanges log

Download at Dropbox

linux-4.13.2-mvebu-tld-1-bodhi.tar.bz2

md5sum:
61561f93885858c1a9283dfadb3fc570

sha256sum:
7e787dccaed57cf914c62a35176f9b090e1dce200ba2207a7913a336512b0158

As always, please check the hash of what you download!

Installation:

Please use the same installation instruction in kernel 4.12.4-mvebu-tld-1 (Updated 31 July 2017) below. Simply replace 4.12.4-mvebu-tld-1 with 4.13.2-mvebu-tld-1 in the instruction.

========================================================================

Updated 23 Aug 2017:

This Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2 has been uploaded.

Basic Debian stretch armhf rootfs for most MVEBU Armada NAS:

- tarball size: 229M
- install size: 592M
- The init system used in this rootfs is sysvinit . To boot with systemd, see note 2 below.
- Installed packages: openssh-server, nano, avahi, libnss-mdns, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, locales, dialog, bzip2, nfs-kernel-server, nfs-common, iperf, ethtool, sysvinit-core, sysvinit, and sysvinit-utils, mtd-utils, u-boot-tools, rsync, pmount, i2c-tools, qemu-arm-static.

- see LED controls in /etc/rc.local
- see some useful aliases in /root/.profile
- root password: root

Download at Dropbox:

Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2

md5
deb08f1be54abf1d04ab263d41552453

sha256
1ce340b3db2bfbd0e1d706ed1fda0d4dc8f79830ab5285b1f50299aee25ae2d7

And remember to check the hash of what you download, as always.

Installation:

Installation can be done on any Linux box, with a fresh USB drive (SD card or HDD would work fine too).

Important: all steps below must be done while logging in as root user (not sudo). If you are not the root user then don't continue, because the rootfs will not work.

1. Format a new USB drive with a single Ext3 partition, and label it rootfs.

2. Mount the drive on a Linux box. cd to top level directory and extract the rootfs. Assuming the USB drive is mounted at /media/sdb1
cd /media/sdb1 
tar -xjf Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2
cd /media/sdb1/boot
cp -a zImage-4.12.4-mvebu-tld-1 zImage

3. Adjust fstab (optional)

Edit /media/sdb1/etc/fstab entry for root device, it it is not Ext3.
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
LABEL=rootfs    /               ext3    noatime,errors=remount-ro 0 1

4. Sync, umount, and Done.

sync
sync
umount /media/sdb1

Take this USB rootfs to your NAS and cold start. Depending on the flavor of MVEBU boxes you have, further u-boot envs setup is needed to boot this rootfs. Instruction will be provided here for each MVEBU box, or a group of boxes that use the same u-boot.

After booted into Debian, see Note1, 2, and 3 below. It is very important that you do Note1 steps to secure your box.. Note 2 and Note 3 are optional.


Note1:

After logging in this rootf the first time, remember to generate new SSH key to make it your own unique rootfs. And also update your rootfs to get the latest Debian package security updates:
rm /etc/ssh/ssh_host*
ssh-keygen -A

apt-get update
apt-get upgrade

Note2:

To boot with systemd, add this parameter to your u-boot env bootargs:
init=/bin/systemd
For example,
fw_setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial init=/bin/systemd"'

If that's still not possible to run systemd, you might want to install it again:
apt-get install systemd

Note3:

To enable the network dynamic IP to stay consistent after reboot, and also for faster boot, edit the /etc/network/interfaces file to specify your real MAC address (replace xx:xx:xx:xx:xx:xx with the real MAC address). See this post for explanation.

/etc/network/interfaces
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
	hwaddress ether xx:xx:xx:xx:xx:xx

========================================================================

Updated 31 July 2017:

Kernel linux-4.12.4-mvebu-tld-1 package has been uploaded.

Latest Linux kernel 4.x general release information can be found at:
LinuxChanges log

Download at Dropbox

linux-4.12.4-mvebu-tld-1-bodhi.tar.bz2

md5sum:
eb994a4cabd731a7a5245ee4ae86abd3

sha256sum:
f61425cb1380062179bec68d2db24034e3b2f63100e3c60a1f60fe3b2781e8e6

Installation:

Please use the same installation instruction in kernel 4.10.9-mvebu-tld-1 (Updated 09 April 2017) below. Simply replace 4.10.9-mvebu-tld-1 with 4.12.4-mvebu-tld-1 in the instruction.

Note: Please see this post for the WD My Cloud EX4100 DTB.



========================================================================

Updated 09 April 2017:

Kernel linux-4.10.9-mvebu-tld-1 package has been uploaded.

New in this release:

- Incorporated kernel 4.10.9 mainline to fix security bugs.
- Added patches to help power down the NAS326 box without kernel spitting out an unecessary warning.
- Added patches for WOL capability (we are testing this feature).

Latest Linux kernel 4.x general release information can be found at:
LinuxChanges log

Download at Dropbox

linux-4.10.9-mvebu-tld-1-bodhi.tar.bz2
md5sum:
7751756508e3616d5ed6e16371ecc310
sha256sum:
6a0f9e4033a1f9000cd645be241de791e3ca46148afb6ea81986fcc0defd86fd

There are 6 files in this tarball:

linux-image-4.10.9-mvebu-tld-1_1.0_armhf.deb
linux-headers-4.10.9-mvebu-tld-1_1.0_armhf.deb
zImage-4.10.9-mvebu-tld-1
config-4.10.9-mvebu-tld-1
linux-dtb-4.10.9-mvebu-tld-1.tar
linux-4.10.9-mvebu-tld-1.patch

Installation

1. Backup your current zImage and uInitrd. In the /boot directory, these are files for your current kernel (xx.xx.xx is the version number):
uInitrd 
zImage-xx.xx.xx-mvebu-xxx
initrd.img-xx.xx.xx-mvebu-xxx
System.map-xx.xx.xx-mvebu-xxx
vmlinuz-xx.xx.xx-mvebu-xxx
config-xx.xx.xx-mvebu-xxx
dts/


2. Extract the kernel and the DTB files in the archive:

cd /boot
tar -xjf linux-4.10.9-mvebu-tld-1-bodhi.tar.bz2
tar -xf  linux-dtb-4.10.9-mvebu-tld-1.tar


3. And install it with dpkg. Remove flash-kernel first to avoid potential problem:

cd /boot
apt-get remove flash-kernel 
dpkg -i linux-image-4.10.9-mvebu-tld-1_1.0_armhf.deb


4. Create zImage and uInitrd.

cd /boot
cp -a zImage-4.10.9-mvebu-tld-1 zImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.10.9-mvebu-tld-1 -d initrd.img-4.10.9-mvebu-tld-1 uInitrd

5. The new zImage and uInitrd files should be created in /boot directory now. You're ready to reboot the system:
sync 
sync
sync
shutdown -r now


========================================================================

Zyxel NAS326 Installation

Updated 25 Mar 2017 (added Section C - Installation for SATA rootfs, no serial console)
Updated 18 Feb 2017 (added Section B - Installation for USB rootfs, no serial console)
Updated 05 Feb 2017 (Section A - Installation for USB rootfs, with serial console)


Installation for NAS326 box can be done with serial console connected (section A), or inside stock OS and without serial console (section B for USB rootfs, section C for SATA rootfs).

A. Instruction for the booting the NAS326 with a USB rootfs (serial console setup)

A1. Requirements

1. Serial console connected during set up (which should be removed later during normal operation).

2. Download either the latest ARM32 version or the x86-64 version of kwboot. Use it depending on the architecture of serial console converter host. Please see this post for ARM32 kwboot. (I'll need to recompile the x86-64 version and reupload).

3. Prepare the rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 as described in the Debian rootfs release section (right below):

Quote

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.

A2. Installation

Warning: Step 4 in the instruction in this section uses a "env/code injection" to replace the Zyxel NAS326 stock u-boot bootcmd with a different command during boot. It's a simple trick that change u-boot env bootcmd (it does not touch u-boot binary in NAND). However, this hack should not be used on a different MVEBU box (any box other than the NAS326). Doing this without examining your box's stock u-boot source code could likely messing up your u-boot envs and prevent booting, or in the worse case bricking it. Please post questions regarding installation for other MVEBU boxes, it might be possible to do this.

1. Start kwboot on the serial console host

For ARM32 kwboot:
./kwboot -t -B 115200 /dev/ttyUSB0 -d

For x86-64 kwboot:
./kwboot -t -B 115200 /dev/ttyUSB0


2. Power up the NAS326, and wait at serial console, observe kwboot spinning / while waiting for handshake.

3. After a period of time, the NAS326 will time out and start booting its stock u-boot. Interrupt u-boot at countdown. Get a listing of your current u-boot envs, and save it to a notepad in case you want to restore it later.

printenv


4. Enter the following commands (copy/paste each line to the u-boot prompt).

setenv curr_bootfrom 1
setenv next_bootfrom 1
setenv load_dtb_addr 0x1000000
setenv load_initrd_addr 0x2900000
setenv load_image_addr 0x02000000
setenv usb_init 'mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start'
setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'
setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
setenv usb_bootcmd 'echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'
setenv bootcmd_custom 'if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '
saveenv


5. Reset the NAS326, exit kwboot.

reset
And then press "Control \ c" to exit kwboot

6. Start kwboot again on the serial console host (use the same command as in step 1)

7. After a period of time, the NAS326 will time out and start booting its stock u-boot. Observe kernel loading and booting until seeing the Debian prompt. At this point we can either login directly with serial console, or by SHH. If login is through SSH, find the NAS:

ping debian.local

When the ping returns successful response, then login (root password is root);
ssh root@debian.local


If for whatever reason (e.g. firewall), the NAS326 cannot be found as debian.local, then find its IP in the router webpage. Or use a scanning app such as Linux nmap or IOS Fing to find the IP.

8. DONE.


A3. Normal Operation

The USB rootfs should be plugged in permanently, and the serial console module should be removed.

1. Whenever the NAS326 is rebooted or cold started, to boot without manual intervention, the serial console module must be unplugged from the NAS326. If the serial console module is plugged in, then step 1 in the installation instruction A2 must be executed (so that the NAS326 will continue booting when it detected the serial console present).

2. If you want to boot back to stock OS in NAND, just shutdown the box, unplug the USB and power up the box. It will boot the kernel 1 in NAND and then if not successful, it will try kernel 2.

This also serves as a rescue system. Whenever the rootfs on USB has problem and cannot boot (the effect is just like the USB drive is not plugged in), the NAS326 will fall back to booting the kernel 1 or 2 in NAND. When this occurs, the u-boot envs in step 4 must be reentered at serial console again to allow booting back to USB rootfs.


A4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at serial console:

setenv kernel_addr_1 0x00E00000
setenv bootargs 'console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2'
saveenv
boot


B. Instruction for booting the NAS326 with a USB rootfs (setup without serial console)

B1. Requirements

1. Prepare the rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 as described in the Debian rootfs release section (right below):

Quote

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.

B2. Installation

Warning: Step 4 in the instruction in this section uses a "env/code injection" to replace the Zyxel NAS326 stock u-boot bootcmd with a different command during boot. It's a simple trick that change u-boot env bootcmd (it does not touch u-boot binary in NAND). However, this hack should not be used on a different MVEBU box (any box other than the NAS326). Doing this without examining your box's stock u-boot source code could likely messing up your u-boot envs and prevent booting, or in the worse case bricking it. Please post questions regarding installation for other MVEBU boxes, it might be possible to do this.

1. Gain SSH to the NAS326 box.

Use the Zyxel NAS326 instruction (came with the box) for logging as admin user through the web page of the box, set password, and Enable SSH.

2. Open a termimal and connect to the NAS326 with SSH, and login to the box as root user.

3. After logging in, get a listing of your current u-boot envs, and save it to a notepad in case you want to restore it later.

fw_printenv


4. Enter the following commands (copy/paste each line to the stock OS command line).

fw_setenv curr_bootfrom 1
fw_setenv next_bootfrom 1
fw_setenv load_dtb_addr 0x1000000
fw_setenv load_initrd_addr 0x2900000
fw_setenv load_image_addr 0x02000000
fw_setenv usb_init 'mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start'
fw_setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
fw_setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
fw_setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'
fw_setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
fw_setenv usb_bootcmd 'echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'
fw_setenv bootcmd_custom 'if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
fw_setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '
fw_setenv change_boot_part 1

And then list the u-boot envs again, and save it to a notepad in case there is problem with booting and it needs to be referenced.
fw_printenv


5. Plug in the USB rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2, and reboot

sync
sync
/sbin/reboot

7. After a period of time, the NAS326 will start rebooting. Wait for about 30 seconds and login through SSH.

To find the NAS:
ping debian.local

When the ping returns successful response, then login (root password is root);
ssh root@debian.local

If for whatever reason (e.g. firewall), the NAS326 cannot be found as debian.local, then find its IP in the router webpage. Or use a scanning app such as Linux nmap or IOS Fing to find the IP.

8. DONE.


B3. Normal Operation

The USB rootfs should be plugged in permanently, and if there is serial console module attached before then it should be removed during booting.

1. Whenever the NAS326 is rebooted or cold started, to boot without manual intervention, the serial console module must be unplugged from the NAS326. If the serial console module is plugged in, then step 1 in the Section A2 installation instruction must be executed (so that the NAS326 will continue booting when it detected the serial console present).

2. If you want to boot back to stock OS in NAND, just shutdown the box, unplug the USB and power up the box. It will boot the kernel 1 in NAND and then if not successful, it will try kernel 2.

This also serves as a rescue system. Whenever the rootfs on USB has problem and cannot boot (the effect is just like the USB drive is not plugged in), the NAS326 will fall back to booting the kernel 1 or 2 in NAND. When this occurs, the u-boot envs in step 4 must be reentered at Debian command line again to allow booting back to USB rootfs.

B4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at the Debian command line:

fw_setenv kernel_addr_1 0x00E00000
fw_setenv bootargs 'console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2'
and then reboot
sync
shutdown -r now

C. Instruction for booting the NAS326 with rootfs on internal HDD (setup without serial console)

C1. Requirements

1. Prepare the rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2, using one of the internal HDD, as described in the Debian rootfs release section (right below):

Quote

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.

C2. Installation

Warning: Step 4 in the instruction in this section uses a "env/code injection" to replace the Zyxel NAS326 stock u-boot bootcmd with a different command during boot. It's a simple trick that change u-boot env bootcmd (it does not touch u-boot binary in NAND). However, this hack should not be used on a different MVEBU box (any box other than the NAS326). Doing this without examining your box's stock u-boot source code could likely messing up your u-boot envs and prevent booting, or in the worse case bricking it. Please post questions regarding installation for other MVEBU boxes, it might be possible to do this.

1. Gain SSH to the NAS326 box.

Use the Zyxel NAS326 instruction (came with the box) for logging as admin user through the web page of the box, set password, and Enable SSH.

2. Open a termimal and connect to the NAS326 with SSH, and login to the box as root user.

3. After logging in, get a listing of your current u-boot envs, and save it to a notepad in case you want to restore it later.

fw_printenv


4. Enter the following commands (copy/paste each line to the stock OS command line).

setenv curr_bootfrom 1
setenv next_bootfrom 1
setenv load_dtb_addr 0x1000000
setenv load_initrd_addr 0x2900000
setenv load_image_addr 0x02000000
setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'

setenv sata_init 'mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init'
setenv sata_bootcmd 'echo Booting from SATA ...; setenv fdt_skip_update yes; run sata_init; ext2load scsi 0:1 $load_image_addr /boot/zImage; ext2load scsi 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load scsi 0:1 $load_initrd_addr /boot/uInitrd; run sata_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'
setenv sata_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
setenv bootcmd_custom_sata 'if run sata_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
setenv bootcmd_custom 'run bootcmd_custom_sata'
setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '
saveenv

And then list the u-boot envs again, and save it to a notepad in case there is problem with booting and it needs to be referenced.
fw_printenv


5. Insert the HDD with rootfs Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2, if not already inside the box, and reboot

sync
sync
/sbin/reboot

7. After a period of time, the NAS326 will start rebooting. Wait for about 30 seconds and login through SSH.

To find the NAS:
ping debian.local

When the ping returns successful response, then login (root password is root);
ssh root@debian.local

If for whatever reason (e.g. firewall), the NAS326 cannot be found as debian.local, then find its IP in the router webpage. Or use a scanning app such as Linux nmap or IOS Fing to find the IP.

8. DONE.


C3. Normal Operation

The HDD rootfs should be plugged in permanently, and if there is serial console module attached before then it should be removed during booting.

1. Whenever the NAS326 is rebooted or cold started, to boot without manual intervention, the serial console module must be unplugged from the NAS326. If the serial console module is plugged in, then step 1 in the Section A2 installation instruction must be executed (so that the NAS326 will continue booting when it detected the serial console present).

2. If you want to boot back to stock OS in NAND, just shutdown the box, remove the HDD rootfs and power up the box. It will boot the kernel 1 in NAND and then if not successful, it will try kernel 2.

This also serves as a rescue system. Whenever the rootfs on HDD has problem and cannot boot (the effect is just like the HDD drive is not plugged in), the NAS326 will fall back to booting the kernel 1 or 2 in NAND. When this occurs, the u-boot envs in step 4 must be reentered at Debian command line again to allow booting back to HDD rootfs.

C4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at the Debian command line:

fw_setenv kernel_addr_1 0x00E00000
fw_setenv bootargs 'console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2'
and then reboot
sync
shutdown -r now


=====================================================================================

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.


Basic Debian jessie armhf rootfs for most MVEBU Armada NAS:

- tarball size: 160M
- install size: 554M
- The init system used in this rootfs is sysvinit . To boot with systemd, see note 2 below.
- Installed packages: openssh-server, nano, avahi, libnss-mdns, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, locales, dialog, bzip2, nfs-kernel-server, nfs-common, iperf, ethtool, sysvinit-core, sysvinit, and sysvinit-utils, mtd-utils, u-boot-tools, rsync, pmount, i2c-tools, qemu-arm-static.

- see LED controls in /etc/rc.local
- see some useful aliases in /root/.profile
- root password: root

Download at Dropbox:

Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2
md5:
dac69fb0c46d056ff96500f730e9d3d1
sha256:
0b9086dbb641c583eb1e10b7fd8d157abd4f1a1c5f7e772a6dffb75947620b20

And remember to check the hash of what you download, as always.


Installation:

Installation can be done on any Linux box, with a fresh USB drive (SD card or HDD would work fine too).

Important: all steps below must be done while logging in as root user (not sudo). If you are not the root user then don't continue, because the rootfs will not work.

1. Format a new USB drive with a single Ext3 partition, and label it rootfs.

2. Mount the drive on a Linux box. cd to top level directory and extract the rootfs. Assuming the USB drive is mounted at /media/sdb1
cd /media/sdb1 
tar -xjf Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2
cd /media/sdb1/boot
cp -a zImage-4.9.0-mvebu-tld-12 zImage

3. Adjust fstab.

Edit /media/sdb1/etc/fstab entry for /dev/root.
/dev/root      /               ext3    noatime,errors=remount-ro 0 1

4. Sync, umount, and Done.

sync
sync
umount /media/sdb1


Take this USB rootfs to your NAS and cold start. Depending on the flavor of MVEBU boxes you have, further u-boot envs setup is needed to boot this rootfs. Instruction will be provided here for each MVEBU box, or a group of boxes that use the same u-boot.

After booted into Debian, see Note1 and Note2 below. It is very important that you do Note1 steps to secure your box.


Note1:

After logging in this rootf the first time, remember to generate new SSH key to make it your own unique rootfs. And also update your rootfs to get the latest Debian package security updates:
rm /etc/ssh/ssh_host*
ssh-keygen -A

apt-get update
apt-get upgrade

Note2:

To boot with systemd, add this parameter to your u-boot env bootargs:
init=/bin/systemd
For example,
fw_setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial init=/bin/systemd"'

If that's still not possible to run systemd, you might want to install it again:
apt-get install systemd

=====================================================================================

Updated 03 Feb 2017:

Kernel linux-4.9.0-mvebu-tld-12 package has been uploaded. This kernel has been fully developed with all the capabilities similar to the Kirkwook kernel.

Notables:

- This kernel is configured as SMP PREEMPT (supports up to 4 cores and run with preemptive scheduler).
- Power Off works fine, but will print out a warning in console (which can be safely ignored).
- For fan speed and CPU temperature reading see this post.
- SPI is temporarily removed until we can find out more info.


Latest Linux kernel 4.x general release information can be found at:
LinuxChanges log

Download at Dropbox

linux-4.9.0-mvebu-tld-12-bodhi.tar.bz2

md5:
3e4eba2fa0382304adca9f23c0a21000
sha256:
734f4149407a999120f48f2d11d72b0b0a6ab48d26f568001c19e386dd2e191b


There are 6 files in this tarball:
linux-image-4.9.0-mvebu-tld-12_12.0_armhf.deb
linux-headers-4.9.0-mvebu-tld-12_12.0_armhf.deb
zImage-4.9.0-mvebu-tld-12
config-4.9.0-mvebu-tld-12
linux-dtb-4.9.0-mvebu-tld-12.tar
linux-4.9.0-mvebu-tld-12.patch


Installation


1. Backup your current kernel files. In the /boot directory, these are files for your current kernel (xx.xx.xx is the version number):
uInitrd 
uImage
zImage-xx.xx-mvebu-xxx
initrd.img-xx.xx.xx-mvebu-xxx
System.map-xx.xx.xx-mvebu-xxx
vmlinuz-xx.xx.xx-mvebu-xxx
config-xx.xx.xx-mvebu-xxx
dts/


2. Extract the kernel and the DTB files in the archive:

cd /boot
tar -xjf linux-4.9.0-mvebu-tld-12-bodhi.tar.bz2
tar -xf  linux-dtb-4.9.0-mvebu-tld-12.tar


3. And install it with dpkg. Remove flash-kernel first to avoid potential problem.

cd /boot
apt-get remove flash-kernel 
dpkg -i linux-image-4.9.0-mvebu-tld-12_12.0_armhf.deb


4. Create uInitrd and zImage

cd /boot
cp -a zImage-4.9.0-mvebu-tld-12 zImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.9.0-mvebu-tld-12 -d initrd.img-4.9.0-mvebu-tld-12 uInitrd


5. You're ready to reboot the system:
sync 
sync
sync
shutdown -r now



============== Below are old posts, kept for posterity ================================

Updated 23 Jan 2017:

This Debian-4.9.0-mvebu-tld-9-rootfs-bodhi.tar.bz2 is my first release for the Marvell MVEBU boxes.

Basic minimal Debian armhf rootfs for most MVEBU NAS:

- tarball size: 133M
- install size: 481M
- a basic jessie armhf rootfs.
- The init system used in this rootfs is sysvinit . To boot with systemd, see note 2 below.
- Installed packages: openssh-server, nano, avahi, libnss-mdns, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, locales, dialog, bzip2, nfs-kernel-server, nfs-common, iperf, ethtool, sysvinit-core, sysvinit, and sysvinit-utils, mtd-utils, u-boot-tools, rsync, pmount, i2c-tools, qemu-arm-static.

- see LED controls in /etc/rc.local
- see some useful aliases in /root/.profile
- root password: root

Download at Dropbox:

Debian-4.9.0-mvebu-tld-9-rootfs-bodhi.tar.bz2
md5:
ecd4e7d384eea920d2def9aed95c9d48
sha256:
7f2ce42ca7fa1807fb0db2bc5946c91a19876739520ce8e2bd33bdb09cdbdf26

And remember to check the hash of what you download, as always.

Installation:

Installation can be done on any Linux box, with a fresh USB drive (SD card or HDD would work fine too).

Important: all steps below must be done while logging in as root user (not sudo). If you are not the root user then don't continue, because the rootfs will not work.

1. Format a new USB drive with a single Ext3 partition, and label it rootfs.

2. Mount the drive on a Linux box. cd to top level directory and extract the rootfs. It is assuming the USB drive is mounted at /media/sdb1
cd /media/sdb1 
tar -xjf Debian-4.9.0-mvebu-tld-9-rootfs-bodhi.tar.bz2
cd ./boot
cp -a zImage-4.9.0-mvebu-tld-9 zImage

3. Adjust fstab.

Edit /media/sdb1/etc/fstab entry for /dev/root.
/dev/root      /               ext3    noatime,errors=remount-ro 0 1

4. Sync, umount, and Done.

sync
sync
umount /media/sdb1


Take this USB rootfs to your NAS and cold start. Depending on the flavor of MVEBU boxes you have, further u-boot envs setup is needed to boot this rootfs. Instruction will be provided here for each box, or a group of boxes that use the same u-boot.

After booted into Debian, see Note1 and Note2 below. It is very important that you do Note1 steps to secure your box.


Note1:

After logging in this rootf the first time, remember to generate new SSH key to make it your own unique rootfs. And also update your rootfs to get the latest Debian package security updates:
rm /etc/ssh/ssh_host*
ssh-keygen -A

apt-get update
apt-get upgrade

Note2:

To boot with systemd, add this parameter to your u-boot env bootargs:
init=/bin/systemd
For example,
fw_setenv usb_set_bootargs 'setenv bootargs console=$console root=LABEL=rootfs rootdelay=10 $mtdparts init=/bin/systemd'

If that's still not possible to run systemd, you might want to install it again:
apt-get install systemd


=====================================================================================
Updated 22 Jan 2017:

Please use the latest Zyxel NAS326 DTB in this post:

http://forum.doozan.com/read.php?2,27108,32224#msg-32224

=====================================================================================
Updated 21 Jan 2017:

Kernel linux-4.9.0-mvebu-tld-8 package has been uploaded.

- This kernel is configured as SMP PREEMPT (supports up to 4 cores and run with preemptive scheduler).
- All LEDS triggers should be working correctly in this version (see /sys/class/leds).
- Kernel ring buffer (dmesg) size increased enough to capture all boot activities.
- Power Off works fine, but will print out a warning in console (which can be safely ignored).
- For fan speed and CPU temperature reading see this post.
- SPI is temporarily removed until we can find out more info.

Latest Linux kernel 4.x general release information can be found at:
LinuxChanges log

Download at Dropbox

linux-4.9.0-mvebu-tld-8-bodhi.tar.bz2

md5:
1778c7902abcd1c6a91bcde3ea85c14b
sha256
e957e08c878e7e6254c643cec9fe9488d2b5995aaab437addece92de67a92f07

There are 6 files in this tarball:
linux-image-4.9.0-mvebu-tld-8_8.0_armhf.deb
linux-headers-4.9.0-mvebu-tld-8_8.0_armhf.deb
zImage-4.9.0-mvebu-tld-8
config-4.9.0-mvebu-tld-8
linux-dtb-4.9.0-mvebu-tld-8.tar
linux-4.9.0-mvebu-tld-8.patch

Installation

TBD...


=====================================================================================
Updated 18 Jan 2017:

Kernel linux-4.9.0-mvebu-tld-7 package has been uploaded.

Latest Linux kernel 4.x general release information can be found at:
LinuxChanges log

Download at Dropbox
linux-4.9.0-mvebu-tld-7-bodhi.tar.bz2

md5:
6ce453788634af51d5fd684334b9fe2e
sha256:
f9d29ab8bfe5933cdebc22a136b828968cf64c51c68ab278a920858c9db63be9

There are 5 files in this tarball:

linux-image-4.9.0-mvebu-tld-7_7.0_armhf.deb
linux-headers-4.9.0-mvebu-tld-7_7.0_armhf.deb
config-4.9.0-mvebu-tld-7
zImage-4.9.0-mvebu-tld-7
linux-dtb-4.9.0-mvebu-tld-7.tar

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 72 time(s). Last edit at 10/01/2017 09:46PM by bodhi.
Re: Linux Kernel 4.9.0 MVEBU package and Debian rootfs
January 19, 2017 01:34AM
Re: Linux Kernel 4.9.0 MVEBU package and Debian rootfs
January 19, 2017 01:45AM
Re: Linux Kernel 4.9.0 MVEBU package and Debian rootfs
February 05, 2017 03:37PM
The new rootfs and kernel package have been uploaded. Please see 1st post for download link and installation procedure.

Quote

Zyxel NAS326 Installation
Updated 05 Feb 2017


Quote

Updated 04 Feb 2017:

This Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 has been uploaded.

Quote

Updated 03 Feb 2017:

Kernel linux-4.9.0-mvebu-tld-12 package has been uploaded.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 02/06/2017 01:47AM by bodhi.
Re: Linux Kernel 4.9.0 MVEBU package and Debian rootfs
February 18, 2017 04:05AM
Instruction for Zyxel NAS326 Installation has been updated: added section B (setup without serial console).

Quote

Zyxel NAS326 Installation

Updated 18 Feb 2017 (added Section B)
Updated 05 Feb 2017

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linux Kernel 4.9.0 MVEBU package and Debian rootfs
April 09, 2017 02:52PM
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 11, 2017 01:27AM
Hi bodhi,

am i right that this kernel and rootfs could fit my WD MyCloud EX 4100 as it has an Marvell Armada 380/381/382/385/388 (Device Tree).

cat /proc/version gives me the folliwing information

Linux version 3.10.39 (kman@kmachine) (gcc version 4.6.4 (Linaro GCC branch-4.6.4. Marvell GCC Dev 201310-2126.3d181f66 64K MAXPAGESIZE ALIGN) ) #2 SMP Fri Aug 12 15:59:39 CST 2016 2014T30p5 Build-git9e099f3

and cat /proc/cpuinfo gives me the following information

processor       : 0
model name      : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 3188.32
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        : 3188.32
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

There is already someone who attempted to create a debian port for this device on this thread https://community.wd.com/t/clean-os-debian-openmediavault-and-other-firmwares/93714/1290

From this guy there are already files available there https://drive.google.com/drive/folders/0B_6OlQ_H0PxVVGdTRGl0RmRabVU

but unfortunately there are instructions missing and i am not able to figure out how to use those files securely without problems.

I would like to have this device booting the rootfs from an usb pen drive without touching the original firmware if possible but i am not fit enough to figure out what information is needed and how to get them.
Maybe you could point me in the right direction or let me know what information you need to verify that this device would work with your kernel and rootfs.
Unfortunately the original firmware has only a limited busybox available via ssh but i can sftp to the box for further investigation if needed.

-
happy hacking,

saschadd
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 11, 2017 02:59AM
saschadd,

> Hi bodhi,
>
> am i right that this kernel and rootfs could fit m
> y WD MyCloud EX 4100 as it has an Marvell Armada 3
> 80/381/382/385/388 (Device Tree).
>
> cat /proc/version gives me the folliwing informati
> on
>
>
> Linux version 3.10.39 (kman@kmachine) (gcc version
> 4.6.4 (Linaro GCC branch-4.6.4. Marvell GCC Dev 20
> 1310-2126.3d181f66 64K MAXPAGESIZE ALIGN) ) #2 SMP
> Fri Aug 12 15:59:39 CST 2016 2014T30p5 Build-git9e
> 099f3
>
>
> and cat /proc/cpuinfo gives me the following infor
> mation
>
>
> processor       : 0
> model name      : ARMv7 Processor rev 1 (v7l)
> BogoMIPS        : 3188.32
> 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        : 3188.32
> 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/3
> 88 (Device Tree)
> Revision        : 0000
> Serial          : 0000000000000000
>
>
> There is already someone who attempted to create a
> debian port for this device on this thread https:/
> /community.wd.com/t/clean-os-debian-openmediavault
> -and-other-firmwares/93714/1290
>
> From this guy there are already files available th
> ere https://drive.google.com/drive/folders/0B_6OlQ
> _H0PxVVGdTRGl0RmRabVU
>
> but unfortunately there are instructions missing a
> nd i am not able to figure out how to use those fi
> les securely without problems.
>
> I would like to have this device booting the rootf
> s from an usb pen drive without touching the origi
> nal firmware if possible but i am not fit enough t
> o figure out what information is needed and how to
> get them.
> Maybe you could point me in the right direction or
> let me know what information you need to verify th
> at this device would work with your kernel and roo
> tfs.
> Unfortunately the original firmware has only a lim
> ited busybox available via ssh but i can sftp to t
> he box for further investigation if needed.

Yes, most definitely will boot with my released basic rootfs (I looked at this box specs before). You just need to choose the correct DTB in /boot/dts/. And then adjust the env for dtb in serial console. Test boot that adjustment without saving envs. Once you have booted into Debian and verified everything works, then save the env with fw_setenv.

If you cant find the exact DTB for EX4100 in /boot/dts, please list more info about this WD such as : USBs, HDDs, ethenet LAN chip model, I2C, SPI, RAM size, boot log, ... we can figure this out together.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 11, 2017 05:43AM
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 11, 2017 06:33AM
bodhi,

sounds good so far.

Could you "read" from the DTS if this box can be bootet from usb?
At the moment i have no serial console access to this box and havent yet figured out if and where there is a serial connector.
To switch the boot mode serial console access is needed, right?
Or could i change env data without serial console access?
I know about there was a way for the nsa325v2 where you have to put some files on a pen drive and boot from that to switch env settings.

-
happy hacking,

saschadd
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 11, 2017 09:33AM
saschadd,

This is a new box so you need serial console, to be safe. We dont know what commands this stock uboot supports. So it is unwise to change any of the envs in Linux to boot usb. Serial console is a must have.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 05/11/2017 09:51AM by bodhi.
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 13, 2017 11:31PM
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 15, 2017 06:39AM
saschadd,

Please start a new tthread:

Debian on WD MyCloud EX 4100

And repost the starting content such as in your post:
http://forum.doozan.com/read.php?2,32146,34046#msg-34046

(I never have much luck with this forum thread split function so I might mess it up again :).

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 05/15/2017 06:42AM by bodhi.
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
May 15, 2017 07:37AM
Done!
See here http://forum.doozan.com/read.php?2,34103

bodhi Wrote:
-------------------------------------------------------
> saschadd,
>
> Please start a new tthread:
>
> Debian on WD MyCloud EX 4100
>
> And repost the starting content such as in your po
> st:
> http://forum.doozan.com/read.php?2,32146,34046#msg
> -34046
>
> (I never have much luck with this forum thread spl
> it function so I might mess it up again :).
Hello.

I try to install the debian to usb. And after the reboot my NAS not boot. USB sometimes blinking but i can't access to my NAS. When I remove the usb and reboot it starts with orginal OS. I don't have TTL interface to look at the bootlog. I created the ext3 partition labeled "rootfs" on the usb and extracted the image Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2. So i have question. I connect USB to the front panel port it is good?
OK. It's working. But why interface only working on 1 Gbit? When i connect the device to the 100 Mbps port it not connected. And another question what i need to compile new kernel?
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
June 03, 2017 01:29PM
Dzanar,

> OK. It's working

Cool!

> But why interface only working o
> n 1 Gbit? When i connect the device to the 100 Mbp
> s port it not connected. And another question what
> i need to compile new kernel?

Please post a new Debian topic for problem like this.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 29, 2017 04:08PM
The Zyxel NAS326 went on sale this past week. The price cut was good enough that I'm guessing this forum will see more activity soon. I've landed here in my own search for better control of the device I just bought.

I read quite a bit of both threads and getting this working was quite the journey!

Also, OpenMediaVault has become popular. It has a web interface much like the one in stock Zyxel firmware. Since bodhi's MVEBU kernal comes with Debian, is it possible to install this and then just install the OpenMediaVault packages?

Thanks!
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 29, 2017 04:50PM
Hi nastynas,

> The Zyxel NAS326 went on sale this past week. The
> price cut was good enough that I'm guessing this f
> orum will see more activity soon.

Good news! Where is this on sale?

I have not kept up for this box, because I did not see a lot of interests. It still costs way more than the older plugs.

> Also, OpenMediaVault has become popular. It has a
> web interface much like the one in stock Zyxel fir
> mware. Since bodhi's MVEBU kernal comes with Debia
> n, is it possible to install this and then just in
> stall the OpenMediaVault packages?

Yes. That's what a lot of people do. Once you run the latest kernel in Debian, it is easy to run OMV.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 07/29/2017 04:52PM by bodhi.
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 29, 2017 05:45PM
HI Bodhi, thanks for the answer!

NAS326 is on sale at Amazon for $80.

Good news about OMV! I'm going to give it a shot.
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 29, 2017 08:44PM
Just gave it a try. I'm not sure if it's my USB flash drive, or the hardware issues I'm having my Ubuntu laptop.. But I don't trust either one of them now, so I have a couple more USB drives on order from Amazon... One to create a Live USB on my Windows desktop, which I'll then use to prepare the 4.10.9 MVEBU package on the other.

Fortunately for your env trick, I can just take the stick out and boot back into Zyxel NAND. But the problem I'm having is that the firmware is reset every time it reboots. I have to create a new password and enable SSH every time. Also, all my users and settings disappear every time. Until I get the new USB drives, is there a way to stop it from resetting the firmware every time? It also now sometimes crashes on boot (all lights on the front panel go out).

Edit: NAS326 firmware is 5.21 on this one.



Edited 2 time(s). Last edit at 07/29/2017 09:05PM by nastynas.
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 29, 2017 09:00PM
nastynas,

Thanks about the sales info!

> Fortunately for your env trick, I can just take th
> e stick out and boot back into Zyxel NAND. But the
> problem I'm having is that the firmware is reset e
> very time it reboots. I have to create a new passw
> ord and enable SSH every time. Also, all my users
> and settings disappear every time. Until I get the
> new USB drives, is there a way to stop it from res
> etting the firmware every time?

Let me take a look at the envs. It might be that there is one more env needed to be set to get back totally on stock behavior. The current setup is mainly so that it stock NAND can be used as rescue system, so it is just "working well enough" to do that.

Since we can't boot with kwboot yet, I'm extra careful about changing it. I have to test it thoroughly before modifying the instruction.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 30, 2017 05:13AM
nastynas,

Please boot up without USB, interrupt serial console and

printenv
boot

And post the entire serial console log here.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 30, 2017 12:38PM
I don't have a serial cable, so I used your B1.Installation method onwards.

The firmware reset itself overnight again, so I had to enable SSH again, and here is the output of printenv:

SSH_CLIENT=192.168.0.124 50688 22
MAIL=/var/mail/root
USER=root
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/lib/private
HOME=/root
SSH_TTY=/dev/pts/0
LOGNAME=root
TERM=xterm-256color
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/firmware/sbin:/usr/local/zy-pkgs/bin:/firmware/htp
SHELL=/bin/sh
PWD=/root
SSH_CONNECTION=192.168.0.124 50688 192.168.0.100 22

As part of your instruction set in the B section, you recommended printenv after making changes. I did that and saved to notepad as follows:

CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
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 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
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=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=df7b308098b062aa540cc501199a78f6
core_checksum_2=2773b03df8b32c243f8b84dcefa79efb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=60:31:97:C4:A6:0B
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.11(AAZF.4)
fwversion_2=V5.21(AAZF.1)
ide_path=/
image_name=uImage
img_checksum_1=dd71a9007667c985e235988ffdbeee57
img_checksum_2=5356a1c083dfd6bc8c74bfd231aa15a6
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=49970
revision_2=50984
romfile_checksum_1=BBFF
romfile_checksum_2=A762
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S160Y38014026
serverip=10.4.50.38
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
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=260fc23f51fa9ecf008291a56046b7ef
zld_checksum_2=102d2dc16f397df0dddc4f1ad6380e52
curr_bootfrom=1
next_bootfrom=1
load_dtb_addr=0x1000000
load_initrd_addr=0x2900000
load_image_addr=0x02000000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom; 
change_boot_part=1
Re: Linux Kernel 4.10.9 MVEBU package and Debian armhf rootfs
July 30, 2017 03:56PM
nastynas,

To run stock OS permanently:

Quote

C4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at the Debian command line:

Later, when you want to run Debian just set it up again using section B.

Note that section C4 can be done in stock OS, too.

- Check your u-boot envs is working the same way:

fw_printenv

Does it look the same as before?

- If the output looks good, proceed to do section C4.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 07/30/2017 04:00PM by bodhi.
Re: Linux Kernel 4.12.4 MVEBU package and Debian armhf rootfs
July 31, 2017 01:36AM
Re: Linux Kernel 4.12.4 MVEBU package and Debian armhf rootfs
July 31, 2017 04:41AM
bodhi Wrote:
-------------------------------------------------------
> Kernel linux-4.12.4-mvebu-tld-1 package has been u
> ploaded. Please see 1st post for download link.

Attached here is the DTB for WD My Cloud EX4100, which I forgot to include in the new kernel linux-4.12.4-mvebu-tld-1 package.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Attachments:
open | download - armada-388-wd-ex4100.dtb (14.9 KB)
Re: Linux Kernel 4.12.4 MVEBU package and Debian armhf rootfs
July 31, 2017 04:50AM
@saschadd,

What is the EX4100 fan behavior in u-boot? does it spin at nomal speed?

And how about inside stock OS? does it spin slower, and is there a fan control tool that you can run in the Web interface or at command line?

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linux Kernel 4.12.4 MVEBU package and Debian armhf rootfs
August 06, 2017 01:05AM
Hi bodhi,

the hashs for linux-4.12.4-mvebu-tld-1-bodhi.tar.bz2 do not match.
Can you check it, please.

Thx

Otto
Re: Linux Kernel 4.12.4 MVEBU package and Debian armhf rootfs
August 06, 2017 01:24AM
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: