Gapps and SU on SOC?

I can check it after 7 hours.

But I disabled it in the file “uboot/board/khadas/configs/kvim.h”.

I checked it:
“uboot/board/khadas/configs/kvim.h” file has “EnableSelinux=disabled\0”\

u0_a56@Vim:/ $ getenforce
Enforcing

How fix it?

Hi, Davemf:
Can you check again that you have got the u-boot binary with Selinux disabled one been downloaded to the eMMC?

binary su file is in out/target/product/kvim/system/xbin after build.

1 Like

binary su file is in /system/xbin on khadas vim. But file of size 0!!!

You need to rebuild the u-boot when you modify the file ‘uboot/board/khadas/configs/kvim.h’

$ cd u-boot
$ make distclean
$ make kvim_defconfig
$ make -j8

About the file ‘out/target/product/kvim/system/xbin’

  1. You need to check the source 'vendor/amlogic/root
  2. Rebuild your project
$ make installclean -j8
$ make otapackage -j8
2 Likes

I cloned source again.

  1. repo init -u GitHub - khadas/android_manifest: AOSP for Khadas VIMs & Edge -b Mmallow
  2. repo sync -j4

after that, I cloned gapps and su on vendor/amlogic
3. git clone GitHub - terry2droid/google
4. git clone GitHub - khadas/supersu: SuperSU “root”

then enable GAPPS and Root by edit ‘device/khadas/kvim/kvim.mk’:
5. BUILD_WITH_ROOT_CONFIG :=true
6. BUILD_WITH_GAPPS_CONFIG :=true

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/envsetup.sh
11. lunch
12. make -jN otapackage

After build, I got my update.img
and…
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
Enforcing

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:  mkuserimg.sh -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/kvim-target_files-20170406.zip
cp device/khadas/kvim/upgrade/aml_sdc_burn.ini out/target/product/kvim/upgrade/aml_sdc_burn.ini
cp device/khadas/kvim/upgrade/u-boot.bin.sd.bin out/target/product/kvim/upgrade/u-boot.bin.sd.bin
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/u-boot.bin.sd.bin),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

2 Likes

superceleron said:

BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive
in
BoardConfig.mk

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

I could’t open the web 'https://cloud.mail.ru/public/34Rz/Jp5UH9iAy
Can you shard the log file in other cloud or send the it to my email (terry@szwesion.com)
Thanks.

I sent on email.
Thanks.

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/envsetup.sh
$ lunch 9
$ make clean
$ make otapackage -j8

I try it soon.
Thanks.