Colors of Noise

agx@sigxcpu.org

Entries tagged "linuxmobile".

Booting an Android custom kernel on a Pixel 3a for QMI debugging
4th April 2025

As you might know I'm not much of an Android user (let alone developer) but in order to figure out how something low level works you sometimes need to peek at how vendor kernels handles this. For that it is often useful to add additional debugging.

One such case is QMI communication going on in Qualcomm SOCs. Joel Selvaraj wrote some nice tooling for this.

To make use of this a rooted device and a small kernel patch is needed and what would be a no-brainer with Linux Mobile took me a moment to get it to work on Android. Here's the steps I took on a Pixel 3a to first root the device via Magisk, then build the patched kernel and put that into a boot.img to boot it.

Flashing the factory image

If you still have Android on the device you can skip this step.

You can get Android 12 from developers.google.com. I've downloaded sargo-sp2a.220505.008-factory-071e368a.zip. Then put the device into Fastboot mode (Power + Vol-Down), connect it to your PC via USB, unzip/unpack the archive and reflash the phone:

unpack sargo-sp2a.220505.008-factory-071e368a.zip
./flash-all.sh

This wipes your device! I had to run it twice since it would time out on the first run. Note that this unpacked zip contains another zip (image-sargo-sp2a.220505.008.zip) which will become useful below.

Enabling USB debugging

Now boot Android and enable Developer mode by going to SettingsAbout then touching Build Number (at the very bottom) 7 times.

Go back one level, then go to SystemDeveloper Options and enable "USB Debugging".

Obtaining boot.img

There are several ways to get boot.img. If you just flashed Android above then you can fetch boot.img from the already mentioned image-sargo-sp2a.220505.008.zip:

unzip image-sargo-sp2a.220505.008.zip boot.img

If you want to fetch the exact boot.img from your device you can use TWRP (see the very end of this post).

Becoming root with Magisk

Being able to su via adb will later be useful to fetch kernel logs. For that we first download Magisk as APK. At the time of writing v28.1 is current.

Once downloaded we upload the APK and the boot.img from the previous step onto the phone (which needs to have Android booted):

adb push Magisk-v28.1.apk /sdcard/Download
adb push boot.img /sdcard/Download

In Android open the Files app, navigate to /sdcard/Download and install the Magisk APK by opening the APK.

We now want to patch boot.img to get su via adb to work (so we can run dmesg). This happens by hitting Install in the Magisk app, then "Select a file to patch". You then select the boot.img we just uploaded.

The installation process will create a magisk_patched-<random>.img in /sdcard/Download. We can pull that file via adb back to our PC:

adb pull /sdcard/Download/magisk_patched-28100_3ucVs.img

Then reboot the phone into fastboot (adb reboot bootloader) and flash it (this is optional see below):

fastboot flash boot magisk_patched-28100_3ucVs.img

Now boot the phone again, open the Magisk app, go to SuperUser at the bottom and enable Shell.

If you now connect to your phone via adb again and now su should work:

adb shell
su

As noted above if you want to keep your Android installation pristine you don't even need to flash this Magisk enabled boot.img. I've flashed it so I have su access for other operations too. If you don't want to flash it you can still test boot it via:

fastboot boot magisk_patched-28100_3ucVs.img

and then perform the same adb shell su check as above.

Building the custom kernel

For our QMI debugging to work we need to patch the kernel a bit and place that in boot.img too. So let's build the kernel first. For that we install the necessary tools (which are thankfully packaged in Debian) and fetch the Android kernel sources:

sudo apt install repo android-platform-tools-base kmod ccache build-essential mkbootimg
mkdir aosp-kernel && cd aosp-kernel
repo init -u https://android.googlesource.com/kernel/manifest -b android-msm-bonito-4.9-android12L
repo sync

With that we can apply Joel's kernel patches and also compile in the touch controller driver so we don't need to worry if the modules in the initramfs match the kernel. The kernel sources are in private/msm-google. I've just applied the diffs on top with patch and modified the defconfig and committed the changes. The resulting tree is here.

