PINE64
AOSP Build Steps Using github.com/ayufan-rock64/android-7.1 - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85)
+--- Forum: General Discussion on ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=86)
+--- Thread: AOSP Build Steps Using github.com/ayufan-rock64/android-7.1 (/showthread.php?tid=5036)

Pages: 1 2


AOSP Build Steps Using github.com/ayufan-rock64/android-7.1 - birender.s - 08-27-2017

Please provide step-by-step method to build 
rock64_20170809_stock_android_7.1.2_sdboot.img
Using source code provided @
https://github.com/rock64-linux
https://github.com/rockchip-linux
https://source.android.com/
https://android.googlesource.com/

Major task is to merge rock64-linux code with full ASOP and build it for Rock64

Regards.


RE: AOSP Build Steps Using github.com/rock64-linux - ayufan - 08-28-2017

It is impossible. You can find all rock64-android sources and try to compile it yourself: https://github.com/rock64-android/.


RE: AOSP Build Steps Using github.com/rock64-linux - birender.s - 08-28-2017

I have repo initialised using :
repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.2_r6
and than replaced default.xml content with
https://github.com/ayufan-rock64/android-7.1/blob/master/versions/0.2.9/manifest.xml
[<default remote="aosp" revision="refs/tags/android-7.1.2_r6" sync-j="4"/>]
Will it work ?


RE: AOSP Build Steps Using github.com/rock64-linux - birender.s - 08-29-2017

Please check sync error:

error: Cannot fetch all (GitError: all update-ref: fatal: 75b3f7059f1c495f74a8b1e9943a65e8121d13d8^0: not a valid SHA1
)
Fetching project device-rockchip-rk3328
Exception in thread Thread-270:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/user/aosp/ROCK64/android-7.1.2_r6/.repo/repo/subcmds/sync.py", line 270, in _FetchProjectList
success = self._FetchHelper(opt, project, *args, **kwargs)
File "/home/user/aosp/ROCK64/android-7.1.2_r6/.repo/repo/subcmds/sync.py", line 314, in _FetchHelper
prune=opt.prune)
File "/home/user/aosp/ROCK64/android-7.1.2_r6/.repo/repo/project.py", line 1271, in Sync_NetworkHalf
self._InitMRef()
File "/home/user/aosp/ROCK64/android-7.1.2_r6/.repo/repo/project.py", line 2364, in _InitMRef
self._InitAnyMRef(R_M + self.manifest.branch)
File "/home/user/aosp/ROCK64/android-7.1.2_r6/.repo/repo/project.py", line 2376, in _InitAnyMRef
self.bare_git.UpdateRef(ref, dst, message=msg, detach=True)
File "/home/user/aosp/ROCK64/android-7.1.2_r6/.repo/repo/project.py", line 2673, in UpdateRef
self.update_ref(*cmdv)
File "/home/user/aosp/ROCK64/android-7.1.2_r6/.repo/repo/project.py", line 2747, in runner
(self._project.name, name, p.stderr))
GitError: all update-ref: fatal: 75b3f7059f1c495f74a8b1e9943a65e8121d13d8^0: not a valid SHA1


Seems to be revision issue of:

<project clone-depth="1" name="all" path="vendor/opengapps/sources/all" remote="opengapps" revision="75b3f7059f1c495f74a8b1e9943a65e8121d13d8" upstream="master"/>


RE: AOSP Build Steps Using github.com/rock64-linux - birender.s - 08-30-2017

Updated to latest commit
opengapps/arm64 : 9448892d761662c8cafe566f4f96eb1aba016c38
opengapps/arm : cfd2c057d15672ecca049f921a9e68a6cb97ab07
in default.xml
Latest Commit picked from https://github.com/opengapps/


RE: AOSP Build Steps Using github.com/rock64-linux - birender.s - 08-31-2017

After Source sync:
Command to build is:
cd ~/proj/kernel/
make ARCH=arm64 rockchip_defconfig
make -j8 ARCH=arm64 rk3328-rock64.img
cd ..
source build/envsetup.sh
lunch
29
make -j4
----------------------------------------------------------------------------------
24. rock64_regular-eng
25. rock64_regular-userdebug
26. rock64_regular-user
27. rock64_atv-eng
28. rock64_atv-userdebug
29. rock64_atv-user
----------------------------------------------------------------------------------
Please confirm kernel deconfig rockchip_defconfig

==============================================================
make u-boot image as below
cd ~/proj/u-boot/
make rk3328_box_defconfig
make ARCHV=aarch64 -j8
==============================================================
make full image at same place using
mkimage.sh
/rockdev/Image-rock64_atv will be geneated
==============================================================


RE: AOSP Build Steps Using github.com/rock64-linux - birender.s - 08-31-2017

[ 99% 32224/32225] Target system fs image: out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img
FAILED: /bin/bash -c "(mkdir -p out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/ out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates && rm -rf out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"fs_type=ext4\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"system_size=1610612736\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"userdata_fs_type=ext4\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"cache_size=69206016\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"extfs_sparse_flag=-s\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"squashfs_sparse_flag=-s\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"selinux_fc=out/target/product/rk3328/root/file_contexts.bin\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (echo \"skip_fsck=true\" >> out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt ) && (PATH=out/host/linux-x86/bin/:\$PATH ./build/tools/releasetools/build_image.py out/target/product/rk3328/system out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system_image_info.txt out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/rk3328/system || ( echo \"Out of space? the tree size of out/target/product/rk3328/system is (MB): \" 1>&2 ; du -sm out/target/product/rk3328/system 1>&2; if [ \"ext4\" == \"ext4\" ]; then maxsize=1610612736; if [ \"\" == \"true\" ]; then maxsize=\$((maxsize - 4096 * 4096)); fi; echo \"The max is \$(( maxsize / 1048576 )) MB.\" 1>&2 ; else echo \"The max is \$(( 1610612736 / 1048576 )) MB.\" 1>&2 ; fi; mkdir -p out/dist; cp out/target/product/rk3328/installed-files.txt out/dist/installed-files-rescued.txt; exit 1 ) )"
error: failed to build out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img from out/target/product/rk3328/system
Running: mkuserimg.sh -s out/target/product/rk3328/system out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 1610612736 -D out/target/product/rk3328/system -L system out/target/product/rk3328/root/file_contexts.bin
make_ext4fs -s -T -1 -S out/target/product/rk3328/root/file_contexts.bin -L system -l 1610612736 -a system out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/rk3328/system out/target/product/rk3328/system
error: ext4_allocate_best_fit_partial: failed to allocate 16191 blocks, out of space?
Creating filesystem with parameters:
Size: 1610612736
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 6144
Label: system
Blocks: 393216
Block groups: 12
Reserved block group size: 95
Out of space? the tree size of out/target/product/rk3328/system is (MB):
1886 out/target/product/rk3328/system
The max is 1536 MB.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (03:45:39 (hh:mmConfuseds)) ####


RE: AOSP Build Steps Using github.com/rock64-linux - Blinky - 09-01-2017

(08-31-2017, 09:21 PM)birender.s Wrote: error: failed to build out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img from out/target/product/rk3328/system
Running: mkuserimg.sh -s out/target/product/rk3328/system out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 1610612736 -D out/target/product/rk3328/system -L system out/target/product/rk3328/root/file_contexts.bin
make_ext4fs -s -T -1 -S out/target/product/rk3328/root/file_contexts.bin -L system -l 1610612736 -a system out/target/product/rk3328/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/rk3328/system out/target/product/rk3328/system
error: ext4_allocate_best_fit_partial: failed to allocate 16191 blocks, out of space?
Creating filesystem with parameters:
Size: 1610612736
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 6144
Label: system
Blocks: 393216
Block groups: 12
Reserved block group size: 95
Out of space? the tree size of out/target/product/rk3328/system is (MB):
1886 out/target/product/rk3328/system
The max is 1536 MB.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (03:45:39 (hh:mmConfuseds)) ####
You can change the following to increase the system image size:

/device/rockchip/rk3328/BoardConfig.mk
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648

//This is for 2GB size, you can change it to anything that still fits on the EMMC or SDCard.

You must also increase the system.img size in the parameter file so the firmware can boot.
Start by increasing the offset before  @systemnd then adjust all the partition offsets after that too.
This should be for 2GB system partition.

/device/rockchip/rk3328/rk3328_box/parameter.txt
CMDLINE: androidboot.baseband=N/A androidboot.selinux=disabled androidboot.hardware=rk30board androidboot.console=ttyFIQ0 init=/init mtdparts=rk29xxnand:[email protected](uboot),[email protected](trust),[email protected](misc),[email protected](resource),[email protected](kernel),[email protected](boot),[email protected](recovery),[email protected](backup),[email protected](cache),[email protected](system),[email protected](metadata),[email protected](baseparamer),[email protected](userdata)

[email protected](system)
before @ is the size, after @ is the location.
0x00400000 in hex is 4194304 decimal * 512 / 1024 / 1024 = 2048MB(2GB)
0x000B2000(old location) + 0x00400000(size) = 0x004B2000 (The same as the new location of metadata)
So adjust al the locations of partitions metadata, baseparameter, userdata after system too.


RE: AOSP Build Steps Using github.com/rock64-linux - birender.s - 09-02-2017

MicroSD card Flash.
1. rock64_20170809_stock_android_7.1.2_sdboot.img is getting flashed properly.
2. https://github.com/ayufan-rock64/android-7.1/releases/download/0.2.17/android-7.1-rock-64-rock64_atv-v0.2.17-r79.zip causing issue in flash.
3. Local build is causing same flash issue as in step 2.

Error
Invalid archive image
The archive should contain one and only one top image file.

Please help to convert as done in:
https://github.com/ayufan-rock64/android-7.1/releases/download/0.2.17/android-7.1-rock-64-rock64_atv-v0.2.17-r79.zip
to
https://github.com/ayufan-rock64/android-7.1/releases/download/0.2.17/android-7.1-rock-64-rock64_atv-v0.2.17-r79-raw.img.gz
=======================================================
Need method to generate proper .img file
xz -z Image-rock64_atv.img
=======================================================


RE: AOSP Build Steps Using github.com/rock64-linux - birender.s - 09-03-2017

========================================================================================
Copied ./RKTools/linux/Linux_Pack_Firmware/rockdev files into
./rockdev
renamed Image-rock64_regular folder to Image.
./mkupdate.sh

update.img 1.6GB generated
but android-7.1-rock-64-rock64_atv-v0.2.17-r79-raw.img is 2GB
update.img still not working.
========================================================================================
Decoded
https://jenkins.ayufan.eu/blue/organizations/jenkins/android-7.1-rock-64/detail/android-7.1-rock-64/79/pipeline/40/

for below commands
./mkimage.sh
cp vendor/ayufan/rockchip/idbloader.img rockdev/Image-rock64_atv/
vendor/ayufan/rockchip/rkimage rockdev/Image-rock64_atv/ rockdev/Image-rock64_atv-raw.img
========================================================================================