Custom GCW Zero OS Image ------------------------ This page serves to record everything I've learned about building an OS Image for the GCW Zero. Existing Images =============== - `The official image `_ - This was last updated 2015-07-23 - This is based on OpenDingux - `Current OpenDingux development images `_ - GCW Zero update packages, odboot binaries, and toolchains are available `here `_. - These are automatically? built by GitHub actions. - Work to bring OpenDingux / device support to newer Linux Kernel versions is supposedly happening in this repo - `Adam Image `_ - This is built on top of the newer OpenDingux releases. - Currently this seems to be fixed to a version from `2022-02-13 `_. - This image opens up the OpenDingux image and creates a modified userspace with a different launcher and newer appliactions. - The boot flow seems to be identical to the OpenDingux upstream. Boot Flow ========= `UBIBoot `_ _______ - Bootloader for launching a Linux Kernel off a UBI partition - Not really sure what a UBI partition is - None of the images that I've looked at are using an UBI partition for ``/boot``, they have been FAT32 - All the SDCard images have this program written to them via ``dd`` - The line that writes this to adam image the image is `here `_ Kernel ______ - The canonical source repo lives `here `_. - Kernel sources defconfig lives `here `_. - Buildroot defconfig lives `here `_. - It is probably best to use the OpenDingux kernel fork for now. - It looks like there is some upstreaming working being done, but the status of that in unknown. - Building with the OpenDingux defconfig results in a bootable kernel that is in a compatible format for the existing images - Changing the kernel format would probably require modifying the UBIBoot build - One known issue with the latest OpenDingux kernel is that the display output doesn't work. - This is fixed based on my testing and `this issue `_. `Mininit `_ _______ - Mininit is a bootloader that allows loading the root filesystem from a squashfs image called ``rootfs.squashfs``. - It also supports loading kernel modules from a squashfs image called ``modules.squashfs``. - After it mounts all the required filesystems, control is handed off to the ``/sbin/init`` binary in the mounted rootfs [1]_. Booting Debian ============== Creating a boot partition _________________________ - TODO Building the OpenDingux Kernel ______________________________ - `Docker based flow to build the OpenDingux kernel `_ - This builds the RC of kernel 6.1 (and also can support older kernel versions) Creating a mips32le squashfs rootfs ___________________________________ - `Docker based flow to build rootfs `_ Creating a sdcard image _______________________ - TODO Packaging the Kernel as a ``.deb`` __________________________________ - TODO Packaging userspace applications as ``.deb`` files __________________________________________________ - TODO Creating package repo for serving updates _________________________________________ - TODO Useful Links ============ - `OpenDingux blog post on new kernel and device tree cleanup work `_ - `Dingoonity forum tutorial on building an image from scratch `_ - `Raspberry Pi automatic filesytem resize deep dive `_ Citations ========= .. [1] https://github.com/OpenDingux/mininit#rootfs-image-layout