We then build the kernel:

PATH=/usr/sbin:$PATH ./build_bonito.sh

The resulting kernel is at ./out/android-msm-pixel-4.9/private/msm-google/arch/arm64/boot/Image.lz4-dtb.

In order to boot that kernel I found it to be the simplest to just replace the kernel in the Magisk patched boot.img as we have that already. In case you have already deleted that for any reason we can always fetch the current boot.img from the phone via TWRP (see below).

Preparing a new boot.img

To replace the kernel in our Magisk enabled magisk_patched-28100_3ucVs.img from above with the just built kernel we can use mkbootimgfor that. I basically copied the steps we're using when building the boot.img on the Linux Mobile side:

ARGS=$(unpack_bootimg --format mkbootimg --out tmp --boot_img magisk_patched-28100_3ucVs.img)
CLEAN_PARAMS="$(echo "${ARGS}" | sed -e "s/ --cmdline '.*'//" -e "s/ --board '.*'//")"
cp android-kernel/out/android-msm-pixel-4.9/private/msm-google/arch/arm64/boot/Image.lz4-dtb tmp/kernel
mkbootimg -o "boot.patched.img" ${CLEAN_PARAMS} --cmdline "${ARGS}"

This will give you a boot.patched.img with the just built kernel.

Boot the new kernel via fastboot

We can now boot the new boot.patched.img. No need to flash that onto the device for that:

fastboot boot boot.patched.img

Fetching the kernel logs

With that we can fetch the kernel logs with the debug output via adb:

adb shell su -c 'dmesg -t' > dmesg_dump.xml

or already filtering out the QMI commands:

adb shell su -c 'dmesg -t'  | grep "@QMI@" | sed -e "s/@QMI@//g" &> sargo_qmi_dump.xml

That's it. You can apply this method for testing out other kernel patches as well. If you want to apply the above to other devices you basically need to make sure you patch the right kernel sources, the other steps should be very similar.

In case you just need a rooted boot.img for sargo you can find a patched one here.

If this procedure can be improved / streamlined somehow please let me know.

Appendix: Fetching boot.img from the phone

If, for some reason you lost boot.img somewhere on the way you can always use TWRP to fetch the boot.img currently in use on your phone.

First get TWRP for the Pixel 3a. You can boot that directly by putting your device into fastboot mode, then running:

fastboot boot twrp-3.7.1_12-1-sargo.img

Within TWRP select BackupBoot and backup the file. You can then use adb shell to locate the backup in /sdcard/TWRP/BACKUPS/ and pull it:

adb pull /sdcard/TWRP/BACKUPS/97GAY10PWS/2025-04-02--09-24-24_SP2A220505008/boot.emmc.win

You now have the device's boot.img on your PC and can e.g. replace the kernel or make modifications to the initramfs.

Tags: linuxmobile, phosh, planetdebian.
Free Software Activities March 2025
1st April 2025

Another short status update of what happened on my side last month. Some more ModemManager bits landed, Phosh 0.46 is out, haptic feedback is now better tunable plus some more. See below for details (no April 1st joke in there, I promise):

phosh

phoc

phosh-osk-stub

phosh-mobile-settings

phosh-tour

pfs

xdg-desktop-portal-gtk

xdg-desktop-portal-phosh

meta-phosh

feedbackd

feedbackd-device-themes

gmobile

livi

Debian

git-buildpackage

feedbackd-device-themes

wlroots

ModemManager

Tuba

xdg-spec

gnome-calls

Reviews

This is not code by me but reviews on other peoples code. The list is (as usual) slightly incomplete. Thanks for the contributions!

Help Development

If you want to support my work see donations.

Comments?

Join the Fediverse thread

Tags: debian, gnome, linuxmobile, phosh, planetdebian.
Free Software Activities February 2025
1st March 2025

Another short status update of what happened on my side last month. One larger blocks are the Phosh 0.45 release, also reviews took a considerable amount of time. From the fun side debugging bananui and coming up with a fix in phoc as well as setting up a small GSM network using osmocom to test more Cell Broadcast thingies were likely the most fun parts.

