Welcome! Log In Create A New Profile

Advanced

Mirabox (Armada 370) Installation

Posted by bodhi 
Mirabox (Armada 370) Installation
November 06, 2019 11:47PM
This Mirabox uses a special kernel version: linux-4.20.6-mvebu-mirabox-tld-12. Other MVEBU kernel will not work with this box.

Download new kernel at Dropbox


linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2

md5sum
8cf3d08dee09d000cf8b50b2df2f4047
sha256sum
fc4eb7a66e2af7f17f31041581fa6d106ba3da22ec643ab80a24aa352084f201

This tarball contains 6 files:

Quote

linux-image-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
linux-headers-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb
zImage-4.20.6-mvebu-mirabox-tld-12
config-4.20.6-mvebu-mirabox-tld-12
linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar
linux-4.20.6-mvebu-tld-1.patch


Installation


I. Install with Serial console

A. Prepare rootfs on SD card

1. Download rootfs Debian-4.12.4-mvebu-tld-1-rootfs-bodhi.tar.bz2 from the release thread and extract rootfs to an SD card (at least 4GB). See the release thread for instruction how to create rootfs.

2. Copy the download Mirabox kernel tarball linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2 to rootfs

Mount the rootfs. Assuming the rootfs is mounted at /media/sdd1. Extract kernel files

mkdir -p /media/sdd1/usr/src/mirabox
cd /media/sdd1/usr/src/mirabox
tar xf linux-4.20.6-mvebu-mirabox-tld-12-bodhi.tar.bz2

3. Make Mirabox uImage for first boot

cd /media/sdd1/usr/src/mirabox
tar -xvf linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar dts/armada-370-mirabox.dtb
cp zImage-4.20.6-mvebu-mirabox-tld-12 zImage.fdt
cp -a zImage-4.20.6-mvebu-mirabox-tld-12 zImage.fdt
cat dts/armada-370-mirabox.dtb >> zImage.fdt 
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.20.6-mvebu-mirabox-tld-12 -d zImage.fdt uImage

4. Copy Mirabox uImage to rootfs boot folder

cd /media/sdd1/boot
cp -a uImage uImage.bak
cp -a /media/sdd1/usr/src/mirabox/uImage .
sync


B. Boot the Mirabox with new kernel

1. Plug in the new SD roots to the external SD slot. Connect serial console. Power up and interrupt serial console at count down. And

printenv
Copy and paste the list of the envs from above command in a notepad. And then,
setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 $mtdparts ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs"'
setenv bootcmd_stock 'echo Booting Stock...; nand read 0x6400000 0x400000 0x400000; run set_bootargs_stock; bootm 0x6400000'
setenv load_image_addr 0x6400000
setenv load_initrd_addr 0x8400000
setenv load_uImage 'ext2load usb 1:1 $load_image_addr /boot/uImage'
setenv load_uInitrd 'ext2load usb 1:1 $load_initrd_addr /boot/uInitrd'
setenv set_bootargs_debian 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:4M(u-boot),4M(linux),-(filesystem) earlyprintk=serial'
setenv bootcmd_debian 'echo Booting Debian... ; usb start; run load_uImage; run load_uInitrd; run set_bootargs_debian; bootm $load_image_addr $load_initrd_addr'
setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'

And then go ahead with booting to Debian
boot

2. Login using SSH or serial console with root/root credential

Find the Mirabox dynamic IP address in the network. Or try to ping its hostname
ping debian.local

Log in and check what kernel is running.
uname -a
Expect Output:
Linux debian 4.20.6-mvebu-mirabox-tld-12 #6 SMP PREEMPT Wed Mar 13 14:43:16 PDT 2019 armv7l GNU/Linux

At this point the system is running with the new kernel 4.20.6-mvebu-mirabox-tld-12, but with older rootfs.

3. Install full kernel

cd /boot
cp -a uImage uImage.mirabox.bak
cp -a uInitrd uInitrd.bak    
dpkg -i /usr/src/mirabox/linux-image-4.20.6-mvebu-mirabox-tld-12_12.0_armhf.deb 
tar xf /usr/src/mirabox/linux-dtb-4.20.6-mvebu-mirabox-tld-12.tar 
cp -a /usr/src/mirabox/zImage-4.20.6-mvebu-mirabox-tld-12 .
cp -a zImage-4.20.6-mvebu-mirabox-tld-12 zImage.fdt 
cat dts/armada-370-mirabox.dtb >> zImage.fdt 
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.20.6-mvebu-mirabox-tld-12 -d zImage.fdt uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.20.6-mvebu-mirabox-tld-12 -d initrd.img-4.20.6-mvebu-mirabox-tld-12 uInitrd

