# 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 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig sdm845.config sdm670.config usb-gadget.config # make kernel config, usb-gadget ist required for SSH via USB Cable ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j$(nproc) bindeb-pkg # make Kernel deb (one directory level up) ``` ## 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. Temporary workarounds: - Comment `loupe` in `include/packages-phosh.yaml` as that is currently not available in the repo. The image viewer can be installed later. - Comment `mobian-phosh` because of a broken dependency and insert `phosh-core`, the metapackage just installs things like an XMPP client and nothing important we couldn't install later. - Add your SSH authorized keys file to `overlays/ssh/authorized_keys`, important so you can log in later ```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. Make sure the internet connection is stable, as the build fails if it cannot download all packages successfully. Note: Your SSH Host Keys currently get generated while building the image, please don't give your image to anyone else. ## Flash to device: ``` fastboot --set-active --slot a fastboot flash boot_a mobian-qcom-phosh-20240614.boot-bonito-sdc.img fastboot flash userdata mobian-qcom-phosh-20240614.rootfs.img fastboot erase dtbo ``` Boot up the device. Connect it via USB. ## Temporary manual changes Documented in README.md in this repo.