phosh

phoc

phosh-osk-stub

phosh-tour

phosh-mobile-settings

pfs

libphosh-rs

meta-phosh

libcmatrix

Debian

gmobile

feedbackd

grim

Wayland protocols

g4music

wlroots

qbootctl

bananui-shell

libssc

ModemManager

Waycheck

Bug reports

Reviews

This is not code by me but reviews on other peoples code. The list is slightly incomplete. Thanks for the contributions!

Help Development

If you want to support my work see donations.

Comments?

Join the Fediverse thread

Tags: debian, gnome, linuxmobile, phosh, planetdebian.
Free Software Activities January 2025
1st February 2025

Another short status update of what happened on my side last month. Mostly focused on quality of life improvements in phosh and cleaning up and improving phoc this time around (including catching up with wlroots git) but some improvements for other things like phosh-osk-stub happened on the side line too.

phosh

phoc

phosh-osk-stub

xdg-desktop-portal-phosh

phosh-recipes

libcmatrix

phrog

Debian

git-buildpackage

livi

feedbackd

Wayland protocols

Wlroots

Bug reports

Reviews

This is not code by me but reviews on other peoples code. The list is incomplete, but I hope to improve on this in the upcoming months. Thanks for the contributions!

Help Development

If you want to support my work see donations.

Comments?

Join the Fediverse thread

Tags: debian, gnome, linuxmobile, phosh, planetdebian.
Free Software Activities December 2024
1st January 2025

Another short status update of what happened on my side last month. The larger blocks are the Phosh 0.44 release and landing the initial Cell Broadcast support in phosh. The rest is all just small bits of bug, fallout/regression fixing here and there.

phosh

phoc

phosh-mobile-settings

libphosh-rs

phosh-osk-stub

phosh-tour

pfs

xdg-desktop-portal-phosh

phog

Debian

git-buildpackage

wlr-randr

python-dbusmock

livi

Chatty

feedbackd

libadwaita

phosh-ev

Reviews

This is not code by me but reviews on other peoples code. The list is incomplete, but I hope to improve on this in the upcoming months. Thanks for the contributions!

Help Development

Thanks a lot to all the those who supported my work on this in 2024. Happy new year!

If you want to support my work see donations.

Comments?

Join the Fediverse thread

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities November 2024
1st December 2024

Another short status update of what happened on my side last month. The larger blocks are the Phosh 0.43 release, the initial file chooser portal, phosh-osk-stub now handling digit, number, phone and PIN input purpose via special layouts as well as Phoc mostly catching up with wlroots 0.18 and the current development version targeting 0.19.

phosh

phoc

phosh-mobile-settings

libphosh-rs

phosh-osk-stub

phosh-tour

pfs

xdg-desktop-portal-phosh

meta-phosh

Debian

Calls

libcall-ui

git-buildpackage

wlroots

python-dbusmock

xdg-spec

ashpd

govarnam

varnam-schemes

Reviews

This is not code by me but reviews I did on other peoples code. The list is incomplete, but I hope to improve on this in the upcoming months. Thanks for the contributions!

Help Development

If you want to support my work see donations. This includes a list of hardware we want to improve support for. Thanks a lot to all current and past donors.

Comments?

Join the Fediverse thread

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities October 2024
3rd November 2024

Another short status update of what happened on my side last month. Besides a phosh bugfix release improving text input and selection was a prevalent pattern again resulting in improvements in the compositor, the OSK and some apps.

phosh

phoc

phosh-mobile-settings

libphosh-rs

phosh-osk-stub

phosh-osk-data

xdg-desktop-portal-phosh

Debian

ModemManager

Calls

GTK

feedbackd

Chatty

libcmatrix

phosh-ev

git-buildpackage

Unified push specification

swipeGuess

wlr-clients

iotas (Note taking app)

Flare (Signal app)

xdg-desktop-portal

Reviews

This is not code by me but reviews on other peoples code. The list is fairly incomplete, hope to improve on this in the upcoming months:

Help Development

If you want to support my work see donations. This includes a list of hardware we want to improve support for. Thanks a lot to all current and past donors.

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities September 2024
1st October 2024

Another short status update of what happened on my side last month. Besides the usual amount of housekeeping last month was a lot about getting old issues resolved by finishing some stale merge requests and work in pogress MRs. I also pushed out the Phosh 0.42.0 Release

phosh

phoc

phosh-mobile-settings

libphosh-rs

phosh-osk-stub

phosh-wallpapers

meta-phosh

Debian

ModemManager

Calls

bluez

gnome-text-editor

feedbackd

Chatty

libcall-ui

glib

wlr-protocols

git-buildpackage

iio-sensor-proxy

Fotema

Help Development

If you want to support my work see donations. This includes a list of hardware we want to improve support for. Thanks a lot to all current and past donors.

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities August 2024
1st September 2024

Another short status update of what happened on my side last month.

Quite a bit of time went into helping organize the FrOSCon FOSS on Mobile dev room (day 1, day 2, summary) but that was all worth it and fun - so was releasing Phosh 0.41.0 (which incidetally happened right before FrOScon). A three years old MR to xdg-spec to add call categories landed (thanks Matthias) allowing us to finally provide proper feedback for e.g. IM calls too. The rest was some OSK improvements (around Indic language support via varnam and layout configuration), some Cell Broadcast advancements (thanks to NGI0 for supporting this) but also some fixes. Here's the details:

Phosh

Phoc

phosh-mobile-settings

libphosh-rs

phosh-osk-stub

phosh-wallpapers

meta-phosh

phosh-recipes

Debian

Mobian

ModemManager

Calls

gnome-bluetooth

gnome-settings-daemon

feedbackd

Chatty

Libcmatrix

Eigenvalue

kunifiedpush

gir-rustdoc

python-dbusmock

matrix spec

sound-theme spec

varname-schemes

FroSCon

Help Development

If you want to support my work see donations. This includes a list of hardware we want to improve support for. Thanks a lot to all current and past donors.

Tags: gnome, linuxmobile, phosh, planetdebian.
A short look back at the FOSS on Mobile Devroom at FrOSCon 2024
19th August 2024

Last weekend FrOSCon took place in St. Augustin (near Bonn). While memory is still fresh: here's a short look back with the focus on what I think worked well and what we could maybe improve for next year (should we want to do it again):

It was the 2nd time we had a dedicated FOSS on Mobile devroom with a mix of talks, discussions and hacking time and the first time we had a booth showing different devices running Linux. It was nice to see people joining for the first time as well as some familiar faces.

