jimmy947788 / android_device_brcm_rpi4

lineageos 16.0 for Raspberry Pi4 device project
9 stars 2 forks source link

LineageOS 16.0 device configuration for Raspberry Pi 4.

說明

這是LineageOS 16.0 使用 Raspberry Pi 4 的編譯設定環境,相關說明和操作參考

不用master branch 了

操作說明文件

修正問題

  1. lunch lineage_rpi4-userdebug 找不到 device 參考官方
  2. bootloader 無法載入zImage (linux kernel)
    • 修改config.txt不要用位址的方式去定位zImage
  3. 修正wifi無法正常運作
    • 修改rpi4.mk 編譯時指定wifi需要用到的packages
      # WIFI
      PRODUCT_PACKAGES += \
      android.hardware.wifi@1.0-service \
      hostapd \
      wpa_supplicant
    • 修改init.rpi4.rc 啟動wpa_supplicant 參數
      service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
          -O/data/vendor/wifi/wpa/sockets \
          -g@android:wpa_wlan0
          interface android.hardware.wifi.supplicant@1.0::ISupplicant default
          interface android.hardware.wifi.supplicant@1.1::ISupplicant default
          class main
          socket wpa_wlan0 dgram 660 wifi wifi
          disabled
          oneshot
    • 修改manifest.xml 載入wifi相關packages
      <hal format="hidl">
              <name>android.hardware.wifi</name>
              <transport>hwbinder</transport>
              <version>1.2</version>
              <interface>
                  <name>IWifi</name>
                  <instance>default</instance>
              </interface>
          </hal>
          <hal format="hidl">
              <name>android.hardware.wifi.hostapd</name>
              <transport>hwbinder</transport>
              <version>1.0</version>
              <interface>
                  <name>IHostapd</name>
                  <instance>default</instance>
              </interface>
          </hal>
          <hal format="hidl">
              <name>android.hardware.wifi.supplicant</name>
              <transport>hwbinder</transport>
              <version>1.1</version>
              <interface>
                  <name>ISupplicant</name>
                  <instance>default</instance>
              </interface>
          </hal>
  4. 修正bluetooth無法正常運作
    • 使用KonstaKANG提供的lieageOS-16.0映像,提取可以用的bluetooth 1.0服務
    • 新增bluetooth 1.0 啟動服務檔案 bluetooth@1.0-service.rpi4.rc
    • 修改manifest.xml 載入bluetooth相關packages
      <hal format="hidl">
          <name>android.hardware.bluetooth</name>
          <transport>hwbinder</transport>
          <version>1.0</version>
          <interface>
              <name>IBluetoothHci</name>
              <instance>default</instance>
          </interface>
      </hal>
  5. 修正health服務無法正常啟動 (無法正常進入Android)
    • 使用KonstaKANG提供的lieageOS-16.0映像,提取可以用的health 2.0服務
    • 新增health 2.0啟動服務檔案 health@2.0-service.rpi4.rc
    • 修改manifest.xml 載入health相關packages
      <hal format="hidl">
          <name>android.hardware.health</name>
          <transport>hwbinder</transport>
          <version>2.0</version>
          <interface>
              <name>IHealth</name>
              <instance>default</instance>
          </interface>
      </hal>
  6. 修正DRM服務無法正常啟動
    • 修改rpi4.mk 編譯時指定wifi需要用到的packages
      # DRM
      PRODUCT_PACKAGES += \
      android.hardware.drm@1.0-impl \
      android.hardware.drm@1.0-service
    • 修改manifest.xml 載入health相關packages
      <hal format="hidl">
          <name>android.hardware.drm</name>
          <transport>hwbinder</transport>
          <version>1.0</version>
          <interface>
              <name>ICryptoFactory</name>
              <instance>widevine</instance>
              <instance>default</instance>
          </interface>
          <interface>
              <name>IDrmFactory</name>
              <instance>widevine</instance>
              <instance>default</instance>
          </interface>
      </hal>
  7. 修正configstore服務無法正常啟動
    • 修改rpi4.mk 編譯時指定wifi需要用到的packages
      # configstore
      PRODUCT_PACKAGES += \
          android.hardware.configstore@1.1-service
    • 修改manifest.xml 載入health相關packages
      <hal format="hidl">
          <name>android.hardware.configstore</name>
          <transport>hwbinder</transport>
          <version>1.1</version>
          <interface>
              <name>ISurfaceFlingerConfigs</name>
              <instance>default</instance>
          </interface>
      </hal>

      已知問題

  8. 重開機後Apps Icon會不見
  9. 無法adb連線

    error: device unauthorized. \ This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong. \ Otherwise check for a confirmation dialog on your device.

  10. 無法root進入系統
  11. 未整併TFT LCD觸控螢幕
  12. 未整併Pi Camera