How MAAS Installs Curtin

Hi, I want to ask: how does MAAS install Curtin during deployment or testing?
I unsquashed the squashfs ephemeral image and got this:

Package: curtin
Architecture: all
Version: 21.3-0ubuntu1
Priority: extra
Section: admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 31
Depends: bcache-tools, btrfs-progs | btrfs-tools, dosfstools, file, gdisk, lvm2, mdadm, parted, probert-storage | probert, python3-curtin (= 21.3-0ubuntu1), udev, xfsprogs
Filename: pool/main/c/curtin/curtin_21.3-0ubuntu1_all.deb
Size: 2290
MD5sum: 3eaf42d00dcf712ca4359a4c82152ba3
SHA1: 7996355689b23acff60196e834b70328c5e9e510
SHA256: 62c53347e470b39f2349a56a404cedf1ce784cf60dfa9d9a648ab421bb64af68
SHA512: b8ed2c3ea016972bed4a12270566fe25610314e2ce36ee50a79bb4b587d350e740028406f7377426df744c60aabdc93c202742ab9b09ea7ce03902899f20f5a4
Homepage: http://launchpad.net/curtin
Description: Library and tools for the curtin installer
Description-md5: 131b2c82b3ac98e404f8679da8cf7637

Package: curtin-common
Architecture: all
Version: 21.3-0ubuntu1
Priority: extra
Section: admin
Source: curtin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 60
Filename: pool/main/c/curtin/curtin-common_21.3-0ubuntu1_all.deb
Size: 14600
MD5sum: 50a92bb1525f2f7df9bf67a7969ce62d
SHA1: db70375e0abc253f1789fe1807a2b5d4309a69de
SHA256: 9e0940a1743efd860b8229ce30f2413fc1ff6f53e67fe4b57119bb4a9824c1a0
SHA512: 12b900ec014b89fd9d00e2d5829218541d539fd1c10a70af85034d271cf85ff2219d54f319ca412d8a619857c056983ccaf3393637667fdc15541988723e2f7d
Homepage: http://launchpad.net/curtin
Description: Library and tools for curtin installer
Description-md5: b24ac6ac0cf9c430ccd5e7cc40c446ae

But during installation or testing, it uses:

curtin: Installation started. (23.1.1-1100-g95345797-0ubuntu1~ubuntu22.04.1)
start: cmd-install/stage-partitioning/builtin/cmd-block-meta: curtin command block-meta
get_path_to_storage_volume for volume nvme0n1({'id': 'nvme0n1', 'model': 'SAMSUNG MZQL23T8HCLS-00A07', 'name': 'nvme0n1', 'serial': 'S64HNN0X230107', 'type': 'disk', 'wipe': 'superblock'})
Processing serial S64HNN0X230107 via udev to S64HNN0X230107

I’m asking this because I want to know, can I change the Curtin version and self-host the images.maas.io repository with a different Curtin version ?

Curtin is provided by MAAS itself. The machine will ask for it and MAAS provides it as an archive. Then the machine extracts it and use it as a normal python script

Hi @r00ta

Can I ask which part of MAAS provides this? I tried using my own version of Curtin but I’m not sure how MAAS handles it.

Thank you.

If you want to use a different version of curtin you have to rebuild MAAS from sources and replace it. If you are building the deb, then you can put your curtin version inside the PPA. If you are building the snap, you can edit the snapcraft.yaml maas/snap/snapcraft.yaml at master · canonical/maas · GitHub and put

package-repositories:
 - type: apt
   ppa: curtin-dev/CHANGEME

and rebuild the snap according to maas/HACKING.rst at master · canonical/maas · GitHub

Also, you’d better to checkout the 3.5 or 3.6 branch instead of using master.

As for the place where this happens, see maas/src/maasserver/preseed.py at 9616c91c8983bc02a89417855bd16f376797c376 · canonical/maas · GitHub . pack_install is packing curtin itself with such arguments and the result is sent over the wire

I thought this was read by the Curtin configuration, and that Curtin was already installed with the specific version, since this configuration includes settings for storage, network, etc.

nope, that’s the entire boundle that contains curtin itself and everything it needs to be executed. BTW, why do you need to use another version of curtin?

Oh, I tried using my own version of Curtin to test a few things on MAAS and see if it was possible.