AOSP 14 - sailfishos-sony-nagara/main GitHub Wiki

At this moment, building AOSP 14 and booting would require patching one binary. But the building and booting otherwise may not require any patches:

  • Use android-14_r67 branch. That means repo init as well as local_manifests have to be on that branch

  • As usual: repo sync -c -j8 && ./repo_update.sh . Make sure that all is synced and and checked out

  • Avoid starting FPC (vendor/oss/fingerprint):

diff --git a/[email protected] b/[email protected]
index 1669dd1..075d1fd 100644
--- a/[email protected]
+++ b/[email protected]
@@ -1,7 +1,7 @@
-service fps_hal /vendor/bin/hw/[email protected]
-    # "class hal" causes a race condition on some devices due to files created
-    # in /data. As a workaround, postpone startup until later in boot once
-    # /data is mounted.
-    class late_start
-    user system
-    group system input uhid
+#service fps_hal /vendor/bin/hw/[email protected]
+#    # "class hal" causes a race condition on some devices due to files created
+#    # in /data. As a workaround, postpone startup until later in boot once
+#    # /data is mounted.
+#    class late_start
+#    user system
+#    group system input uhid
diff --git a/hardware/health/CycleCountBackupRestore.cpp b/hardware/health/CycleCountBackupRestore.cpp
index 2207f60..cd305c6 100644
--- a/hardware/health/CycleCountBackupRestore.cpp
+++ b/hardware/health/CycleCountBackupRestore.cpp
@@ -92,6 +92,9 @@ void CycleCountBackupRestore::Read(const std::string &path, int &cycles) {
     } catch (std::invalid_argument &e) {
         LOG(WARNING) << "Data format is wrong in persist storage file: " << path;
         return;
+    } catch (...) {
+        LOG(WARNING) << "Data format is wrong in persist storage file and exception sneaked through: " << path;
+        return;
     }
     LOG(VERBOSE) << "Read " << cycles << " battery cycles from " << path;
 }
  • At this stage you can start building

  • While building, patch SW binaries (BLOBS):

mkdir blobs
simg2img aosp-14/SW_binaries.img aosp-14/SW_binaries.raw
sudo mount -o loop aosp-14/SW_binaries.raw blobs
sudo -i 
## as root
# cd blobs/bin/hw/
# patchelf --add-needed android.hardware.security.rkp-V3-ndk.so android.hardware.security.keymint-service-qti
# exit root
sudo umount blobs
img2simg aosp-14/SW_binaries.raw aosp-14/SW_binaries.patched.img
  • Flash patched SW binaries and, when AOSP14 is ready, its images as usual

  • Wipe data

Now it should boot into AOSP14.