Multipart MIME user-data format not supported

Bug #2035574 reported by Tim Black
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
New
Undecided
Unassigned

Bug Description

Some may call this a feature request, but I call it a bug, at least in the docs, since they claim Subiquity supports cloud-init user-data, implying it supports ALL of cloud-init user-data, including all standard formats. Here I request that subiquity add support for standard Multipart MIME user-data format, or to more clearly document precisely what kind of user-data it _does_ support and why, or to correct my logic and assumptions and show me how to properly specify and configure and use subiquity to apply a home-grown Multipart MIME formatted user-data to a server install. Thanks in advance for your time, insights, and good work on this useful project!

I've been researching, experimenting and reverse engineering subiquity for the last 2 days trying to understand how to provide my own multipart MIME user-data to subiquity and have fallen short writing the user-data archive (along with its empty meta-data brother) to various folders in my custom iso, custom squashfs, custom initrd. These informed my most recent attempt which was to assume that subiquity doesn't support Multipart MIME _at all_ as a format, and try to embed the archive, as created by the following command:

`cloud-init devel make-mime -a "cloud-config.yaml:cloud-config" -a "some-script.sh:x-shellscript-per-once"`

under the `user-data:` clause of my `autoinstall.yaml` file, a la:

```
user-data: |
    Content-Type: multipart/mixed; boundary="===============9020930996497418650=="
    MIME-Version: 1.0

    --===============9020930996497418650==
    Content-Type: text/cloud-config; charset="utf-8"
    MIME-Version: 1.0
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="./cloud-config.yaml"

    I2Nsb3VkLWNvbmZpZwpkaXNhYmxlX3Jvb3Q6IHRydWUKdGltZXpvbmU6IEFtZXJpY2EvQ2hpY2Fn
    bwpncm91cHM6CiAgLSBsaWJ2aXJ0CiAgLSBzdWRvCnVzZXJzOgogIC0gbmFtZTogdWJ1bnR1CiAg
    ICBwcmltYXJ5X2dyb3VwOiB1c2VycwogICAgZ3JvdXBzOgogICAgICAtIHN1ZG8KICAgICAgLSBs
    aWJ2aXJ0CiAgICAgIC0gbGlidmlydC1xZW11CiAgICAgIC0ga3ZtCiAgICBsb2NrX3Bhc3N3ZDog
.
.
.

    ZXQpIl0KCiMgcmVzdGFydCBhZnRlciBmaXJzdCBob3N0IGluaXRpYWwgcHJvdmlzaW9uaW5nCnBv
    d2VyX3N0YXRlOgogIGRlbGF5OiBub3cKICBtb2RlOiByZWJvb3QKICBtZXNzYWdlOiBSZWJvb3Rp
    bmcgbWFjaGluZQo=

    --===============9020930996497418650==
    Content-Type: text/x-shellscript-per-once; charset="utf-8"
    MIME-Version: 1.0
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="./pfsense-vm.sh"

    IyEvYmluL2Jhc2gKIyBEZXBsb3kgcGZTZW5zZSBWaXJ0dWFsIE1hY2hpbmUgdXNpbmcga3ZtK3Fl
    bXUrbGlidmlydAojCiMgUmVxdWlyZXM6CiMgICAtICRVU0VSIGlzIHBhc3N3b3JkbGVzcyBzdWRv
    ZXIgb3IgYWJsZSB0byBpbnRlcmFjdGl2ZWx5IGF1dGhOIGFzIHN1ZG9lcgojICAgLSAkVVNFUiBp
.
.
.
    fSIgIiR7Vk1fRElTS19QQVRIfS5iYWsiCmVsc2UKICBsb2cgIkVSUk9SOiB2aXJ0LWluc3RhbGwg
    cmV0dXJuZWQgJWIiICIkPyIKICBleGl0IDEKZmkKCgo=

    --===============9020930996497418650==--
```

I'm now placing this `autoinstall.yaml` at the root of /cdrom in a (slightly-modified) liveCD iso. The result of this is a crash, indicating this format isn't understood by subiquity as valid `user-data`:

```
 2023-09-14 05:10:58,547 DEBUG subiquity.server.server:478 load_autoinstall_config only_early False file /autoinstall.yaml
 2023-09-14 05:10:58,556 DEBUG root:37 start: subiquity/Early/load_autoinstall_data:
 2023-09-14 05:10:58,556 DEBUG root:37 finish: subiquity/Early/load_autoinstall_data: SUCCESS:
 2023-09-14 05:10:58,557 DEBUG root:37 start: subiquity/Reporting/load_autoinstall_data:
 2023-09-14 05:10:58,557 DEBUG root:37 finish: subiquity/Reporting/load_autoinstall_data: SUCCESS:
 2023-09-14 05:10:58,557 DEBUG root:37 start: subiquity/Error/load_autoinstall_data:
 2023-09-14 05:10:58,557 DEBUG root:37 finish: subiquity/Error/load_autoinstall_data: SUCCESS:
 2023-09-14 05:10:58,557 DEBUG root:37 start: subiquity/Userdata/load_autoinstall_data:
 2023-09-14 05:10:58,558 ERROR root:37 finish: subiquity/Userdata/load_autoinstall_data: FAIL: 'Content-Type: multipart/mixed; boundary="===============9020930996497418650=="\nMIME-Version: 1.0\n\n--===============9020930996497418650==\nContent-Type: text/cloud-config; charset="utf-8"\nMIME-Version: 1.0\nContent-Transfer-Encoding: base64\nContent-Disposition: attachment; filename="/home/tim/src/du/elcamino/cloud-config.yaml"\n\nI2Nsb3VkLWNvbmZpZwpkaXNhYmxlX3Jvb3Q6IHRydWUKdGltZXpvbmU6IEFtZXJpY2EvQ2hpY2Fn\nbwpncm91cHM6CiAgLSBsaWJ2aXJ0CiAgLSBzdWRvCnVzZXJzOgogIC0gbmFtZTogdWJ1bnR1CiAg\nICBwcmltYXJ5X2dyb3VwOiB1c2VycwogICAgZ3JvdXBzOgogICAgICAtIHN1ZG8KICAgICAgLSBs\naWJ2aXJ0CiAgICAgIC0gbGlidmlydC1xZW11CiAgICAgIC0ga3ZtCiAgICBsb2NrX3Bhc3N3ZDog\nZmFsc2UKICAgICMgZG9uJ3QgbmVlZCBQVyBzaW5jZSB1c2luZyBTU0gsIGxlYXZpbmcgdGhpcyBp\nbiB0aG91Z2guLi4KICAgICMgcGFzc3dvcmQgaXMgImNoYW5nZW1lIiAtIGNyZWF0ZWQgd2l0aCBg\nZG9ja2VyIHJ1biAtaXQgLS1ybSBhbHBpbmUgbWtwYXNzd2QgLS1tZXRob2Q9U0hBLTUxMmAKICAg\nICMgcGFzc3dkOiAiJDUkSVd3TnFMOVZVU0RvYzRKdiRERVVHUi5jWlFjYnovUXZkQ09tVTEzZlg1\nWlcwckFOZzhMcWtBdFgzbkJBIgogICAgc2hlbGw6IC9iaW4vYmFzaAogICAgIyB1c2UgY2F0IH4v\nLnNzaC9pZF9yc2EucHViIG9yIGdlbmVyYXRlIHRvIGdldCB5b3VyIHB1YmxpYyBrZXkKICAgIHNz\naF9hdXRob3JpemVkX2tleXM6CiAgICAgIC0gInNzc2gtZWQyNTUxOSBBQUFBQzNOemFDMWxaREkx\nTlRFNUFBQUFJUExlS0JWbGYyRDNKdUp2YW1sREpHQm9nbEp3aHp4M3kvTGxLYUJnWmR1TiIKICAg\nIHN1ZG86IEFMTD0oQUxMKSBOT1BBU1NXRDpBTEwKCmFwdDoKICBzb3VyY2VzOgogICAgbWFhcy1w\ncGE6CiAgICAgIHNvdXJjZTogcHBhOm1hYXMvMy40LW5leHQKcGFja2FnZV91cGRhdGU6IHRydWUK\ncGFja2FnZV91cGdyYWRlOiBmYWxzZQojICMgbWFhcyBwYWNrYWdlcyB3ZXJlIGZhaWxpbmcgdG8g\naW5zdGFsbCBpbnRvIGNocm9vdCBkdXJpbmcgY3VzdG9taXplLWlzby5zaC4KcGFja2FnZXM6CiAg
.
.
.
```

Tim Black (timblaktu)
tags: added: 22.04.3
tags: added: autoinstall cloud-init user-data
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.