Purpose:
-
Build CoreOS images in docker container.
-
Build realtime kernel for CoreOS The stable CoreOS kernel is patched with the Linux PREEMPT_RT patchset.
-
Build tarball that can be used to build kernel modules for CoreOS
-
Create an environment where the CoreOS images can be rebuilt offline
Instruction:
-
Build docker image docker build -t inaetics/coreos_sdk_stage0 .
-
Build script docker run inaetics/coreos_sdk_stage0 ./src/third_party/inaetics/coreos_sdk.sh build_script > coreos_sdk.sh chmod +x coreos_sdk.sh
-
Create CoreOS SDK container ./coreos_sdk.sh prepare_coreos_sdk
-
Extend SDK container with all package sources needed ./coreos_sdk.sh build_target_online
-
Build the CoreOS image (first stage that runs without network) ./coreos_sdk.sh build_image
-
Optionally: build kernel modules package ./coreos_sdk.sh build_kernel_module_dir
Bugs
- ./coreos_sdk.sh prepare_build_offline fails
Note: the script creates a number of very large (at most 15GB) named docker containers. Remove these manually
Updating to a new CoreOS release:
- The version number is in the Dockerfile and in the resources/coreos_sdk.sh
- Perform the steps until prepare_coreos_sdk
- Extract the new kernel config file and add the PREEMPT_RT settings
- Extract the ebuild files of coreos-sources and coreos-firmware from the coreos_container_stage1 image
- Download the rt patchset that is closest to the version used in CoreOS and rename it to the same version number as CoreOS has with the rt extension.
- Make the necessary changes in the ebuild files (version number and rt patch)
Testing pxe boot with qemu (Used qemu 2.6.2-6.fc24):
qemu-system-x86_64 -boot n -net user,tftp=pwd
,bootfile=/pxelinux.0 -net nic -m 1024
Analysing the emerge environment
- Tests are done inside the chromite/cros_sdk environment Adapt src/third_party/coreos-overlay/eclass/coreos-kernel.eclass Add -rt10 to COREOS_SOURCE_VERSION but then also in coreos-overlay/sys-kernel/coreos-sources-rt2-rt10 is needed
- Involved are third-pary/portage/eclass/linux-info.eclass third-party/coreos-overlay/eclass/coreos-kernel.eclass The ebuild and eclass files are not so much different from the originals but didn't create patches Check the lines that contain -rt10 to find the real differences