Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate GSI #146

Open
Benjamin-Loison opened this issue Dec 24, 2024 · 104 comments
Open

Investigate GSI #146

Benjamin-Loison opened this issue Dec 24, 2024 · 104 comments

Comments

@Benjamin-Loison
Copy link
Owner

Benjamin-Loison commented Dec 24, 2024

a GSI does not include device manufacturer's customizations

Because of this, you might encounter behavioral differences in the following situations:
Workflows that request newer hardware features

Check device compliance

GSIs can only function on devices with the following characteristics:

  • Bootloader is unlocked.
  • Fully Treble-compliant.
  • Launched with Android 9 (API level 28) or higher. Devices upgraded to Android 9 from an earlier version might or might not support GSIs.

To determine whether your device can use a GSI and which GSI OS version you should install, do the following:

(see the website)

Source: https://developer.android.com/topic/generic-system-image/#device-compliance

On my Fairphone 4 LineageOS:

adb shell getprop ro.treble.enabled
true

Source: https://developer.android.com/topic/generic-system-image/

@Benjamin-Loison
Copy link
Owner Author

treble_aosp may help.

@Benjamin-Loison
Copy link
Owner Author

Related to Benjamin-Loison/waydroid/issues/16 and #25.

@Benjamin-Loison
Copy link
Owner Author

