Gapps and SU on SOC?


I cloned source again.

  1. repo init -u -b Mmallow
  2. repo sync -j4

after that, I cloned gapps and su on vendor/amlogic
3. git clone
4. git clone “root”

then enable GAPPS and Root by edit ‘device/khadas/kvim/’:

then I check the file uboot/board/khadas/configs/kvim.h
7.“EnableSelinux=disabled\0”\ - not modify

After that I build U-Boot:
8. make CROSS_COMPILE=aarch64-linux-gnu- kvim_defconfig
9. make CROSS_COMPILE=aarch64-linux-gnu-

After that I build Android:
10. source build/
11. lunch
12. make -jN otapackage

After build, I got my update.img
root does not work again!!!

What did I do wrong?


I check:

  1. In my source: vendor/amlogic/root/su - file of size 75.3kB
  2. In my source: out/target/product/kvim/system/xbin - file of size 75.3kB
  3. In your firmware /system/xbin - file of size 73.5kB
  4. In my update.img /system/xbin - file of size 0kB - ZERO!!! Why???

PS: Because in source:
u0_a56@Vim:/ $ getenforce

How fix it?


Did you make sure the update.img is latest?
Please provider some information about packing image for me
Like this:

Installed file list: out/target/product/kvim/installed-files.txt
Target system fs image: out/target/product/kvim/obj/PACKAGING/systemimage_intermediates/system.img
Running: -s out/target/product/kvim/system out/target/product/kvim/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 1073741824 -D out/target/product/kvim/system -L system out/target/product/kvim/root/file_contexts
make_ext4fs -s -T -1 -S out/target/product/kvim/root/file_contexts -L system -l 1073741824 -a system out/target/product/kvim/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/kvim/system out/target/product/kvim/system
Creating filesystem with parameters:
    Size: 1073741824
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8192
    Inode size: 256
    Journal blocks: 4096
    Label: system
    Blocks: 262144
    Block groups: 8
    Reserved block group size: 63
