2024-07-16 23:17:32 +00:00
# Building a Mobian Image for the Pixel 3a
## Prerequisites
Cloning the repositories
Kernel: https://salsa.debian.org/erebion/sdm-670-linux
Mobian Recipes does not have the changes merged, as the kernel is not yet part of Mobian: https://salsa.debian.org/Mobian-team/mobian-recipes/-/merge_requests/113
Take my temporary fork of Mobian Recipes instead, for now: https://salsa.debian.org/erebion/mobian-recipes/-/tree/erebion/sargo-build?ref_type=heads
2024-08-23 22:44:42 +00:00
Make sure you check out my branch `sargo-build` which includes a couple of workarounds for changes which are not yet in the repos, but will be soon.
2024-07-16 23:17:32 +00:00
The fork will be maintained until there are official Mobian images for the Pixel 3a.
## Compiling the Kernel
First `cd` to the kernel repo.
Then:
```bash
gbp pq import # import the patches to a patch-queue branch with the patches applied
2024-08-18 12:45:04 +00:00
DEB_HOST_ARCH=arm64 dpkg-buildpackage -a arm64 -us -uc -rfakeroot -b -Pcross,nocheck
2024-07-16 23:17:32 +00:00
```
## Building the Image
2024-08-22 23:04:11 +00:00
- First `cd` to the Mobian repo
- Copy the kernel deb to `devices/qcom/packages` , so that it gets installed onta the image we are about to build.
2024-07-16 23:17:32 +00:00
- Add your SSH authorized keys file to `overlays/ssh/authorized_keys` , important so you can log in later
2024-08-22 23:04:11 +00:00
- Make sure the internet connection is stable, as the build fails if it cannot download all packages successfully.
Now build the image:
2024-07-16 23:17:32 +00:00
```bash
2024-08-23 22:44:42 +00:00
./build.sh -t qcom -s -u mobian -c -R myverysecretlukspassphrase | tee mobian-build.log # -s for SSH, which we need later
2024-07-16 23:17:32 +00:00
```
2024-08-23 22:44:42 +00:00
Do not use `myverysecretlukspassphrase` as your passphrase and replace it, obviously. :D
2024-07-16 23:17:32 +00:00
(If you replace `mobian` with your own username, you will have to use that one for SSH later, of course)
2024-08-22 23:04:11 +00:00
Wait. It takes a while.
2024-07-16 23:17:32 +00:00
2024-08-22 23:04:11 +00:00
Note: Your SSH Host Keys seemingly get generated while building the image, please don't give your image to anyone else.
To Do: Verify whether those keys really end up in the image.
2024-07-16 23:17:32 +00:00
## Flash to device:
```
fastboot --set-active --slot a
2024-08-22 23:04:11 +00:00
fastboot flash boot_a mobian-qcom-phosh-20240614.boot-sargo.img
2024-07-16 23:17:32 +00:00
fastboot flash userdata mobian-qcom-phosh-20240614.rootfs.img
2024-08-29 09:25:20 +00:00
fastboot oem enable # currently does not seem to boot without, probably because the kernel config enables SSH for debugging right now
2024-07-16 23:17:32 +00:00
fastboot erase dtbo
```
Boot up the device. Connect it via USB.
## Temporary manual changes
2024-08-22 23:04:11 +00:00
The steps are documented in `README.md` in this repo.