Use Fenix scripts to build your own ubuntu image


Hi luchina,

It’s OK.But for the following errors:

Try to find out which target is busy.

$ mount | grep fenix
$ sudo fuser -m /root/project/fenix/rootfs

I guess is rootfs/sys/kernel/security.So try to umount them manually.

$ sudo umount /root/project/fenix/rootfs/sys/kernel/security
$ sudo umount /root/project/fenix/rootfs/sys
$ sudo umount /root/project/fenix/rootfs

And you can modify scripts/

diff --git a/scripts/ b/scripts/
index 291f6e2..4d07ce2 100755
--- a/scripts/
+++ b/scripts/
@@ -622,6 +622,7 @@ build_rootfs() {
        sudo umount rootfs/dev/pts
        sudo umount rootfs/dev
        sudo umount rootfs/proc
+       sudo umount rootfs/sys/kernel/security
        sudo umount rootfs/sys
        sudo umount rootfs


Hi @numbqq,

I made the setting on as it guides and it worked correctly now!

Thanks (Y)


Dear All,

How to replace ubuntu-mate built-in default admin. account : khadas/khadas ? I see ubuntu-mate-16.04.2-arm64.tar.gz has built-in khadas folder.




Hi allanwang,

Try to delete default khadas account, and create your new account. e.g: test1234:test234

diff --git a/archives/filesystem/ b/archives/filesystem/
index 22075e5..ba64feb 100755
--- a/archives/filesystem/
+++ b/archives/filesystem/
@@ -13,6 +13,11 @@ else
+# Admin user khadas
+deluser --remove-home khadas
+useradd -m -p "pasUqHW8rwy9M" -s /bin/bash test1234
+usermod -aG sudo,adm test1234
 # Setup host
 echo Khadas > /etc/hostname
 echo "    localhost.localdomain localhost" > /etc/hosts

About how to generate encrypted password, for example account test1234:test1234:

nick@Server:~$ password="test1234"
nick@Server:~$ perl -e 'printf("%s\n", crypt($ARGV[0], "password"))' "$password"



Dear numbqq

According to your instructions to modify, the implementation of the following error occurred

177 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 167 MB of archives.
After this operation, 36.6 MB of additional disk space will be used.
E: You don’t have enough free space in /var/cache/apt/archives/.
setfacl: Option -m: Invalid argument near character 3

Fixup /media/khadas ACL attribute

setfacl -m u:khadas:rx /media/khadas
setfacl -m g::— /media/khadas

To change here too?

Thank you for your support

Allan Wang


Hi allanwang,

Maybe you should change your image size.

Change seek=3400 to a bigger one, e.g: dd if=/dev/zero of=images/rootfs.img bs=1M count=0 seek=4000



Dear numbqq

No more error message for E: You don’t have enough free space in /var/cache/apt/archives/.

But there is a new problem for bluetooth. Please see the attached file. (Failed to apply network settings)

Thanks a lot.

Allan Wang


Hi allanwang,

Try the following command.

$ sudo chmod u+s /usr/lib/dbus-1.0/dbus-daemon-launch-helper



Hi Numbqq.
How do you relate to what I’m going to modify your set fenix and give it the ability to build the images to external media (SD cards and USB flash drives) with the use of universal multi-boot ?


Hi balbes150,

I have added SD/USB image and universal multi-boot support to Fenix.
But there are some issues about activate multi-boot need to be resolved. For android 7.1, when I insert the SD card with SD image, the ROOTFS partition permissions are forced to change to 1023 from root. So,can’t boot to Mate desktop. And for android 6.0, the u-boot can’t boot linux 4.9 well.



Hi numbqq.
Build the image can take a long time, you can put the image of the SD card ? I look at, what could be the problem.


Hi balbes150,

The SD/USB image can work well if I cleanup EMMC and boot from SD/USB directly.
It’s about android EXT4 filesystem, and I tried your Armbian images, if I activate multi-boot via Android 7.1, I got the same result. Do you ever tried android 7.1 to activate multi-boot?



In the latest version DualOS VIM2_DualOS_Nougat_Ubuntu-16.04_V171028 what version of Android ?


Hi balbes150,

Android 7.1 V171028, and will fixup this issue to support multi-boot.


Hi numbqq

  1. For version 17.10 , when building an image for initrd SD_USB is not formed.
  2. What added more script s912_autoscript ? In my experience of working with a large number of models with S9xxx, for all models (regardless of the model S912 or S905) a try only 1 script. They are all models great to work with a single script.


Hi balbes150,

The difference between VIM and VIM2 is u-boot bootargs. For VIM2 there are some extra bootargs.So I try 2 scripts. Maybe we can use just VIM2 auto script, and VIM will ignore such bootargs.



I saw the differences in the scripts and s905 to s912. You can use two solutions.

  1. You can use one script (s905_autoscript) for both models. If you add additional variables (s912) in General script (s905_autoscript), when this script is run on the model s905, these variables will be absent in the “env” in the uboot command prompt will get blank values. This is equivalent to their absence. Meaning that the kernel will ignore empty variables.
  2. You can add to the script a variable with bootargs_s912 need more options when setting bootargs to add the condition check “if CONFIG_DEVICE_PRODUCT = “q200” then setenv bootarg ${bootargs} ${bootargs_s912}”


Hi balbes150,

Good idea. Thank you Balbes150. :wink:


Hi numbqq

I suggest to add in fenix setup for a wired network via DHCP. I have added them to i’m fork your GIT fenix the settings and check on their work. I can send you a request to merge in your GIT. You interested ?


Hi balbes150,

Of course, any patches to improve Fenix are welcomed. Thank you.:smiley: