Linux Ubuntu on Android Box


No I am not using Khadas VIM. I am using an MXPro box.


Actually, VIM comes with S905X, and all the source code in our Github just tested on Khadas VIM.

I don’t know the SoC of MXPro box, you can refer the Khadas documents and take a try. :slight_smile:


I replaced the ramdisk.img and rootfs.img with the built images. Please let me kow if I am doing wrong somewhere.
I am going with the package.conf. Not dualboot.
Do I need to use all of the u-boot.bin files? since I am using a USB pendrive for installation?

Please let me know what all files I need to remove as unnecessary from the cloned git repo folder or should I include all files to build image?



I couldn’t find logo.img file in the built images. Any idea to build one?


Regarding the U-Boot files, check the [Khadas Docs] for deails:

  • u-boot.bin: for onboard EMMC storage booting
  • for uSD card booting



Okay, So now I got the final update.img built. I just need t copy the final image to a USB or SD card and insert into the box and start the device?


If you follow the instructions to pack the update.img, note that it’s for eMMC storage only mentioned as the title.


Yes I have followed the instructions and packed the updated image. How will I load onto the eMMC storage through USB? I Just need to copy the image plainly to the USB and insert into the box and reboot? or any specific instructions like update the software?


For your reference:


I tried the doc. But i Get an error while formatting, UBOOT/Partition ramdisk/Initialize partition/Error.


Hi @Gouwa,

My objective: Customize ROOTFS (add kiosk mode settings and repack)

I’m following this article:

Using Ubuntu Image: (S9xxx_4G_ICEWM_MATE_XFCE_LXDE_LXQT_20170129.img.xz)

Tested this image booting from SD-Card on my amlogic S905x box.

I UN-compressed S9xxx_4G_ICEWM_MATE_XFCE_LXDE_LXQT_20170129.img.xz file, created rootfs.img (3.8 GB) using dd and created ext4 fs on rootfs.img, mount to ./rootfs/ folder and copy /media/arun/ROOTFS/* ./rootfs/ folder and chroot into it, modify it and exit and un-mount it.

Now, I want to “Pack Image for eMMC Storage” or SD card referring to But I do not have other files files expect downloaded file.

How to pack and create a image like (S9XXX_**************.xz)

How to achieve it ?



You can follow below steps to pack ubuntu image for eMMC storage.
1). You need to Install toolchains for Amlogic platform

2). Clone the utils repository to fetch the tools for developmen

$ cd ~/project/khadas/ubuntu/
$ git clone

3). Download Upgrade configuration file

$ cd ~/project/khadas/ubuntu/
$ install -d images
$ cd images
$ git clone

4). Download u-boot

$ cd ~/project/khadas/ubuntu/
$ git clone -b ubuntu

4). Download linux kernel

$ cd ~/project/khadas/ubuntu/
$ git clone -b ubuntu

5). Build u-boot

$ cd ~/project/khadas/ubuntu/u-boot
$ make kvim_defconfig
$ make -j8 CROSS_COMPILE=aarch64-linux-gnu-
$ cp fip/gxl/u-boot.bin ../images
  1. Build linux kernel
$ cd ~/project/khadas/ubuntu/linux
$ make ARCH=arm64 kvim_defconfig
$ make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image kvim.dtb modules

7). Modify Rootfs

$ cd ~/project/khadas/ubuntu/
$ install -d rootfs
$ dd if=/dev/zero of=images/rootfs.img bs=1M count=0 seek=384
$ sudo mkfs.ext4 -F -L ROOTFS images/rootfs.img
$ sudo mount -o loop images/rootfs.img rootfs
$ sudo rm -rf rootfs/lost+found
$ copy your-rootfs rootfs
$ cd linux
$ make  ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install INSTALL_MOD_PATH=../rootfs/ -j8

8). Enter Chroot Mode and create initrd image

$ cd ~/project/khadas/ubuntu/
$ sudo cp -a /usr/bin/qemu-aarch64-static rootfs/usr/bin/
$ sudo chroot rootfs/
$ apt-get update
$ apt-get upgrade
$ apt-get install initramfs-tools
$ mkinitramfs -o /boot/initrd.img 3.14.29 2>/dev/null
$ exit

9). Pack Image

$ cd ~/project/khadas/ubuntu/
$ cp rootfs/boot/initrd.img images/initrd.img
$ sudo sync
$ sudo umount rootfs
$ ./utils/mkbootimg --kernel linux/arch/arm64/boot/Image --ramdisk images/initrd.img -o images/ramdisk.img
$ ./utils/aml_image_v2_packer -r images/upgrade/package.conf images/upgrade/ images/update.img