Skip to content

Latest commit

 

History

History
87 lines (65 loc) · 3.08 KB

README.md

File metadata and controls

87 lines (65 loc) · 3.08 KB

fedIPA

Description

Based upon Fedora this tooling creates with mkosi

  • a standard kernel of the OS
  • a ramdisk which is enabled to download and boot a rootdisk via HTTPS
  • and a squashfs file, which contains the ironic-python-agent

See mkosi for more details on the build-process.

mkosi.build takes the (python) sources (ironic-python-agent and extensions, which are referenced as submodules as input and generates wheels into the destination image.

The submodules under sources as well mkosi and the requirements should capture the exact versions in each commit used.

mkosi then generates the output under mkosi.output/*/ (* depends on the distribution and version chosen) More specifically:

  • image/: the directory containing the final image file-system, including the ironic-python-agent + extensions
  • image.vmlinuz: the (unmodified) kernel of the operating system
  • image.initrd: the ramdisk as generated by dracut

On top of that, we use mksquashfs to generate a image.squashfs file from the image/ directory.

Requirements

  • git
  • python3 >= 3.5
  • systemd-nspawn
  • dnf
  • make
  • squashfs-tools
  • ovmf
  • lighttpd (for testing)
  • qemu-kvm (for testing)
  • xorriso (for iso creation)

HowTo

You can simply run the following commands to create the desired output:

if [ -f /etc/debian_version ]; then
    sudo apt install dnf git python3 make systemd-container qemu-kvm lighttpd lighttpd-modules-lua squashfs-tools ovmf
else
    sudo dnf install git python3 make systemd-container qemu-kvm lighttpd squashfs-tools xorriso edk2-ovmf
fi
make

How to modify the contents of the image

Packages

If packages need to be available during the build they need to be added to the list of BuildPackages in mkosi.files/mkosi.fedora, if they should be in the final image, they need to be under Packages.

Files

Any file placed under mkosi.extra will be placed in the image. Files/Directories can be removed by adding a glob-expression to squashfs.exclude

How to configure the ramdisk

The whole configuration for the ramdisk is within mkosi.extra/etc/dracut.conf.d/99-ipa.conf. As all files under mosi.extra also are added to the build image before the ramdisk is being created, it serves as the configuration for the build-process.

In particular, you can add/remove kernel-modules / filesystems etc...

How to develop/debug

If you run make test, it will generate all the files mentioned before, and start a virtual machine with qemu which will boot the generated kernel and ramdisk, which in turn will load via http the image.squashfs. A http server will serve the generated files, and a mock api server will be answering the lookup and heartbeat api calls.

The virtual machine exposes the ironic-python-agent api over port 9999 on the local host.

The api discovery is returning an api-version, which is not secured by either certificate or token, so you should be able to issue http request / command with the tool of your choice.