For MAAS to be an effective solution in our infrastructure, we require it to be able too boot our servers to a specific FreeDOS.img containing firmware upgrade tools/files. Currently we have a pxeMenu doing this which also serves as a means of provisioning our servers with ubuntu/preseed. We want to replace this with MAAS but need to figure out how to install firmwares which can't be upgraded from an ubuntu box.

I'll try explining what I did to make it work (hackishly) so that somebody can suggest a better (or even a supported) way of doing it. One thing I'm finding is that Maas is very poorly documented. I'm currently testing out version 2.4 in bionic in KVM machines which act as if they were bare metal.

Tests: 1) (TL;DR this didn't work!) Importing the freedos image as ddraw. maas user boot-resources create name=custom/freedos architecture=amd64/generic content@=/opt/images/freedos.img filetype=ddraw maas user boot-resources import

Once imported I deploy the custom image. It pxe boots correctly to the comissioning image. Curtin seems to try dd'ing the freedos.img to the hard disk which I suppose can be fixed later. But after the first reboot it tries to TFTP the freedos.img and it fails. It tries to source the image from an incorrect directory (custom/amd64/ga-18.04/freedos/no-such-image/boot-kernel...).

I did not like this for the moment so I decided to try a diferent method.

2) Importing as freedos.tgz then hacked my way through: Mount loop'd the img and extracted the files. Then imported it. It would not find the file as usual... That's when I decided to try forcing tftp to find it through the correct path from the server's console. It (kinda) worked. The image started downloading, but pxelinux was expecting it to be the kernel.

So I decided to try the following as I now paid attention to the expected file paths:

  • In /var/lib/maas/boot-resources/snapshot-20190718-194439/custom/amd64/ created symlink ga-18.04 -> generic/.
  • In /var/lib/maas/boot-resources/snapshot-20190718-194439/custom/amd64/generic/freedos/ created symlink no-such-image -> uploaded/.
  • Uploaded the freedos kernel (memdisk) and renamed it boot-kernel.
  • Created symlink boot-initrd -> root-tgz (for consistency).

This didn't work either. The kernel stays at Loading boot sector... booting... and nothing happens. So I tried replacing the root-tgz (which is the freedos.tgz which MAAS renames) with freedos.img but also named root-tgz and keeping the symlink to it called boot-kernel.

Success! I got a FreeDOS prompt after it finished loading the image. Obviously the deployment in MAAS reported failure (which is something that maybe I can live with).

But then I tried cleaning up old images that I had imported and after running: maas user boot-resource delete <num> I ended up breaking the hack, as MAAS decided to re-build the snapshot.

My questions are: Are there any ways to make this work without making such a mess?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.