Created filesystem with 1944/65536 inodes and 119771/262144 blocks
Install system fs image: out/target/product/kvim/system.img
out/target/product/kvim/system.img+ maxsize=1096220928 blocksize=4224 total=474888664 reserve=11075328
mkdir -p out/target/product/kvim/upgrade
Package target files: out/target/product/kvim/obj/PACKAGING/target_files_intermediates/
cp device/khadas/kvim/upgrade/aml_sdc_burn.ini out/target/product/kvim/upgrade/aml_sdc_burn.ini
cp device/khadas/kvim/upgrade/ out/target/product/kvim/upgrade/
cp device/khadas/kvim/upgrade/u-boot.bin.usb.bl2 out/target/product/kvim/upgrade/u-boot.bin.usb.bl2
cp device/khadas/kvim/upgrade/u-boot.bin.usb.tpl out/target/product/kvim/upgrade/u-boot.bin.usb.tpl
cp device/khadas/kvim/upgrade/platform.conf out/target/product/kvim/upgrade/platform.conf
cp device/khadas/kvim/upgrade/aml_upgrade_package.conf out/target/product/kvim/upgrade/aml_upgrade_package.conf
ln -s out/target/product/kvim/system.img out/target/product/kvim/upgrade/system.img
ln -s out/target/product/kvim/userdata.img out/target/product/kvim/upgrade/userdata.img
ln -s out/target/product/kvim/cache.img out/target/product/kvim/upgrade/cache.img
ln -s out/target/product/kvim/boot.img out/target/product/kvim/upgrade/boot.img
ln -s out/target/product/kvim/recovery.img out/target/product/kvim/upgrade/recovery.img
ln -s out/target/product/kvim/u-boot.bin out/target/product/kvim/upgrade/u-boot.bin
ln -sf /home/terry/project/vim/mmallow/out/target/product/kvim/dtb.img out/target/product/kvim/upgrade/meson.dtb
Package: out/target/product/kvim/update.img
./vendor/amlogic/tools/aml_upgrade/aml_image_v2_packer -r out/target/product/kvim/upgrade/aml_upgrade_package.conf out/target/product/kvim/upgrade/ out/target/product/kvim/update.img
[Msg]Pack Item[USB         ,              DDR] from (out/target/product/kvim/upgrade/u-boot.bin.usb.bl2),sz[0xc000]B,
[Msg]Pack Item[USB         ,            UBOOT] from (out/target/product/kvim/upgrade/u-boot.bin.usb.tpl),sz[0xd4000]B,ft[normal]	
[Msg]Pack Item[UBOOT       ,     aml_sdc_burn] from (out/target/product/kvim/upgrade/,sz[0xe0200]B,ft[normal]	
[Msg]Pack Item[ini         ,     aml_sdc_burn] from (out/target/product/kvim/upgrade/aml_sdc_burn.ini),sz[0x24d]B,
[Msg]Pack Item[PARTITION   ,             boot] from (out/target/product/kvim/upgrade/boot.img),sz[0x800800]B,ft[normal]	
[Msg]Pack Item[VERIFY      ,             boot] from (out/target/product/kvim/upgrade/boot.img),vry[sha1sum 68f873b0efb3f49a6860729e98ddfcbecf30b9ea]	
[Msg]Pack Item[PARTITION   ,       bootloader] from (out/target/product/kvim/upgrade/u-boot.bin),sz[0xe0000]B,ft[normal]	
[Msg]Pack Item[VERIFY      ,       bootloader] from (out/target/product/kvim/upgrade/u-boot.bin),vry[sha1sum 154fffc47f1d95bfc8631ff2632900f8f85c225f]	
[Msg]Pack Item[PARTITION   ,             logo] from (out/target/product/kvim/upgrade/logo.img),sz[0x11b5b0]B,ft[normal]	
[Msg]Pack Item[VERIFY      ,             logo] from (out/target/product/kvim/upgrade/logo.img),vry[sha1sum e015d2315620015aab9c91754a65932549f949f7]	
[Msg]Pack Item[xml         ,         manifest] from (out/target/product/kvim/upgrade/manifest.xml),sz[0x1056f]B,ft[normal]	
[Msg]Pack Item[dtb         ,           meson1] from (out/target/product/kvim/upgrade/meson.dtb),sz[0x94dd]B,
[Msg]Pack Item[conf        ,         platform] from (out/target/product/kvim/upgrade/platform.conf),sz[0xca]B,
[Msg]Pack Item[PARTITION   ,         recovery] from (out/target/product/kvim/upgrade/recovery.img),sz[0xacb000]B,ft[normal]	
[Msg]Pack Item[VERIFY      ,         recovery] from (out/target/product/kvim/upgrade/recovery.img),vry[sha1sum f6d6029b7f274907805f96025d22eeb146a5011d]	
[Msg]Pack Item[PARTITION   ,           system] from (out/target/product/kvim/upgrade/system.img),sz[0x1c4e39d8]B,ft[sparse]	
[Msg]Pack Item[VERIFY      ,           system] from (out/target/product/kvim/upgrade/system.img),vry[sha1sum 271a5249d6f9cf38d30563fcba8f51889fbc195b]	
[Msg]version:0x2 crc:0x079fdc19 size:498626148 bytes[475MB]
Pack image[out/target/product/kvim/update.img] OK
out/target/product/kvim/update.img installed


Yes of course latest version.
I delete the entire folder with the project khadas and clone github again. After that I make uboot & android.


this is my log of compilation


As you can see by the log, all the files repackaged. Especially since they just created.


It’s night here in Shengzhen China at the moment.
I’m at home not in the company and have not conditions to deal with the problem.
I will see the log file and reply for you in tomorrom


superceleron said:

BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive

but I don’t have time to try it today.


I could’t open the web '
Can you shard the log file in other cloud or send the it to my email (


I sent on email.


I saw the log file but did’t find the error information.
I noticed the date of log file 20170327, If you send the wrong file?
You can download the u-boot.bin to check the value of EnableSelinux .
About how to load u-boot.bin into the device, see here


I compiled on vmware, it still has the old date after resume.

Please, tell. How to clean completely the system to perform the compile again?


You can execute below command:

$ cd <path-your-project>
$ source build/
$ lunch 9
$ make clean
$ make otapackage -j8


I try it soon.


I try root for nougat

It is availd for Android7.1.1 Root
You can follow below step to root


  1. Make sure the selinux is permissiv

check the file uboot/board/khadas/configs/kvim.h
make sure the value of EnableSelinux is permissive and not enforcing

  1. Download the root file from github

$ cd
$ cd vendor/amlogic
$ git clone -b nougat "root"
3) Configure the build for Root

<1> modify ‘device/khadas/kvim/’:
<2> modify 'device/khadas/kvim/product/’
$(call inherit-product, vendor/amlogic/root/

  1. Build your rom again

$ cd
$ make installclean
$ make -jN otapackage

I rebuilded the u-boot after modify the file ‘uboot/board/khadas/configs/kvim.h’

$ cd u-boot
$ make distclean
$ make CROSS_COMPILE=aarch64-linux-gnu- kvim_defconfig
$ make CROSS_COMPILE=aarch64-linux-gnu-

but again error like mmallow

kvim:/ $ getenforce

I use ubuntu after GEEKBOX. May be need new system.
I install new ubuntu 14.04 for Khadas Project. But I have the problem.


Please provider the kernel log for me. Thanks.


I sent full log on your email:


I mean the printing log not build log


I sent kernel log on your email.


terry, please tell why

on android M6: make sure the value of EnableSelinux is disabled and not enforcing
on android N7: make sure the value of EnableSelinux is permissive and not enforcing

What is right?