adb shell ls /system/etc/*.txt
Output:
/system/etc/llndk.libraries.txt
/system/etc/public.libraries.txt
/system/etc/sanitizer.libraries.txt
/system/etc/vndkcorevariant.libraries.txt

@Benjamin-Loison
Copy link
Owner Author

adb shell ls /system/etc/ld*
ls: /system/etc/ld*: No such file or directory

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

Android Generic System Images (GSIs) are for app developers to perform app validation and for development purposes. You shouldn't redistribute GSIs or use them in any other way except as specifically set forth in the license terms enclosed in each individual download.

Source: https://developer.android.com/topic/generic-system-image/releases

So it does not seem to be appropriate for daily use.

@Benjamin-Loison
Copy link
Owner Author

https://developer.android.com/topic/generic-system-image/#download-gsi seems to propose 2 releases, one without GMS and one with.

The following are core applications that are part of Google Mobile Services:

So maybe it does not contain the hardware features like SMS and calls.

@Benjamin-Loison
Copy link
Owner Author

adb shell getprop ro.product.cpu.abi
arm64-v8a

@Benjamin-Loison
Copy link
Owner Author

Android 15 GSI binaries have the following GSI-specific known issues:

  • Bluetooth audio: In some cases, Bluetooth audio can't be heard after pairing a new device.
  • Power Cycle: Rebooting GSI might fail on some devices. To work around it, reboot the device into recovery mode, erase user data, perform a factory reset, and then reboot the device.

Source: https://developer.android.com/topic/generic-system-image/releases#known-issue-15

@Benjamin-Loison
Copy link
Owner Author

Should read Terms and Conditions when downloading.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

curl -I 'https://dl.google.com/developers/android/vic/images/gsi/aosp_arm64-exp-AP3A.241005.015-12366759-3c0ee79d.zip'
Output:
HTTP/2 200 
accept-ranges: bytes
content-disposition: attachment
content-security-policy: default-src 'none'
server: downloads
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
date: Tue, 24 Dec 2024 21:01:37 GMT
cache-control: public,max-age=86400
last-modified: Tue, 15 Oct 2024 16:09:15 GMT
etag: "344f4c9"
content-type: application/zip
vary: Origin
content-length: 867207506
age: 0
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

So 867 MB without GMS and 1.5 GB with:

curl -I 'https://dl.google.com/developers/android/vic/images/gsi/gsi_gms_arm64-exp-AP3A.241005.015-12366759-0fdc93fe.zip'
Output:
HTTP/2 200 
accept-ranges: bytes
cache-control: public,max-age=86400
content-disposition: attachment
content-length: 1572756018
content-security-policy: default-src 'none'
content-type: application/zip
etag: "344f4cc"
last-modified: Tue, 15 Oct 2024 16:09:15 GMT
server: downloads
vary: Origin
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
date: Tue, 24 Dec 2024 21:03:32 GMT
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

@Benjamin-Loison
Copy link
Owner Author

It's considered a pure Android implementation with unmodified Android Open Source Project (AOSP) code that any Android device running Android 9 or higher can run successfully.

Source: https://source.android.com/docs/core/tests/vts/gsi

@Benjamin-Loison
Copy link
Owner Author

GSIs are used for running VTS and CTS-on-GSI tests. The system image of an Android device is replaced with a GSI then tested with the Vendor Test Suite (VTS) and the Compatibility Test Suite (CTS) to ensure that the device implements vendor interfaces correctly with the latest version of Android.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

The person:
-----BEGIN PGP MESSAGE-----

hF4DTQa9Wom5MBgSAQdA2u2/HkEHjtMsYaJVJM2t/uUbNxt/tg9jA5pDtJLQVnIw
nX8ozaZKl5scKj8D98oTls3lcd8vc8qrVqDLsT+MTHYeIyPl6Xar6cH0nuVNcX6G
1EsBCQIQdl0XxYSEXBoSgcUjvZ8gTU26JUQTsWUlPHoMbJxPz8AkruYeRx/HwpWr
7npuhuiTyh9J2mbYR18eFgsGgOqOq949akN4ZLQ=
=kZjH
-----END PGP MESSAGE-----

has a supported Pixel 8, source: https://developer.android.com/topic/generic-system-image/releases#15-qpr1-stable

@Benjamin-Loison
Copy link
Owner Author

Android Flash Tool lets you securely flash a system image to your supported Pixel device. Android Flash Tool works with any Web browser that supports WebUSB, such as Chrome or Edge 79+.

@Benjamin-Loison
Copy link
Owner Author

@Benjamin-Loison
Copy link
Owner Author

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

https://flash.android.com/preview/vic-qpr1-gsi-gms

It works fine on Chromium.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

@Benjamin-Loison
Copy link
Owner Author

@Benjamin-Loison
Copy link
Owner Author

@Benjamin-Loison
Copy link
Owner Author

The GSI includes full support for the AIDL/HIDL-based architectural changes (also known as Treble)

https://source.android.com/docs/core/architecture/hal

@Benjamin-Loison
Copy link
Owner Author

Android 11 introduced the DSU Loader, a tool available in the device's developer options that lets you download, install, and manage GSIs entirely through the system's UI.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

image

With GSI:

  • I have Android 15 while I only have Android 14 on my Fairphone 4
  • Camera front/back results in Camera keeps stopping on Fairphone 4 but works on Pixel 8
  • Call is received by the other person but I don't hear it and he does not hear me, same with tel:888 (camera and dialer have not requested {Mic,Camera} access and I have not found them as tiles.
  • I am unable to send an SMS, as I face a To send, set Messaging as the default SMS app loop. For receiving I do not receive an SMS.
  • Google Search works fine on 4G
  • Flashlight works fine
  • Wifi works fine as well
  • Organic Maps location does not work inside a building. Google Maps locates well on the Pixel 8 but maybe it is leveraging the wifi (but not the GSM as do not have a SIM card).
  • Auto-rotate works fine
  • YouTube through Google Search has a working audio
  • Microphone and earphone speaker do not work I guess then
  • Bluetooth works fine to play audio
  • Internet access provided to my Linux Mint 22 Cinnamon Framework 13 works fine through the GSI hotspot

As it is pretty easy to try should try on given device to ensure that it does not work as wanted.

To complete tests for Pixel 8 (other things work fine):

  • Bluetooth: detect other devices but does not seem to work, Misc features->Force-disable A2DP offload (fixes Bluetooth audio) does not help even after restart (after restart it is shown as toggled as expected), source: treble_experimentations/wiki/Xiaomi-Redmi-Note-9/36573059cd6b119f5aff45e15040d883875b4a5f#fixing-bugs. I suspect that it silently crashes. It does not work too with another Bluetooth device. Bluetooth audio: In some cases, Bluetooth audio can't be heard after pairing a new device. source: https://developer.android.com/about/versions/15/gsi-release-notes#known-issues (Developer options > Bluetooth settings starting at LE audio to Audio LDAC Codec: Playback Quality match if enabled). DuckDuckGo and Google search "GSI" "Pixel 8" "Bluetooth" does not seem interesting. (does not work fine on host GSI on Pixel 8)
  • hotspot: works fine but only proposes WPA2 contrarily to my Fairphone 4 LineageOS (so not GSI) WPA3, related to Benjamin_Loison/windows/issues/62.
  • SMS send, receive: complain about previous Android version, receives but unable to send, termux-sms-send works fine
  • call (hear and remote hear): works fine
  • 4G: it works fine
  • fingerprint: works fine

On stock Pixel 8 Android 15 (AP4A.241205.013, Dec 2024, source: https://developers.google.com/android/ota#shiba) Bluetooth works fine. Possibly it is mandatory to use NFC for the pairing of the headset. Even with NFC the phone vibrates but no new entry or prompt is shown for Bluetooth headset.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

On Xiaomi Mi A3 it seems:

image

Every option results in:

image

@Benjamin-Loison
Copy link
Owner Author

Should try other SMS and dialer apps to make sure but I am not keen with not default ones.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

With aosp_arm64-exp-AP4A.241205.013-12621605-14e72a7c.zip:

simg2img system.img system_raw.img
Output:
Command 'simg2img' not found, but can be installed with:
sudo apt install android-sdk-libsparse-utils

@Benjamin-Loison
Copy link
Owner Author

sudo apt install android-sdk-libsparse-utils -y
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  android-sdk-libsparse-utils
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 19.7 kB of archives.
After this operation, 100 kB of additional disk space will be used.
Get:1 http://mirrors.ircam.fr/pub/ubuntu/archive noble/universe amd64 android-sdk-libsparse-utils amd64 1:34.0.4-1build3 [19.7 kB]
Fetched 19.7 kB in 0s (160 kB/s)                       
Selecting previously unselected package android-sdk-libsparse-utils.
(Reading database ... 964493 files and directories currently installed.)
Preparing to unpack .../android-sdk-libsparse-utils_1%3a34.0.4-1build3_amd64.deb ...
Unpacking android-sdk-libsparse-utils (1:34.0.4-1build3) ...
Setting up android-sdk-libsparse-utils (1:34.0.4-1build3) ...

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

simg2img system.img system_raw.img
Output:
Invalid sparse file format at header magic
Failed to read sparse file
mv system.img system_raw.img

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Dec 24, 2024

time gzip -c system_raw.img > system_raw.gz
Output:
real	0m59.290s
user	0m57.792s
sys	0m1.417s

@Benjamin-Loison
Copy link
Owner Author

See on my Linux Mint 22 Cinnamon Framework 13 /home/benjamin_loison/Desktop/bens_folder/people/CENSORED/CENSORED/11_01_25.txt.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 11, 2025

https://wiki.lineageos.org/devices/jasmine_sprout/
https://wiki.lineageos.org/devices/FP4/build/

Let us try build LineageOS GSI.

Is there a way to list build targets? which breakfast may help.

mkdir -p ~/android/lineage
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
ccache -M 50G
Set cache size limit to 50.0 GB
repo init -u https://github.com/LineageOS/android.git -b lineage-22.1 --git-lfs --no-clone-bundle
Output:
Downloading Repo source from https://gerrit.googlesource.com/git-repo
remote: Total 9045 (delta 4329), reused 9045 (delta 4329)

... A new version of repo (2.50) is available.
... New version is available at: /home/benjamin_loison/android/lineage/.repo/repo/repo
... The launcher is run from: /usr/bin/repo
!!! The launcher is not writable.  Please talk to your sysadmin or distro
!!! to get an update installed.


Your identity is: Benjamin Loison <[email protected]>
If you want to change this, please re-run 'repo init' with --config-name

repo has been initialized in /home/benjamin_loison/android/lineage
date && time repo sync; matrix-commander -m 'Sync finished!'
Output:
Sat Jan 11 04:34:56 PM CET 2025

... A new version of repo (2.50) is available.
... New version is available at: /home/benjamin_loison/android/lineage/.repo/repo/repo
... The launcher is run from: /usr/bin/repo
!!! The launcher is not writable.  Please talk to your sysadmin or distro
!!! to get an update installed.

Fetching: 100% (1469/1469), done in 35m43.972s
device/qcom/sepolicy: Shared project LineageOS/android_device_qcom_sepolicy found, disabling pruning.
device/qcom/sepolicy_vndr/legacy-um: Shared project LineageOS/android_device_qcom_sepolicy_vndr found, disabling pruning.
hardware/qcom-caf/msm8953/audio: Shared project LineageOS/android_hardware_qcom_audio found, disabling pruning.
hardware/qcom-caf/msm8953/display: Shared project LineageOS/android_hardware_qcom_display found, disabling pruning.
hardware/qcom-caf/msm8953/media: Shared project LineageOS/android_hardware_qcom_media found, disabling pruning.
hardware/qcom-caf/sm8450/audio/agm: Shared project LineageOS/android_vendor_qcom_opensource_agm found, disabling pruning.
hardware/qcom-caf/sm8450/audio/pal: Shared project LineageOS/android_vendor_qcom_opensource_arpal-lx found, disabling pruning.
hardware/qcom-caf/sm8450/audio/primary-hal: Shared project LineageOS/android_hardware_qcom_audio-ar found, disabling pruning.
hardware/qcom-caf/sm8450/data-ipa-cfg-mgr: Shared project LineageOS/android_vendor_qcom_opensource_data-ipa-cfg-mgr found, disabling pruning.
hardware/qcom-caf/wlan: Shared project LineageOS/android_hardware_qcom_wlan found, disabling pruning.
Updating files: 100% (10543/10543), done.lopers/buildUpdating files:  96% (10182/10543)
Updating files: 100% (455/455), done.external/TestParameterInjectorUpdating files:  99% (452/455)
Updating files: 100% (8722/8722), done.ternal/aacUpdating files:  95% (8316/8722)
Updating files: 100% (11718/11718), done.roid_external_arm-trusted-firmwareUpdating files:  79% (9367/11718)
Updating files: 100% (2421/2421), done.
Updating files: 100% (497/497), done./external/blktraceUpdating files:  62% (18168/29303)
Updating files: 100% (29303/29303), done.ernal/boringsslUpdating files:  74% (21685/29303)
Updating files: 100% (45347/45347), done.ernal/crcalcUpdating files:  33% (15402/45347)
Updating files: 100% (9514/9514), done.xternal/f2fs-toolsUpdating files:  97% (9247/9514)
Updating files: 100% (7561/7561), done.xternal/gsc-utilsUpdating files: 100% (7561/7561)
Updating files: 100% (6272/6272), done.xternal/jackson-coreUpdating files:  85% (13351/15706)
Updating files: 100% (15706/15706), done.ernal/intel-media-driverUpdating files:  82% (49195/59993)
Updating files: 100% (59993/59993), done.ernal/kotlinx.atomicfuUpdating files:  83% (13365/16102)
Updating files: 100% (16102/16102), done.droid_external_kotlinx.serializationUpdating files:  99% (15941/16102)
Updating files: 100% (21683/21683), done.ernal/ms-tpm-20-refUpdating files:  99% (21467/21683)
Updating files: 100% (10640/10640), done.ernal/pandora/avatarUpdating files: 100% (10640/10640)
Updating files: 100% (3025/3025), done.xternal/rust/crates/futures-macroUpdating files:  95% (2874/3025)
Updating files: 100% (29004/29004), done.ernal/volleyUpdating files:  55% (7875/14317)
Updating files: 100% (14317/14317), done.ernal/wmediumdUpdating files:  93% (13315/14317)
Updating files: 100% (8902/8902), done.android_external_zstdUpdating files:  70% (6232/8902)
Updating files: 100% (410/410), done.prebuilts/6.6/x86-64Updating files:  59% (242/410)
Updating files: 100% (618/618), done.
Updating files: 100% (124/124), done.prebuilts/common-modules/virtual-device/mainline/arm64Updating files:  69% (86/124)
Updating files: 100% (288/288), done.OS/wwwUpdating files:  59% (171/288)
Updating files: 100% (54961/54961), done.ckages/modules/ModuleMetadataUpdating files: 100% (54961/54961)
Updating files: 100% (1028/1028), done.pdkUpdating files:  48% (503/1028)
Updating files: 100% (7694/7694), done./android_packages_modules_VirtualizationUpdating files:  66% (5110/7694)
Updating files: 100% (33/33), done.orm/prebuilts/bazel/linux-x86_64Updating files:  17% (138/809)
Updating files: 100% (6788/6788), done.prebuilts/checkstyleUpdating files:  22% (1762/7810)
Updating files: 100% (809/809), done.m/prebuilts/build-toolsUpdating files:  60% (4686/7810)
Updating files: 100% (7810/7810), done.prebuilts/android-emulatorUpdating files:  96% (7498/7810)
Updating files: 100% (3960/3960), done.prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8Updating files:  85% (3383/3960)
Updating files: 100% (5589/5589), done./android_prebuilts_gcc_linux-x86_x86_x86_64-linux-android-4.9Updating files:  18% (6110/32856)
Updating files: 100% (684/684), done.m/prebuilts/gradle-pluginUpdating files:   4% (548/13689)
Updating files: 100% (13689/13689), done.ebuilts/jdk/jdk8Updating files:  43% (5887/13689)
Updating files: 100% (1290/1290), done.prebuilts/module_sdk/WifiUpdating files:  24% (8090/32856)
Updating files: 100% (159/159), done.m/prebuilts/ndkUpdating files:  54% (251/460)
Updating files: 100% (3002/3002), done.prebuilts/r8Updating files:  41% (13471/32856)
Updating files: 100% (941/941), done.m/prebuilts/module_sdk/artUpdating files:  99% (937/941)
Updating files: 100% (460/460), done.m/prebuilts/remoteexecution-clientUpdating files:  58% (271/460)
Updating files: 100% (11084/11084), done.ebuilts/miscUpdating files:   0% (168/22862)
Updating files: 100% (1055/1055), done.prebuilts/runtimeUpdating files:  49% (16251/32856)
Updating files: 100% (2101/2101), done./android_prebuilts_tools-lineageUpdating files:  53% (17414/32856)
Updating files: 100% (21272/21272), done.ebuilts/vndk/v29Updating files:  67% (22014/32856)
Updating files: 100% (18265/18265), done.ebuilts/vndk/v30Updating files:  68% (22372/32856)
Updating files: 100% (18387/18387), done.ebuilts/vndk/v31Updating files:   4% (947/22862)
Updating files: 100% (30673/30673), done.ebuilts/vndk/v32Updating files:  16% (2367/14789)
Updating files: 100% (19651/19651), done.ebuilts/vndk/v33Updating files:  74% (24394/32856)
Updating files: 100% (14789/14789), done.stem/dmesgdUpdating files:  99% (14766/14789)
Updating files: 100% (1209/1209), done.system/timezoneUpdating files:  81% (980/1209)
Updating files: 100% (1789/1789), done.tools/currysrcUpdating files:  93% (1669/1789)
Updating files: 100% (183/183), done.m/tools/netsimUpdating files:  74% (136/183)
Updating files: 100% (32856/32856), done.ndroid_vendor_qcom_opensource_vibratorUpdating files:  27% (6173/22862)
Updating files: 100% (22862/22862), done.ebuilts/clang/host/linux-x86Updating files:  38% (8788/22862)
Checking out: 100% (1469/1469), done in 2m52.925s
repo sync has finished successfully.

real	38m39.304s
user	154m20.852s
sys	18m39.951s
2025-01-11 17:13:37,517:     INFO: matrix-commander: This message was sent: "Sync finished!" to room "!pdsVekCwcOiaJoleKk:matrix.org" as event "$NkDyfs7INrRomstNdPwkjHSsEnVMHODpOdRNaZW4tCM".

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 11, 2025

DuckDuckGo and Google search LineageOS GSI.
https://www.reddit.com/r/LineageOS/comments/1dxtvzx/current_state_of_los_gsis/ 6 months ago does not bring a hopeful feedback.

@Benjamin-Loison
Copy link
Owner Author

https://wiki.lineageos.org/devices/ does not mention GSI even if disabled Hide discontinued devices.

@Benjamin-Loison
Copy link
Owner Author

https://wiki.lineageos.org/emulator shows how to build for GSI but not how to install it.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 11, 2025

source build/envsetup.sh
breakfast jnvbwnrw userdebug
Output:
In file included from build/make/core/config.mk:394:
In file included from build/make/core/envsetup.mk:351:
build/make/core/product_config.mk:226: error: Cannot locate config makefile for product "lineage_jnvbwnrw".
17:25:48 dumpvars failed with: exit status 1
Device jnvbwnrw not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for jnvbwnrw not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
In file included from build/make/core/config.mk:394:
In file included from build/make/core/envsetup.mk:351:
build/make/core/product_config.mk:226: error: Cannot locate config makefile for product "lineage_jnvbwnrw".
17:25:50 dumpvars failed with: exit status 1
In file included from build/make/core/config.mk:394:
In file included from build/make/core/envsetup.mk:351:
build/make/core/product_config.mk:226: error: Cannot locate config makefile for product "lineage_jnvbwnrw".
17:25:50 dumpvars failed with: exit status 1

** Don't have a product spec for: 'lineage_jnvbwnrw'
** Do you have the right repo manifest?
breakfast lineage_gsi_arm64 userdebug
Output:
In file included from build/make/core/config.mk:394:
In file included from build/make/core/envsetup.mk:351:
build/make/core/product_config.mk:226: error: Cannot locate config makefile for product "lineage_lineage_gsi_arm64".
17:26:47 dumpvars failed with: exit status 1
Device lineage_gsi_arm64 not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for lineage_gsi_arm64 not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
In file included from build/make/core/config.mk:394:
In file included from build/make/core/envsetup.mk:351:
build/make/core/product_config.mk:226: error: Cannot locate config makefile for product "lineage_lineage_gsi_arm64".
17:26:48 dumpvars failed with: exit status 1
In file included from build/make/core/config.mk:394:
In file included from build/make/core/envsetup.mk:351:
build/make/core/product_config.mk:226: error: Cannot locate config makefile for product "lineage_lineage_gsi_arm64".
17:26:49 dumpvars failed with: exit status 1

** Don't have a product spec for: 'lineage_lineage_gsi_arm64'
** Do you have the right repo manifest?

So gsi_arm64 seems to be equivalent to lineage_gsi_arm64 they mention.

breakfast gsi_arm64 userdebug
Output:
build/make/core/product_config.mk:480: warning: PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT is set but PRODUCT_NAME (lineage_gsi_arm64) doesn't look like a GSI for compliance testing. This is a special configuration for compliance GSI, so do make sure you understand the security implications before setting this option. If you don't know what this option does, then you probably shouldn't set this.
build/make/core/product_config.mk:480: warning: PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT is set but PRODUCT_NAME (lineage_gsi_arm64) doesn't look like a GSI for compliance testing. This is a special configuration for compliance GSI, so do make sure you understand the security implications before setting this option. If you don't know what this option does, then you probably shouldn't set this.
Trying dependencies-only mode on a non-existing device tree?
build/make/core/product_config.mk:480: warning: PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT is set but PRODUCT_NAME (lineage_gsi_arm64) doesn't look like a GSI for compliance testing. This is a special configuration for compliance GSI, so do make sure you understand the security implications before setting this option. If you don't know what this option does, then you probably shouldn't set this.
build/make/core/product_config.mk:480: warning: PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT is set but PRODUCT_NAME (lineage_gsi_arm64) doesn't look like a GSI for compliance testing. This is a special configuration for compliance GSI, so do make sure you understand the security implications before setting this option. If you don't know what this option does, then you probably shouldn't set this.

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=15
LINEAGE_VERSION=22.1-20250111-UNOFFICIAL-gsi_arm64
TARGET_PRODUCT=lineage_gsi_arm64
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.1.0-28-amd64-x86_64-Debian-GNU/Linux-12-(bookworm)
HOST_CROSS_OS=windows
BUILD_ID=AP4A.241205.013
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=packages/apps/FMRadio/jni/fmr
============================================

Please note that Android 12 (and by proxy Android 13/14/15) diverged GSI and Emulator targets. Emulator targets reside in lineage_sdk_$arch, while GSI targets reside in lineage_gsi_$arch.

Source: https://wiki.lineageos.org/emulator#start-the-build

date; time mka; matrix-commander -m 'Compilation finished!'

output.txt

@Benjamin-Loison
Copy link
Owner Author

During the compilation the 28 logical cores laptop is not as fast as usual to work in parallel on regular tasks.

@Benjamin-Loison
Copy link
Owner Author

Related to Benjamin-Loison/android/issues/59.

@Benjamin-Loison
Copy link
Owner Author

date; time mka; matrix-commander -m 'Compilation finished!'
Output:
Sat Jan 11 07:06:42 PM CET 2025
build/make/core/product_config.mk:480: warning: PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT is set but PRODUCT_NAME (lineage_gsi_arm64) doesn't look like a GSI for compliance testing. This is a special configurat
ion for compliance GSI, so do make sure you understand the security implications before setting this option. If you don't know what this option does, then you probably shouldn't set this.
build/make/core/product_config.mk:480: warning: PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT is set but PRODUCT_NAME (lineage_gsi_arm64) doesn't look like a GSI for compliance testing. This is a special configurat
ion for compliance GSI, so do make sure you understand the security implications before setting this option. If you don't know what this option does, then you probably shouldn't set this.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=15
LINEAGE_VERSION=22.1-20250111-UNOFFICIAL-gsi_arm64
TARGET_PRODUCT=lineage_gsi_arm64
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.1.0-28-amd64-x86_64-Debian-GNU/Linux-12-(bookworm)
HOST_CROSS_OS=windows
BUILD_ID=AP4A.241205.013
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=packages/apps/FMRadio/jni/fmr
============================================
wildcard(out/target/product/generic_arm64/clean_steps.mk) was changed, regenerating...
Adding CUSTOM_LOCALES [ast_ES gd_GB cy_GB fur_IT] to PRODUCT_LOCALES [en_US en_US af_ZA am_ET ar_EG ar_XB as_IN az_AZ be_BY bg_BG bn_BD bs_BA ca_ES cs_CZ da_DK de_DE el_GR en_AU en_CA en_GB en_IN en_XA es_ES es_
US et_EE eu_ES fa_IR fi_FI fr_CA fr_FR gl_ES gu_IN hi_IN hr_HR hu_HU hy_AM in_ID is_IS it_IT iw_IL ja_JP ka_GE kk_KZ km_KH kn_IN ko_KR ky_KG lo_LA lt_LT lv_LV mk_MK ml_IN mn_MN mr_IN ms_MY my_MM nb_NO ne_NP nl_N
L or_IN pa_IN pl_PL pt_BR pt_PT ro_RO ru_RU si_LK sk_SK sl_SI sq_AL sr_Latn_RS sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH tr_TR uk_UA ur_PK uz_UZ vi_VN zh_CN zh_HK zh_TW zu_ZA en_XC]
build/make/core/product_config.mk:480: warning: PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT is set but PRODUCT_NAME (lineage_gsi_arm64) doesn't look like a GSI for compliance testing. This is a special configurat
ion for compliance GSI, so do make sure you understand the security implications before setting this option. If you don't know what this option does, then you probably shouldn't set this.
19:08:12 ninja failed with: exit status 137

#### failed to build some targets (01:30 (mm:ss)) ####


real	1m29.729s
user	0m51.040s
sys	0m35.324s

@Benjamin-Loison
Copy link
Owner Author

htop shows that running out of memory (even with 32 GB of swap).

@Benjamin-Loison
Copy link
Owner Author

https://www.ovhcloud.com/fr/bare-metal/prices/?display=list&cpu_cores=64%7C256

Scale-a5-3AZ
Offre découverte
AMD EPYC GENOA 9554 - 64 c / 128 t - 3,1 GHz / 3,75 GHz
De 128 Go à 1 To
De 2 x 1,92 To à 6 x 7,68 To
Publique De 1 Gbit/s à 10 Gbit/s garantis
317,99 €2 124 € soit 381,59 € TTC/mois

@Benjamin-Loison
Copy link
Owner Author

No other OVH location proposes a better equipped than 64 logical cores VPS.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 11, 2025

Trying to decrease exponentially -j (don't know if it is even taken into account) trying to avoid swap usage, 8 seems to be fine.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 11, 2025

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 11, 2025

date; time mka -j 8

output.txt

find out/target/product/ -name '*.zip'
Output:
out/target/product/generic_arm64/system/product/media/bootanimation.zip
out/target/product/generic_arm64/system/product/media/bootanimation-dark.zip
out/target/product/generic_arm64/system/etc/security/otacerts.zip
out/target/product/generic_arm64/obj/BOOTANIMATION/bootanimation.zip
out/target/product/generic_arm64/obj/ETC/bootanimation.zip_intermediates/bootanimation.zip
out/target/product/generic_arm64/obj/APPS/webview_intermediates/dexpreopt.zip

@Benjamin-Loison
Copy link
Owner Author

ls -lhS out/target/product/generic_arm64/
Output:
total 2.3G
-rw-r--r--  1 benjamin_loison benjamin_loison 2.2G Jan 11 20:16 system.img
-rw-r--r--  1 benjamin_loison benjamin_loison  71M Jan 11 20:18 module-info.json
-rw-r--r--  1 benjamin_loison benjamin_loison  23M Jan 11 20:18 module-info.json.rsp
-rw-r--r--  1 benjamin_loison benjamin_loison 2.7M Jan 11 19:26 all_modules.txt
-rw-r--r--  1 benjamin_loison benjamin_loison 1.7M Jan 11 20:18 ramdisk.img
-rw-r--r--  1 benjamin_loison benjamin_loison 1.2M Jan 11 20:15 installed-files.json
-rw-r--r--  1 benjamin_loison benjamin_loison 405K Jan 11 20:15 installed-files.txt
-rw-r--r--  1 benjamin_loison benjamin_loison 191K Jan 11 17:30 clean_steps.mk
-rw-r--r--  1 benjamin_loison benjamin_loison  17K Jan 11 19:47 product_packages.txt
drwxr-xr-x  2 benjamin_loison benjamin_loison  12K Jan 11 20:10 dexpreopt_config
drwxr-xr-x 40 benjamin_loison benjamin_loison 4.0K Jan 11 20:10 apex
drwxr-xr-x  2 benjamin_loison benjamin_loison 4.0K Jan 11 20:15 debug_ramdisk
drwxr-xr-x  2 benjamin_loison benjamin_loison 4.0K Jan 11 20:16 fake_packages
drwxr-xr-x  4 benjamin_loison benjamin_loison 4.0K Jan 11 20:09 gen
drwxr-xr-x  3 benjamin_loison benjamin_loison 4.0K Jan 11 20:18 install
drwxr-xr-x 22 benjamin_loison benjamin_loison 4.0K Jan 11 20:18 obj
drwxr-xr-x  5 benjamin_loison benjamin_loison 4.0K Jan 11 20:09 obj_arm
drwxr-xr-x 10 benjamin_loison benjamin_loison 4.0K Jan 11 20:18 ramdisk
drwxr-xr-x 27 benjamin_loison benjamin_loison 4.0K Jan 11 20:11 root
drwxr-xr-x  6 benjamin_loison benjamin_loison 4.0K Jan 11 20:19 symbols
drwxr-xr-x 15 benjamin_loison benjamin_loison 4.0K Jan 11 20:11 system
-rw-r--r--  1 benjamin_loison benjamin_loison 4.0K Jan 11 20:18 vbmeta.img
drwxr-xr-x  3 benjamin_loison benjamin_loison 4.0K Jan 11 20:15 vendor
-rw-r--r--  1 benjamin_loison benjamin_loison 3.4K Jan 11 20:11 installed-files-root.json
-rw-r--r--  1 benjamin_loison benjamin_loison 3.3K Jan 11 20:18 misc_info.txt
-rw-r--r--  1 benjamin_loison benjamin_loison  729 Jan 11 20:11 installed-files-root.txt
-rw-r--r--  1 benjamin_loison benjamin_loison  304 Jan 11 20:16 installed-files-ramdisk.json
-rw-r--r--  1 benjamin_loison benjamin_loison  164 Jan 11 20:18 fastboot-info.txt
-rw-r--r--  1 benjamin_loison benjamin_loison   90 Jan 11 19:26 build_fingerprint.txt
-rw-r--r--  1 benjamin_loison benjamin_loison   81 Jan 11 20:16 installed-files-ramdisk.txt
-rw-r--r--  1 benjamin_loison benjamin_loison   53 Jan 11 17:32 previous_build_config.mk
-rw-r--r--  1 benjamin_loison benjamin_loison   50 Jan 11 19:26 build_thumbprint.txt
-rw-r--r--  1 benjamin_loison benjamin_loison    1 Jan 11 20:18 android-info.txt

@Benjamin-Loison
Copy link
Owner Author

https://source.android.com/docs/core/tests/vts/gsi#flashing-gsis seems to specify how to leverage system.img.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 12, 2025

https://developer.android.com/topic/generic-system-image/#flash-gsi

Note: If your device has adopted Android Verified Boot (AVB), download and flash the following image to disable AVB before flashing a GSI: vbmeta.img

adb shell getprop ro.boot.veritymode
enforcing

Source: the Stack Overflow answer 69116699

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 12, 2025

https://developer.android.com/topic/dsu#launch

Note: If you build your own GSI from source, or if you download a GSI from another image server, your GSI might not be unsparsed. Use the following command inside your build tree to convert the image to an unsparsed image: simg2img system.img system_raw.img

So it seems that an official GSI should be unsparsed:

file system.img 
system.img: Linux rev 1.0 ext2 filesystem data, UUID=6aee5ecd-21b4-5ea1-a292-6814f82e2dae (extents) (large files) (huge files)
ls -lh system.img
-rw-r--r-- 1 benjamin_loison benjamin_loison 1.8G Jan  1  2009 system.img

The LineageOS GSI I built:

file system.img 
system.img: Linux rev 1.0 ext2 filesystem data, UUID=60ed8495-f206-5d56-a90d-17304e5989a0 (extents) (large files) (huge files)

So seems unsparsed.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 12, 2025

simg2img system.img system_raw.img
Output:
Invalid sparse file format at header magic
Failed to read sparse file

@Benjamin-Loison
Copy link
Owner Author

ls -lh system.img
-rw-rw-r-- 1 benjamin_loison benjamin_loison 2.2G Jan 12 20:40 system.img

@Benjamin-Loison
Copy link
Owner Author

gzip -c system_raw.img > system_raw.gz
ls -lh system_raw.gz
-rw-rw-r-- 1 benjamin_loison benjamin_loison 1002M Jan 12 20:42 system_raw.gz

@Benjamin-Loison
Copy link
Owner Author

adb push system_raw.gz /storage/emulated/0/Download/
system_raw.gz: 1 file pushed, 0 skipped. 25.8 MB/s (1049733210 bytes in 38.797s)

@Benjamin-Loison
Copy link
Owner Author

adb shell am start-activity \
-n com.android.dynsystem/com.android.dynsystem.VerificationActivity  \
-a android.os.image.action.START_INSTALL  \
-d file:///storage/emulated/0/Download/system_raw.gz  \
--el KEY_SYSTEM_SIZE $(du -b system_raw.img|cut -f1)  \
--el KEY_USERDATA_SIZE 8589934592

results in Dynamic System Updates Install failed notification.

@Benjamin-Loison
Copy link
Owner Author

Let us try this build as DSU on my Fairphone 4 LineageOS 22.1 to check if it looks right.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 12, 2025

image

image

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 12, 2025

  • Camera keeps stopping
  • Call is received by my phone and the other person one, but the other person don't hear and I don't hear it (tiles {Mic,Camera} access are shown as Available), however he hears Keypad inputs

image

Tapping does not help.

image

@Benjamin-Loison
Copy link
Owner Author

  • I do not receive the other person SMS.

@Benjamin-Loison
Copy link
Owner Author

Benjamin-Loison commented Jan 12, 2025

  • Browser loads correctly a given Google search on 4G as well as on wifi.
  • Flashlight works fine
  • Organic Maps fails to locate me at my desk at my flat after 35 seconds
  • Browser YouTube video does not have a working audio
  • Recorder audio once exported to laptop shows that the microphone works well
  • NFC detects well to detect WH-CH700N
  • However despite NFC prompt, unable to pair to it even if search it by Bluetooth but was able for a second to detect another Bluetooth device that I am not aware of it seems
  • Auto-rotate works fine
  • Internet access provided to my Linux Mint 22 Cinnamon Framework 13 works fine through the GSI hotspot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant