Many were very sad when google chose not to update Nexus 10 to Android 6.0 Marshmallow. This simple guide will show you how to build Android 6.0 Marshmallow for Nexus 10. And for the lazy, I also have a pre-built AOSP Marshmallow image set to download on the bottom of this page. Since Nexus 10 was originally a Google-Play-equipped device, you can legally install Google Apps on this image and enjoy a full Google Android 6.0 experience on your Nexus 10. That part, however, is up to you to do yourself. I am not offering GApps downloads here.
For fun, to make this work a few very cool hacks had to be done, read further below in the "cool hacks" section about them, if you care.
#grab M(6.0) and L(5.1.1) android trees, into folders called M and L respectively #get manta's kernel sources for 5.1.1 git clone https://android.googlesource.com/kernel/exynos.git cd exynos git checkout remotes/origin/android-exynos-manta-3.4-lollipop-mr1 #apply kernel patch git apply ../kernel.patch #build kernel export CROSS_COMPILE=`pwd`/../M/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi- export ARCH=arm make manta_defconfig make -j4 #get to work on M userspace cd M #get blobs wget https://dl.google.com/dl/android/aosp/audience-manta-lmy48t-ebbd0e38.tgz wget https://dl.google.com/dl/android/aosp/broadcom-manta-lmy48t-bed1fa3f.tgz wget https://dl.google.com/dl/android/aosp/samsung-manta-lmy48t-2c3015ac.tgz tar xvfz audience-manta-lmy48t-ebbd0e38.tgz tar xvfz broadcom-manta-lmy48t-bed1fa3f.tgz tar xvfz samsung-manta-lmy48t-2c3015ac.tgz dd if=extract-audience-manta.sh bs=14452 skip=1 | tar xvz dd if=extract-broadcom-manta.sh bs=14464 skip=1 | tar xvz dd if=extract-samsung-manta.sh bs=14463 skip=1 | tar xvz rm *.tgz extract-*-manta.sh #get pieces that we need from L mkdir device/samsung rm -rf hardware/invensense cp -Rvf ../L/hardware/samsung_slsi hardware/ cp -Rvf ../L/hardware/invensense hardware/ cp -Rvf ../L/device/samsung/manta device/samsung/ cp -Rvf ../L/external/stlport external/ #put the new kernel into place cp ../exynos/arch/arm/boot/zImage device/samsung/manta/kernel #apply cool binary patch echo -n dmitry | dd bs=1 seek=8211 conv=notrunc of=device/samsung/manta/gps/gpsd #apply source patches cd device/samsung/manta git apply ../../../device-samsung-manta.patch cd ../../../hardware/broadcom/libbt git apply ../../../hardware-broadcom-libbt.patch cd ../../invensense git apply ../../hardware-invensense.patch cd ../samsung_slsi/exynos5 git apply ../../../hardware-samsung_slsi-exynos5.patch cd ../../../vendor git apply ../vendor.patch cd .. #build it source build/envsetup.sh lunch aosp_manta-userdebug make -j4
Problems:
Curious information: Due to peculiarities of the ELF format, when a binary baz imports function foo() from libbar.so, nowhere in baz's ELF file does it say that foo() must from from libbar. In fact there are two separate records. One that says that libbar is "NEED"ed, and another that says that there is an import of function "foo". What that means is that if the process were to also load libxyz, which also exported foo(), there is no way to be sure which foo() would get called. Why do we care? Well, consider our problems above. We need to provide functions and variables that existing libraries no longer do. How?
A tricky but clever solution: INTERPOSITION library
Result: GPS library works on M, with the help of libdmitry and a small binary patch to the GPS library itself (replacing one of the "NEED" records with a NEED record for "libdmitry")