98 Commits

Author SHA1 Message Date
Iain Lane
b68a5abf65
snap seeding: Defer validation for regular image builds
When getting the list of snaps to include on an image via germinate, we
process the snaps in alphabetical order. Currently we seed several
packages `gnome-foo` and also `gtk-common-themes`, the default provider
of `gtk-3-themes`. Since `gtk-common-themes` is alphabetically after
`gnome-foo`, the `seed.yaml` we generate is invalid when we are part way
through generating.

What we really care about, though, is not that the `seed.yaml` is always
valid at every step, but it is that it is valid at the *end* of seeding.
So for the germinate case, let's defer validation to happen once at the
end. Other callsites of `snap_preseed`, where callers are careful to
seed snaps in the right order, are unaffected by this.
2019-09-02 12:56:00 +01:00
Colin Watson
9a65a4013d Undivert update-initramfs more carefully
Previously the wrapper script and diversion were left in place on images
such as buildd images that don't have initramfs-tools installed.

LP: #1841573
2019-08-27 12:45:57 +01:00
Iain Lane
979dbde6a2
Fix slight whitespace error 2019-07-16 10:27:47 +01:00
Iain Lane
b208ded59e
Merge branch 'snap-validate-seed' of git+ssh://git.launchpad.net/~mvo/livecd-rootfs into ubuntu/master 2019-07-16 10:27:27 +01:00
Michael Vogt
4fb73c2b19 functions: use CHROOT_ROOT in snap_preseed 2019-07-16 08:29:09 +02:00
Michael Vogt
248efab2fd live-build: move snap seed validation into snap_preseed 2019-07-15 20:12:33 +02:00
Iain Lane
7f07cc8991
live-build/functions: Seed core again on non-minimized builds
This is apparently still required; without it snapd gives an error
message like:

  stateengine.go:102: state ensure error: devicemgr: cannot proceed without seeding "core"
2019-07-15 16:15:31 +01:00
Tobias Koch
18468c4218 Check exit status of snap-tool info call while determining base snap 2019-07-15 07:49:59 +02:00
David Krauser
0e3b1e206b
Add support for HyperV Gallery images 2019-06-11 23:26:07 -04:00
Pat Viafore
9bf4c7cb52
Adding apt-get autoremove and setting IMAGE_STR 2019-06-06 08:21:22 -05:00
Pat Viafore
afbda566eb
Adding hooks and making replace_kernel function 2019-06-06 08:20:45 -05:00
Michael Hudson-Doyle
42992467a1 Remove device nodes later for ubuntu-base:minimized (i.e. docker) builds. (LP: #1828118) 2019-05-08 10:04:23 +12:00
Steve Langasek
39f2558b96 Fix the sed script that Tobias had right in the first place and I mangled in the previous upload. 2019-04-13 02:13:17 -07:00
Steve Langasek
f4fa240ed7 Adjust sed command for clarity. 2019-04-12 13:37:02 -07:00
Tobias Koch
79e3123053 Make snapd-explicit-install-stamp a part of the image 2019-04-12 13:37:02 -07:00
Tobias Koch
796211dde7 If image has core18 snaps only, automatically preseed snapd 2019-04-12 13:37:02 -07:00
Tobias Koch
05e71b3840 Do not include any snaps in ubuntu-cpc:minimized builds 2019-04-12 13:37:02 -07:00
Steve Langasek
7e4a2627ed Use python3 vmdkstream exclusively; we should not fall back to python2. 2019-02-18 18:06:01 +01:00
Dimitri John Ledkov
a77ec4a9df
Add python3 vmdkstream support 2019-02-18 12:01:25 +01:00
Balint Reczey
8a78ab4021 Merge make-rprivate-before-umount 2019-02-05 17:10:49 +07:00
Balint Reczey
96cc185813 Merge feature/parallelization-snap-version-fixing 2019-02-05 17:06:24 +07:00
Didier Roche
1c435c03d2 Fix customized images with multiple brand/models
Some customized images are built from the same chroot, but need to
override brands and models.
2019-02-05 10:13:37 +01:00
Tobias Koch
654fcae467 Replace "snap download" with tool that uses snap store's coherence feature
This is important for parallel image builds to ensure all pre-seeded snaps
have the same versions across image variants.
2019-02-05 10:04:40 +01:00
Balint Reczey
33c5ad0b19 live-build/functions: Always use mount --make-private before umount
Util-linux 2.33 fixed mount --rbind --make-rslave which did not pass MS_REC
with MS_BIND and livecd-rootfs did only --bind --make-rslave effectively with
prior mount versions.
While mount --rbind --rslave are properly passed the flags to mount()
unmounting did not work cleanly with --make-rslave.

To clearly stop propagation of umount, --make-private is used instead of
--make-rslave and it is always set before umounts. Umount -R is replaced
with a simple umount since submounts are tore down in teardown_mountpoint()
earlier.

LP: #1813730
2019-02-05 07:54:37 +07:00
Jean-Baptiste Lallement
3dce125d72 Remove inidrd and vmlinuz from live layers after they've been moved to casper 2019-01-31 12:16:07 +01:00
Jean-Baptiste Lallement
f84d92d76f Calculate total size of the image + typos 2019-01-30 12:29:57 +01:00
Jean-Baptiste Lallement
402cdd15be Adds is_root_layer
Factored the code to detect if a layer is a root layer in function
is_root_layer and execute lb_chroot_archives only on root layers.
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
283871573d Changed the naming scheme for multi layer images to dot format 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
e0d30dd2d3 Fixed substract -> subtract 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
43ec452fa0 Moved reusable functions to functions
Moved functions to reuse in lb_binary and lb_chroot to functions
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
3b21bd9a2e Moved back config helper functions to config
Moved back config specific functions from functions to config
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
f3dadf1091 Support for positive and negative sublayers
Calculate positive and negative package lists for sublayers
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
1ab78e783b Generate snap list from task 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
00e474e2ff Make snap functions idempotent
_snap_preseed and snap_prepare_assertions can be called several times
with the same snap and will only provision it once.
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
ef72cf5fe8 Code refactoring:
* Moved *inheritance functions from config to functions
 * Moved code to extract snap from seed to snap_from_seed function
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
3e34faaa70 Moved add_task and add_package to functions in order to be available in hooks 2019-01-30 12:29:56 +01:00
Steve Langasek
77c44167df Delete no longer accurate comments 2018-11-13 11:21:19 -08:00
Cody Shepherd
c7e0c27607 [ Cody Shepherd ]
Fix snap-seed-parse to take filename argument instead of printing to
stdout
2018-11-08 15:10:09 -08:00
Dimitri John Ledkov
8868522e78 When calling snap-seed-parse append stdout to file, but redirect
stderr to stdout, thus unbreak autopkgtests.
2018-11-08 15:40:16 +00:00
Cody Shepherd
2819290352 Changed absoluted paths to relative; set changelog message to UNRELEASED 2018-10-23 10:32:52 -07:00
Cody Shepherd
5bee1ade70 Ensure pre-seeded snaps are now published in the image manifests. 2018-10-22 10:21:50 -07:00
Robert C Jennings
5bbb8e6b3f Improve snap model assertion code for readability 2018-09-27 15:15:55 -05:00
Robert C Jennings
0e00214cc6 Ensure snap models have been added prior to snap preseeding 2018-09-27 15:15:34 -05:00
Robert C Jennings
8d603cc87f Simplify snap model assertion customization 2018-09-27 13:09:50 -05:00
Robert C Jennings
97b0bbeed3 Add logging when snap assertions are not replaced 2018-09-27 12:55:57 -05:00
Robert C Jennings
52e5a2b25b Allow hooks to replace generic snap assertion
The generic assertion will be put in place if there are preseeded snaps.
A hook that wants to add its own model should be able to overwrite
the generic assertion.  This patch allows a hook to continue unchanged
calling snap_prepare_assertions with a custom brand/model.  The patch
will replace the generic brand/model if a custom brand/model is specified.
Prior to this patch the generic brand/model would remain in place.
2018-09-27 11:36:53 -05:00
Mathieu Trudel-Lapierre
056e760c06 Don't divert grub-probe; otherwise we're missing the filesystem UUIDs that
the grub search command needs to find the right prefix/root. This is
different than the PARTUUID for booting initrd-less.
2018-05-28 10:39:06 -04:00
Daniel Watkins
42ef796b92 Remove necessarily true conditional 2018-04-18 20:01:40 -04:00
Daniel Watkins
fe76613e69 Require brand:model to be passed to snap_prepare_assertions
We only need the default in one place, so remove it from all but the top-level
function.
2018-04-18 20:00:43 -04:00
Daniel Watkins
38518507ec Generalise other assertion paths 2018-04-18 14:47:41 -04:00