Documentation of initial GCW Zero image build process research
This commit is contained in:
@@ -0,0 +1,96 @@
|
|||||||
|
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 <http://gcw-zero.com/flashing>`_
|
||||||
|
- This was last updated 2015-07-23
|
||||||
|
- This is based on OpenDingux
|
||||||
|
- `Current OpenDingux development images <https://github.com/OpenDingux/buildroot>`_
|
||||||
|
- GCW Zero update packages, odboot binaries, and toolchains are available `here <https://github.com/OpenDingux/buildroot/releases>`_.
|
||||||
|
- 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 <https://github.com/eduardofilo/RG350_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 <https://github.com/eduardofilo/RG350_adam_image/blob/81b3e833640b8f1db69371dae47dabe248690dc9/build.sh#L6>`_.
|
||||||
|
- 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 <https://github.com/pcercuei/UBIBoot>`_
|
||||||
|
_______
|
||||||
|
- Bootloader for launching a Linux Kernel off a UBI partition
|
||||||
|
- This seems like it is used all over the place, but none of the images that I've looked at are using an UBI partition.
|
||||||
|
- They have been FAT32
|
||||||
|
- I should double check this, otherwise I'm a bit confused here.
|
||||||
|
- Maybe all the SDCard images have this program written to their first 512 bytes (MBR style)
|
||||||
|
- This would explain why the base offset for the `/boot` partition on the images is such a high number
|
||||||
|
- Is there a UBI partition that launches before the kernel in the FAT32 partition is loaded?
|
||||||
|
- This would probably not be visible when mounting the images
|
||||||
|
- I should reinvestigate this
|
||||||
|
- The Adam Image build scripts would probably be a good reference
|
||||||
|
|
||||||
|
|
||||||
|
Kernel
|
||||||
|
______
|
||||||
|
|
||||||
|
- It is probably best to use the OpenDingux built kernel for now.
|
||||||
|
- It looks like there is some upstreaming working being done, but the status of that in unknown.
|
||||||
|
- It would be cool to extract this from the buildroot flow so it could be built independently.
|
||||||
|
- One known issue with the latest OpenDingux kernel is that the display output doesn't work.
|
||||||
|
- This seems to be due to a conflict in the HDMI driver.
|
||||||
|
- I think disabling HDMI or removing the kernel module if there one might work around this.
|
||||||
|
- This might be fixed now based on `this thread <https://github.com/eduardofilo/RG350_adam_image/issues/262>`_ on the Adam Image issue tracker.
|
||||||
|
- I think this was a seperate issue based on the fact that the `fix <https://github.com/eduardofilo/RG350_adam_image/commit/f2c60849c90eb3ba6aab196604e8f66cce6b1d6e>`_ was in the Adam Image build scripts.
|
||||||
|
- Adam Image is using too old of a OpenDingux base to have hit this issue, as it was discovered in May 2022 [1]_
|
||||||
|
- One interesting tidbit from this thread is that the `OpenDingux maintainer seems to be working on fixing this issue <https://github.com/eduardofilo/RG350_adam_image/issues/262#issuecomment-1168830000>`_.
|
||||||
|
- This is helpful, as the github issue that this same person opened has no replies. [1]_
|
||||||
|
- This person might be overstating that the maintainer knowns, not sure here.
|
||||||
|
|
||||||
|
`Mininit <https://github.com/OpenDingux/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 [2]_.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Booting Debian
|
||||||
|
==============
|
||||||
|
|
||||||
|
Creating a boot partition
|
||||||
|
_________________________
|
||||||
|
- TODO
|
||||||
|
|
||||||
|
Creating a mips32le squashfs rootfs
|
||||||
|
___________________________________
|
||||||
|
- `Docker based flow to build rootfs <https://git.ohea.xyz/gcwzero/debian-rootfs>`_
|
||||||
|
|
||||||
|
Creating a sdcard image
|
||||||
|
_______________________
|
||||||
|
- TODO
|
||||||
|
|
||||||
|
Packaging the Kernel as a `.deb`
|
||||||
|
________________________________
|
||||||
|
- TODO
|
||||||
|
|
||||||
|
Packaging userspace applications as `.deb`s
|
||||||
|
___________________________________________
|
||||||
|
- TODO
|
||||||
|
|
||||||
|
Creating package repo for serving updates
|
||||||
|
_________________________________________
|
||||||
|
- TODO
|
||||||
|
|
||||||
|
Useful Links
|
||||||
|
============
|
||||||
|
- `OpenDingux blog post on new kernel and device tree cleanup work <https://opendingux.net/opendingux/2020/06/09/update-on-gcw-zero-20200531.html>`_
|
||||||
|
|
||||||
|
|
||||||
|
Citations
|
||||||
|
=========
|
||||||
|
.. [1] https://github.com/OpenDingux/buildroot/issues/77
|
||||||
|
.. [2] https://github.com/OpenDingux/mininit#rootfs-image-layout
|
||||||
Reference in New Issue
Block a user