curtin in-target commands do not work for ubuntu core

Bug #1710177 reported by Alfonso Sanchez-Beato
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned
curtin
Expired
Undecided
Unassigned

Bug Description

I have created a Ubuntu Core 16 image (with cloud-init enabled), and added it to MAAS with:

# maas admin boot-resources create name=ubuntu-core/test-image title="UC16 Image" architecture=amd64/generic filetype=ddxz content@=ubuntu-core-maas.img.xz

I am able to deploy the image to a node correctly. However, I have tried to run commands in the curtin installation, for instance:

---------------------------------------------------------
# cat /etc/maas/preseeds/curtin_userdata_ubuntu-core
#cloud-config
debconf_selections:
 maas: |
  {{for line in str(curtin_preseed).splitlines()}}
  {{line}}
  {{endfor}}

late_commands:
  maas: [wget, '--no-proxy', '{{node_disable_pxe_url}}', '--post-data', '{{node_disable_pxe_data}}', '-O', '/dev/null']
  test_01: ls /
  test_01: curtin in-target -- ls /
---------------------------------------------------------

And regardless of the command that runs as "curtin in-target", I always get a "Command not found" error.

This, however, does not happen for classic images, so there is some issue in curtin or MAAS that prevents this from working on UC16 images.

Changed in maas:
milestone: none → 2.3.0
Revision history for this message
Ryan Harper (raharper) wrote :

Ubuntu-core does not have an in-target (which means, chroot into this image and run commands) as Ubuntu-core root file system is not mounted and immutable (by design).

What sort of commands/modifications are you expecting to do to an Ubuntu-core image?

Changed in curtin:
status: New → Incomplete
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

@Ryan, there is a writable partition that can be modified to provide initial configuration, but is is true that there is no shell binary you can jump into using chroot.

I wonder if that partition is mounted in the non-"in-target" environment and it could be modified directly from there?

Revision history for this message
Ryan Harper (raharper) wrote :

The writable partition is mounted, that's how curtin configures cloud-init in the ubuntu-core image.

Additional write_files[1] directives should work, but it's still not clear what other modifications you're looking to perform.

http://curtin.readthedocs.io/en/latest/topics/config.html#write-files

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Things like modifying the kernel command line to add the right parameters for the switch serial port is what I foresee. Doable if the writable partition is mounted. Thanks for the answer.

Revision history for this message
Ryan Harper (raharper) wrote : Re: [Bug 1710177] Re: curtin in-target commands do not work for ubuntu core

In general, those sorts of changes are handled by the gadget snap.
I'm not sure that these local modification are going to be retained long
term.
When the gadget is refreshed then it's not going to retain your changes.

https://docs.ubuntu.com/core/en/guides/build-device/gadget
https://docs.ubuntu.com/core/en/reference/gadget

On Fri, Aug 25, 2017 at 11:27 AM, Alfonso Sanchez-Beato <
<email address hidden>> wrote:

> Things like modifying the kernel command line to add the right
> parameters for the switch serial port is what I foresee. Doable if the
> writable partition is mounted. Thanks for the answer.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1710177
>
> Title:
> curtin in-target commands do not work for ubuntu core
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/curtin/+bug/1710177/+subscriptions
>

Changed in maas:
status: New → Invalid
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

@Ryan, true, but that does not rule out other modifications, like pre-seeding assertions and the like. Anyway, provided the writable partition is mounted, things like that can be handled.

Changed in maas:
milestone: 2.3.0 → 2.3.x
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for curtin because there has been no activity for 60 days.]

Changed in curtin:
status: Incomplete → Expired
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.