4. Setup envs for booting Debian permanently

a. Check NAND mtds
cat /proc/mtd
Expected Output:
dev:    size   erasesize  name
mtd0: 00400000 00080000 "u-boot"
mtd1: 00400000 00080000 "linux"
mtd2: 3f800000 00080000 "filesystem"

b. Set up envs area

echo "/dev/mtd0 0x100000 0x00080000 0x00080000" > /etc/fw_env.config

c. Do a sanilty check and then set the envs permanently

fw_setenv test_xxxx yes
fw_printenv test_xxxx
fw_printenv
Expected Output: If you can list the envs and they look like the envs listed in Step B.1 (with the additional test_xxxx env just set), then it's all checked out. If there is any error at this point then please stop and post question.

Go ahead set these permanently.
fw_setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 $mtdparts ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs"'
fw_setenv bootcmd_stock 'echo Booting Stock...; nand read 0x6400000 0x400000 0x400000; run set_bootargs_stock; bootm 0x6400000'
fw_setenv load_image_addr 0x6400000
fw_setenv load_initrd_addr 0x8400000
fw_setenv load_uImage 'ext2load usb 1:1 $load_image_addr /boot/uImage'
fw_setenv load_uInitrd 'ext2load usb 1:1 $load_initrd_addr /boot/uInitrd'
fw_setenv set_bootargs_debian 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:4M(u-boot),4M(linux),-(filesystem) earlyprintk=serial'
fw_setenv bootcmd_debian 'echo Booting Debian... ; usb start; run load_uImage; run load_uInitrd; run set_bootargs_debian; bootm $load_image_addr $load_initrd_addr'
fw_setenv bootcmd 'run bootcmd_debian; run bootcmd_stock'

And then print them again
fw_printenv
Copy and paster the envs to a notepad, for safe keeing.

5. Reboot

You are readdy to reboot the system.
sync
shutdown -r now

II. Install from Stock OS

TBD


Credits:

Thanks Willy Tarreau for a very informative post about UART booting for this box:
http://wtarreau.blogspot.com/2013/02/mirabox-much-better-than-guruplug.html

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 11/06/2019 11:57PM by bodhi.
Re: Mirabox (Armada 370) Installation
November 17, 2019 04:52AM
This entry should probably mention that this firmware image will not work on newer versions of the Mirabox that have U-Boot on a 2MB SPI NOR chip and the OS on a 4GB eMMC on the USB bus. The unit I have also uses Realtek USB wifi instead of the Marvell on earlier units. The earlier units are powered by 5V and this later version uses 12V power. It would be nice to get a working DTS file for these later versions as they also have support for MSATA SSD. My earlier version has Mira_Box_II_V5-0-1 silkscreened on the bottom front of the circuit board while the newer version has Mira_Box_II_V9-1-1 silkscreened on the top of board near the Ethernet chips. Although Globalscale still offers the Mirabox for $149 they don't provide any source code and do not appear to respond to email requesting it.

P.S.
I do have my V5-0-1 version using this firmware booted from the microSD card.

Ray
Re: Mirabox (Armada 370) Installation
November 17, 2019 05:08AM
Ray,

> This entry should probably mention that this
> firmware image will not work on newer versions of
> the Mirabox that have U-Boot on a 2MB SPI NOR chip
> and the OS on a 4GB eMMC on the USB bus.

Thanks for the reminder!

> The unit
> I have also uses Realtek USB wifi instead of the
> Marvell on earlier units. The earlier units are
> powered by 5V and this later version uses 12V
> power.

> It would be nice to get a working DTS file
> for these later versions as they also have support
> for MSATA SSD.

It's probably not too difficult, we'll get back to that working thread and figure out a few more details.

> My earlier version has
> Mira_Box_II_V5-0-1 silkscreened on the bottom
> front of the circuit board while the newer version
> has Mira_Box_II_V9-1-1 silkscreened on the top of
> board near the Ethernet chips. Although
> Globalscale still offers the Mirabox for $149 they
> don't provide any source code and do not appear to
> respond to email requesting it.

Yes, Globalscale is not developer-friendly, to say the least!

Eventhough I think I will have an easier time building new u-boot for this box, I still prefer to struggle with the Thecus N2350 DDR4 issue, because of this reason, among many others.

-bodhi
===========================
Forum Wiki
bodhi's corner
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: