|
|
@ -8,49 +8,54 @@ |
|
|
|
|
|
|
|
# Required: aosp-devel packages |
|
|
|
# https://aur.archlinux.org/packages/aosp-devel/ |
|
|
|
ROOTDIR="${PWD}" |
|
|
|
|
|
|
|
WORKDIR="${PWD}/aosp" |
|
|
|
|
|
|
|
rm -rf ${WORKDIR}/out/* |
|
|
|
if [ ! -d "${WORKDIR}" ]]; then |
|
|
|
mkdir -p "${WORKDIR}" |
|
|
|
fi |
|
|
|
|
|
|
|
rm -rf "${WORKDIR}"/out/* |
|
|
|
|
|
|
|
ln -s /usr/bin/python2 ./python |
|
|
|
export PATH=$PWD:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl |
|
|
|
|
|
|
|
cd ${WORKDIR} |
|
|
|
|
|
|
|
# This takes A LOT of time, since ~280GiB must be downloaded. |
|
|
|
# Full Android source code with all commit histories etc. This is not a shallow copy. |
|
|
|
# TODO this manifest file contains old Android version tag. Should be replaced with android-9.0.0_r57 or newer |
|
|
|
# For available versions, see i.e.: https://android.googlesource.com/platform/frameworks/support |
|
|
|
repo init -u https://github.com/anbox/platform_manifests.git -b anbox |
|
|
|
repo sync -j6 |
|
|
|
cd "${WORKDIR}" |
|
|
|
|
|
|
|
sudo pacman -S repo |
|
|
|
#sudo pacman -S repo |
|
|
|
|
|
|
|
# Check all deps of AUR pkg aosp-devel are installed (/home/fincer/ssd/arch_linux_programs/aosp-devel) |
|
|
|
# Get & sync AOSP source code, shallow copy ~ 27.2 GB |
|
|
|
# |
|
|
|
repo init -u https://github.com/anbox/platform_manifests.git -b anbox --depth 1 |
|
|
|
repo sync -j6 -c |
|
|
|
|
|
|
|
cd /media/a2ee7134-4f0e-4aa7-a12e-ee2b949fbb0b/ |
|
|
|
# Check manually all deps of AUR pkg aosp-devel are installed (/home/fincer/ssd/arch_linux_programs/aosp-devel) |
|
|
|
|
|
|
|
# Not merged, as of 6th June 2020 |
|
|
|
# Audio timing fix: |
|
|
|
# https://github.com/anbox/anbox/pull/1034 |
|
|
|
|
|
|
|
cp -f ./patch_audio01_timing.patch aosp/vendor/patch_audio01_timing.patch |
|
|
|
cp -f ./patch_audio02_pass-messenger.patch aosp/vendor/patch_audio02_pass-messenger.patch |
|
|
|
# Web view fix: |
|
|
|
# https://github.com/anbox/anbox/pull/1875 |
|
|
|
|
|
|
|
cp -f ./patch_initcgroups.patch aosp/patch_initcgroups.patch |
|
|
|
cp -f "${ROOTDIR}"/patch_audio01_timing.patch "${WORKDIR}"/vendor/ |
|
|
|
cp -f "${ROOTDIR}"/patch_audio02_pass-messenger.patch "${WORKDIR}"/vendor/ |
|
|
|
cp -f "${ROOTDIR}"/patch_fix-webview.patch "${WORKDIR}"/vendor/ |
|
|
|
|
|
|
|
cp -f "${ROOTDIR}"/patch_initcgroups.patch "${WORKDIR}"/ |
|
|
|
|
|
|
|
# Disable foreground/background activity checks and functionality of built-in Gallery apps for Desktop use |
|
|
|
# Comment onPause and onResume functions and related parts |
|
|
|
# This helps when using multiple apps simultaneosly and playing a video/music track. Originally, |
|
|
|
# playback pauses which is not a wanted feature in desktop Android. In this patch, we disable all relevant code |
|
|
|
# parts which cause this pause. |
|
|
|
cp -f ./patch_gallery2_no-activity-checks.patch aosp/patch_gallery2_no-activity-checks.patch |
|
|
|
cp -f "${ROOTDIR}"/patch_gallery2_no-activity-checks.patch "${WORKDIR}"/ |
|
|
|
|
|
|
|
cd ${WORKDIR}/vendor/anbox |
|
|
|
cd "${WORKDIR}"/vendor/anbox |
|
|
|
patch -Np1 -i ../patch_audio01_timing.patch |
|
|
|
patch -Np1 -i ../patch_audio02_pass-messenger.patch |
|
|
|
cd ${WORKDIR} |
|
|
|
patch -Np1 -i ../patch_fix-webview.patch |
|
|
|
cd "${WORKDIR}" |
|
|
|
|
|
|
|
# We don't have several cgroups in native Linux. Avoid unnecessary kernel errors. |
|
|
|
# Disabled 'schedtune' cgroup as it targets Android ARM devices. Reason for it is to |
|
|
@ -63,33 +68,32 @@ cd ${WORKDIR} |
|
|
|
patch -Np1 -i ./patch_initcgroups.patch |
|
|
|
|
|
|
|
# Already merged, as of 6th June 2020 |
|
|
|
# |
|
|
|
# Server side decoration fix: |
|
|
|
# https://github.com/anbox/anbox/pull/1415 |
|
|
|
#ln -s patch_serversidedecoration.patch aosp/vendor/patch_serversidedecoration.patch |
|
|
|
|
|
|
|
patch -Np1 -i ./patch_gallery2_no-activity-checks.patch |
|
|
|
|
|
|
|
# archlinux-java set java-8-openjdk |
|
|
|
|
|
|
|
archlinux-java set java-8-openjdk |
|
|
|
|
|
|
|
cd ${WORKDIR}/ |
|
|
|
. build/envsetup.sh |
|
|
|
lunch anbox_x86_64-userdebug |
|
|
|
cd "${WORKDIR}" |
|
|
|
|
|
|
|
# Disable JACK |
|
|
|
sed -i -r 's/(ANDROID_COMPILE_WITH_JACK := )true/\1false/' ${WORKDIR}/build/core/combo/javac.mk |
|
|
|
source build/envsetup.sh |
|
|
|
lunch anbox_x86_64-userdebug |
|
|
|
|
|
|
|
#export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx2G" |
|
|
|
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx2G" |
|
|
|
|
|
|
|
# RUN THIS IN SEPARATE SHELL! |
|
|
|
# Jack server must be run during compilation process |
|
|
|
#while true; do |
|
|
|
# sleep 2 |
|
|
|
# if [ -f aosp/out/host/linux-x86/bin/jack-admin ]; then |
|
|
|
# aosp/out/host/linux-x86/bin/jack-admin start-server |
|
|
|
# break |
|
|
|
# fi |
|
|
|
#done |
|
|
|
while true; do |
|
|
|
sleep 2 |
|
|
|
if [ -f aosp/out/host/linux-x86/bin/jack-admin ]; then |
|
|
|
aosp/out/host/linux-x86/bin/jack-admin start-server |
|
|
|
break |
|
|
|
fi |
|
|
|
done |
|
|
|
|
|
|
|
LC_ALL=C make -j$(nproc --ignore 1) |
|
|
|
|
|
|
@ -100,9 +104,16 @@ if [[ $? -eq 0 ]]; then |
|
|
|
rm -rf $HOME/.jack-server |
|
|
|
fi |
|
|
|
|
|
|
|
cd $WORKDIR/vendor/anbox/ |
|
|
|
# Once compiled, do the following: |
|
|
|
|
|
|
|
cd "${WORKDIR}"/vendor/anbox/ |
|
|
|
scripts/create-package.sh ${PWD}/../../out/target/product/x86_64/ramdisk.img ${PWD}/../../out/target/product/x86_64/system.img |
|
|
|
# Image will locate at aosp/vendor/anbox/android.img |
|
|
|
# This image will locate at aosp/vendor/anbox/android.img |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|