sargo-temp/IMAGE.md
2024-08-23 01:04:11 +02:00

60 lines
1.9 KiB
Markdown

# 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
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
DEB_HOST_ARCH=arm64 dpkg-buildpackage -a arm64 -us -uc -rfakeroot -b -Pcross,nocheck
```
## Building the Image
- 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.
- Add your SSH authorized keys file to `overlays/ssh/authorized_keys`, important so you can log in later
- Make sure the internet connection is stable, as the build fails if it cannot download all packages successfully.
Now build the image:
```bash
./build.sh -t qcom -s -u mobian | tee mobian-build.log # -s for SSH, which we need later
```
(If you replace `mobian` with your own username, you will have to use that one for SSH later, of course)
Wait. It takes a while.
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.
## Flash to device:
```
fastboot --set-active --slot a
fastboot flash boot_a mobian-qcom-phosh-20240614.boot-sargo.img
fastboot flash userdata mobian-qcom-phosh-20240614.rootfs.img
fastboot erase dtbo
```
Boot up the device. Connect it via USB.
## Temporary manual changes
The steps are documented in `README.md` in this repo.