The Mobile Linux Booth (image taken from the

(image taken from https://fosstodon.org/@postmarketOS/112976637275476001)

Talks

There were talks ranging from how Qualcomm devices are booting (and how the should boot), Debugging the Mobile Linux stack as well as happenings in the app ecosystem and how the weekly news feed covering our ecosystem is created (to name a few). I think the diversity of different topics was well received.

Lightning Talks

Last year we had two one hour slots for lightning talks which weren't completely filled so we went to 30min total this year. The three 10min talk slots filled up quickly with

so we squeezed in a 4th one between two talks (about posting images to the Fediverse directly from a digital camera). We should likely reserve one full hour for lighting talks.

Discussons / Round Tables

The What are you missing to use Linux Mobile daily… round table/discussion (which was sparked by last year's Phosh community get together) was enlightening as it highlighted the different issues people are having (for some of them others could already contribute a solution). We should likely keep that as a fix point in the schedule. These are the bullet points from the white board we could use as a base the check what changed (hopefully improved) next year.

Time for Hacking / Problem solving

The Let's hack together on Mobile Linux session on Sunday morning looks like a good idea as people can trickle in as they see fit in the morning after the social event. It also allowed people to drop by with questions or devices they wanted to get Mobile Linux on (which wasn't always possible due to not yet working kernels).

We could often spark some hope though by redirecting them to the booth to see similar devices to theirs running Mobile Linux. This made me notice that not everyone was aware that there's a booth as well so we could connect booth and devroom better i.e. mention the booths location and devices present there on the devroom's white board and have a printout with the talk schedule at the booth.

Podcast

The postmarketOS podcast Live Episode was a very nice wrap up of the two conference days. Something similar (or same) would be nice next year.

Misc

Some other random thoughts on what we could keep/change for next year (should we want to do it again):

Thanks

Many thanks go to the people doing a presentation, staffing the booth, the FroSCon orga for a smooth conference and everyone joining, listening in and participating.

Tags: froscon, linuxmobile, phosh.
Free Software Activities July 2024
1st August 2024

A short status update on what happened on my side last month. Looking at unified push support for Chatty prompted some libcmatrix fixes and Chatty improvements (benefiting other protocols like SMS/MMS as well).

The Bluetooth status page in Phosh was a slightly larger change code wise as we also enhanced our common widgets for building status pages, simplifying the Wi-Fi status page and making future status pages simpler. But as usual investigating bugs, reviewing patches (thanks!) and keeping up with the changing world around us is what ate most of the time.

Phosh

A Wayland Shell for mobile devices

Phoc

A Wayland compositor for mobile devices

libphosh-rs

Phosh Rust bindings

phosh-osk-stub

A on screen keyboard for Phosh

phosh-mobile-settings

phosh-wallpapers

Wallpapers, Sounds and other artwork

git-buildpackage

Suite to help with Debian packages in Git repositories

Whatmaps

Tool to find processes mapping shared objects

Debian

The universal operating system

Mobian

A Debian derivative for mobile devices

Calls

PSTN and SIP calls for GNOME

Livi

Minimalistic video player targeting mobile devices

libcall-ui

Common user interface parts for call handling in GNOME and Phosh.

feedbackd

DBus service for haptic/visual/audio feedback

Chatty

Messaging application for mobile and desktop

libcmatrix

A matrix client client library

Eigenvalue

A libcmatrix test client

Help Development

If you want to support my work see donations. This includes list of hardware we want to improve support for.

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities June 2024
1st July 2024

A short status update of what happened on my side last month. Was able to test our Cellbroadcast bits, feedbackd became more flexible regarding LEDs, Phosh 0.40 is out, and some more.

Phosh

Phoc

gmobile

phosh-mobile-settings

phosh-wallpapers

emacs

Debian

ModemManager

Feedbackd

Livi

Calls

Chatty

meta-phosh

Libhandy

If you want to support my work see donations.

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities May 2024
1st June 2024

A short status update of what happened on my side last month. A broken gcovr in Debian triggered a bit of busy work but 0.39.0 came out nicely nevertheless. We also reduced build time quiet a bit in phosh and phoc.

If you want to support my work see donations.

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities April 2024
1st May 2024

A short status update of what happened on my side last month. Maintenance and code review keep to be the top time sinks (in a positive way).

If you want to support my work see donations.

Tags: gnome, linuxmobile, phosh, planetdebian.
Free Software Activities March 2024
3rd April 2024

A short status update of what happened on my side last month. I spent quiet a bit of time reviewing new, code (thanks!) as well as maintenance to keep things going but we also have some improvements:

Phosh

Phoc

phosh-mobile-settings

phosh-osk-stub

gmobile

Livi

squeekboard

GNOME calls

Libsoup

If you want to support my work see donations.

Tags: linuxmobile, phosh, planetdebian.
Free Software Activities February 2024
1st March 2024

A short status update what happened last month. Work in progress is marked as WiP:

GNOME Calls

Phosh and Phoc

As this often overlaps I've put them in a common section:

Phosh Tour

Phosh Mobile Settings

Phosh OSK Stub

Livi Video Player

Phosh.mobi Website

If you want to support my work see donations.

Tags: linuxmobile, phosh, planetdebian.

RSS Feed