[Bug 1751249] Re: Using “content:” in gadget.yaml for a “role: system-data” partition makes it not be system-data anymore
Łukasz Zemczak
1751249 at bugs.launchpad.net
Thu Mar 15 16:50:40 UTC 2018
@ogra: I just performed some experiments while trying to reproduce this
bug, but my observations are a bit different than yours. Actually it's
still more or less a bug, but not as severe. The story:
So what I noticed happening is: when there is a system-data partition,
ubuntu-image actually never considers the content: section of the
partition's definition when creating the partition *images*. At one
point we do copy over the content-defined parts to the partX/ directory
for every partition (which is what you saw in comment #1), but for
system-data partitions we basically ignore the contents of that
directory and only create a clean ext4 partition with the rootfs
contents only.
You can check that is the case by going to the volumes directory (after
using -b ./build or similar) and mounting the part3.img image file (or
whichever partition number it has) and looking into its contents. You
should only see the rootfs data there. In this case the part3/ directory
contents have no correlation to what's in part3.img. Which is why
looking into the part3/ dir and seeing files without the rootfs could
cause confusion.
This means that basically right now the "role: system-data" role takes
precedence over the "content:" definition, so the end result should fit
your expectation as per the bug description. I'm not saying this is what
we ultimately want, but I'm just saying that in theory an image built
with a gadget.yaml like this should still have a 'valid' rootfs.
This makes me wonder: are you sure you do not have the rootfs contents
in your system-data partition in the final image? Maybe I am seeing
something different han you on your system?
That being said, the current behavior is not correct for sure, but I
still need to think if this should be done by ubuntu-image or by snap
prepare-image. Might be that the original idea was for the
responsibility to be on the u-i side, seeing that we do handle the
'content:' parsing anyway for all other partition roles, but let me
think about it a bit more.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-image in Ubuntu.
https://bugs.launchpad.net/bugs/1751249
Title:
Using “content:” in gadget.yaml for a “role: system-data” partition
makes it not be system-data anymore
Status in Ubuntu Image:
New
Status in ubuntu-image package in Ubuntu:
New
Bug description:
The core team thinks this is an ubuntu image bug, so i'm filing this
here additionally to
https://forum.snapcraft.io/t/using-content-for-a-role-system-data-
partition-makes-it-not-be-system-data-anymore
When i use a gadget.yaml entry like:
- name: writable
type: 83,0FC63DAF-8483-4772-8E79-3D69D8477DE4
filesystem: ext4
filesystem-label: writable
size: 270M
role: system-data
content:
- source: writable/
target: /
The partition is not pre-populated with snaps and seed but only the
files defined in content are copied in.
I would expect that the partition is still properly pre-populated with
the usual writable/system-data content and that the content from the
content: entry is additionally copied in place. Or at least that the
role: system-data takes precedence here if this combination is not
allowed (though snapcraft or ubuntu-image should then spill a warning
at least) so that a bootable system exists.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-image/+bug/1751249/+subscriptions
More information about the foundations-bugs
mailing list