Armbian + KODI (Ubuntu\Debian) for SD & USB & eMMC

I did. You can’t access the folder /root without… :slight_smile: The output below is the exact from above, I just changed the first line as I used a personal hostname.

root@aml : ~ # ./install.sh
Start script create MBR and filesystem

/dev/mmcblk2

Only show the full output from run command (skript) input until the end of the script.

The output is in the post above: Armbian + KODI (Ubuntu\Debian) for SD & USB & eMMC

I can run ./install.sh again if you want? (second time)

@Spikerguy, have you also given this a try on your VIM3 with latest VIM3 Android Pie V190907?

Not on vim3 but on vim1 with latest android version and also with manjaro linux and not armbian.

I will try it tonight.

I ran the script again, but this time with sudo in front.

sudo ./install.sh output second time

root@aml : ~ # sudo ./install.sh

Start script create MBR and filesystem

/dev/mmcblk2

Start backup u-boot default

4+0 records in

4+0 records out

4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.0546335 s, 76.8 MB/s

Start create MBR and partittion

Start restore u-boot

442+0 records in

442+0 records out

442 bytes copied, 0.00148496 s, 298 kB/s

8191+0 records in

8191+0 records out

4193792 bytes (4.2 MB, 4.0 MiB) copied, 0.247898 s, 16.9 MB/s

Done

Start copy system for eMMC.

Formatting BOOT partition...mkfs.fat 4.1 (2017-01-24)

done.

Cppying BOOT...done.

Edit init config...done.

Formatting ROOT partition...

e2fsck 1.44.5 (15-Dec-2018)

ROOT_EMMC: clean, 11/1859584 files, 160771/7431424 blocks

done.

Copying ROOTFS.

Copy BIN

Create DEV

Copy ETC

Copy HOME

Copy LIB

Create MEDIA

Create MNT

Copy OPT

Create PROC

Copy ROOT

Create RUN

Copy SBIN

Copy SELINUX

Copy SRV

Create SYS

Create TMP

Copy USR

Copy VAR

Copy fstab

*******************************************

Complete copy OS to eMMC 

*******************************************

I finally got everything to work. Thanks for the great help and feedback, @balbes150! :slight_smile: This is the complete step-by-step guide:

  1. Burn latest Android to eMMC with USB burning tool (full erase of flash and bootloader) *
  2. Burn latest Armbian to mSD card / USB with Etcher
  3. Change dtb filename in both /extlinux/extlinux.conf and uEnv.ini to meson-g12b-a311d-khadas-vim3.dtb
  4. Insert mSD card / USB and boot into Android
  5. Activate multi-boot by using

Keys Mode (U-Boot is Running Normally) (Link)

  1. Power on VIM3.
  2. Long press the POWER key without releasing it.
  3. Short press the ‘Reset’ key and release it.
  4. Count for 2 to 3 seconds, then release the POWER key to enter into Upgrade Mode. You will see the sys-led turn ON when you’ve entered Upgrade Mode.
  1. Log in with root, change root password and add new user
  2. Run sudo ./install.sh with root and shutdown after successful installation to eMMC
  3. Activate multi-boot again by using Keys Mode (see step 5) (Remember to have mSD card / USB inserted)
  4. Shutdown, unplug your mSD card / USB and power on. You should now be running Armbian from eMMC :slight_smile:
  • If you have preinstalled any other OS than Android on eMMC, wipe eMMC before burning Android on it by running dd if=/dev/zero of=/dev/mmcblk<number_eMMC> from an OS on mSD/USB.
1 Like

I also got it to work. Just think which was missing is that it has to have multiboot active.
And armbian does that on its first boot.

That’s great work by balbes
EDIT: I can confirm this works completely fine with armbian but failed with other os like I tried for Manjaro. I will get a new UART cable and check the reason for no boot even after the script runs successfully. I am still able to boot from usb with multiboot active.

Is anyone else getting “Input/output error” when transferring data between two external drives? I’ve hoped the issues regarding IO errors were fixed in kernel 5.3 for Amlogic devices… I’m on 5.3.0-rc6-aml-g12 so perhaps I should give the final version a try.

To Khadas devs: Have other with VIM3 reported Input/output error? Especially those using khadas-vims-4.9.y which you maintain on GH, @numbqq. This was one of the main reasons for why I bought a VIM3 instead of the cheaper ODROID-N2 as Hardkernel have had massive issues regarding this (https://forum.odroid.com/viewtopic.php?f=181&t=35031).

Update:
Changing /sys/class/block/?d?/queue/max_sectors_kb from the value of 1024 to 32 still trigger the error.

My setup is as follows: A VIM3 with a ORICO Mini USB 3.0 HUB 4 Port connected to a Rocketek usb 3.0 multi Smart memory card reader with a mSD card inserted and a Seagate Expansion Desktop. Both the ORICO USB HUB and Seagate HDD are powered with an external power supply.

Update 2:
This is the patch I need which Amlogic worked out for g12 devices:
dwc3/core: xHCI host not responding to stop endpoint command

I can’t seem to find the patch in Kernel 5.3 patch notes… So I suppose it isn’t merged yet. I’ve asked balbes if he can include the patch into the next build with Armbian. I highly advice the Khadas team to look into this as it should also affect others using kernel 4.9.

@Frank Please follow up.

@Z11ntal33r
Hello , I use a hub and two usb drivers .
First I mount two usb drivers in /mnt

khadas@Khadas:/mnt$ sudo mount /dev/sda2 usb1/
khadas@Khadas:/mnt$ sudo mount /dev/sdb1 usb2/

Then I cp a file to USB1 from USB2

khadas@Khadas:/mnt/usb2$ sudo cp ldlinux.sys ../usb1/
khadas@Khadas:/mnt/usb2$

I don’t find any error.Can you tell me how to reproduce ?

Device: VIM3 Pro (A311D)
DTB: meson-g12b-a311d-khadas-vim3.dtb
Installation procedure: Complete step-by-step guide for installing Armbian on VIM3

After I completely wiped eMMC, I installed VIM3_Pie_V190907 to eMMC. Then I installed Armbian_5.95_Aml-g12_Debian_buster_default_5.3.0-rc6_20190904 to eMMC.

Both my mSD and USB HDD are mounted in fstab with:

echo ‘UUID=SD_UUID /mnt/mSD ext4 noatime,nofail,defaults 0 0’ >> /etc/fstab
echo ‘UUID=SEAGATE_HDD_UUID /mnt/usb ext4 noatime,nofail,defaults 0 0’ >> /etc/fstab

If I try to copy a file from my mSD to my Seagate HDD either with the simple cp command (cp /mnt/mSD/file1 /mnt/usb/) or using mc (midnight commander), I’m facing the error. I’ve never had any issues with this on my RPi, but this is the first time I’ve been using the USB3 interface, which allows much higher speeds.

Example: Copying a 20GB file from my mSD to my HDD I hit over 70 MB/s and after 4-7 seconds, everything halt and then I get the error. The error is likely related to high speeds over USB3 interface as seen from Hardkernel forums. So in order to reproduce this, you’ll need a USB3 hub and that all devices use USB3 to get high enough speeds to trigger this. If you follow some of the steps which people recommend over at Hardkernel’s forum, I’m sure you should be able to reproduce this. This should also affect VIM3_Ubuntu-server-bionic_Linux-4.9_arm64_EMMC_V20190830 builds etc.

@Frank, I recommend contacting Amlogic too as they created the patch for Hardkernel and their’s ODROID-N2 to fix the IO issue for meson-g12b (he.he <he.he@amlogic.com signed the patch).

As soon as @balbes150 include the fix dwc3/core: xHCI host not responding to stop endpoint command into his next Armbian build, I’ll be able to test if the fix also covers VIM3 and not only ODROID-N2.

@Z11ntal33r OK , I will try with USB3.0 HUB

Everything has to be USB3.0. You should at least read disk A at 100 MB/s and write to disk B at 70+ MB/s simultaneously. Use rsync which shows current speed :+1:

rsync -a --info=progress2 src/ dest/

I’ve not tested dummy files created by dd, but they should as well trigger this error. So test different dummy files from 1 GB to 50 GB.


I’ll do some more testing as soon @balbes150 has included the XHCI patch into his next Armbian build :slight_smile:

If the patch does not solve this I’ll try the USB2 port on my VIM3 to see if the USB2 interface is affected as well. I’ve not tested USB2 yet as it should be fine. Time will tell.

Update:
@Frank, if you get the same error as I did, you need to try the patch dwc3/core: xHCI host not responding to stop endpoint command which solved the issue for me as I’m now able to copy/move files between two drives over USB3.0 interface simultaneously. The patch should be added to the vendor kernel Khadas use for VIMs to prevent others from facing the same issue. The patch will eventually be merged upstream into mainline if either Amlogic or Hardkernel follow it up. More info at Hardkernels forum.

It took 12 days, incorrect infa (links) is present on the page. Do you have plans of removing the references LE and Armbian this page ?

@balbes150, latest 5.96 image with 5.3.0 kernel, wifi doesn’t work using khadas vim1, i am using also approriate vim1 dtb?

@balbes150 I didn’t delete it, but I changed the content of the document. Do you think there is something wrong with the document now? If you tell me where, I don’t see any mistakes in this revised document.

@Frank, have you done any further testing over the USB3.0 interface?

At least the xHCI patch Amlogic made for Hardkernel and Odroid-N2 fixed the issue for me. More information about it in my last post. balbes150 has included the patch into his Github repository 150balbes/Amlogic_s905-kernel with his latest commit v20190918. So meson-g12 users won’t be affected by the issue anymore :+1:

You need to remove the reference LE and Armbian from this page. The description on this page does not match the currently used system startup LE and Armbian (this misleads users).

1 Like

I’ve to agree with balbes here as it is not necessary to example copy the appropriate DTB file as the script uses the DTB name in /extlinux/extlinux.conf and/or uEnv.ini which the user has to type in to boot Armbian / LE.

What I recommend is to split up and add a new section for LE and Armbian on the same page with the complete guide I posted earlier. You are free to use it and do any modifications as you want. Here is the post: Complete step-by-step guide for installing Armbian / LE

1 Like

and what’s more, it is harmful (to copy and rename DTB to dtb.img), then the automatic kernel update by standard apt tools will be broken.