# 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 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. 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 - Apparently you need to have `android-sdk-libsparse-utils` and, `cryptsetup` for encrypted images, installed, not sure what else might be required - 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 -c -R myverysecretlukspassphrase | tee mobian-build.log # -s for SSH, which we need later ``` Do not use `myverysecretlukspassphrase` as your passphrase and replace it, obviously. :D (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 oem uart enable # currently does not seem to boot without, probably because the kernel config enables SSH for debugging right now fastboot erase dtbo ``` Boot up the device. Connect it via USB. ## Temporary manual changes The steps are documented in `README.md` in this repo.