62 Commits

Author SHA1 Message Date
Ubuntu
c46aad38fa
Drop snap-tool
The cohort API used in the snap-tool has been dropped and
a replacement is needed.  Until then the code will be unused.
2019-05-21 17:32:47 -05:00
Robert C Jennings
620e17d2b7
ubuntu-cpc: parallel builds
* 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.

* Inject a proxy into the build providing a snapshot view of the package repo.

    When the REPO_SNAPSHOT_STAMP variable is set, the auto/build script will attempt
    to launch a transparent HTTP proxy on port 8080, and insert an iptables rule to
    redirect all outgoing HTTP requests to this proxy.

    The proxy, contained in the `magic-proxy` Python script, examines each request
    and silently overrides those pointing to InRelease files or files that are
    listed in InRelease files. It will instead provide the contents of the requested
    file as it was at REPO_SNAPSHOT_STAMP, by downloading the corresponding asset
    "by hash".

* Use series files with dependency handling to generate hook symlinks dynamically

    This patch currently only applies to the "ubuntu-cpc" project.

    More and more logic has been going into the hook scripts to decide
    under which conditions they should run or not. As we are moving
    to parallelized builds of image sets, this will get even more
    complicated. Base hooks will have to know which image sets they
    belong to and modification of the dependency chain between scripts
    will become more complicated and prone to errors, as the number of
    image sets grows.

    This patch introduces explicit ordering and dependency handling for
    scripts through the use of `series` files and an explicit syntax
    for dependency specification.
2019-05-21 17:32:47 -05:00
Cody Shepherd
f661d400a1 Fix snap-seed-parse to take filename argument instead of printing to
stdout
2018-11-13 10:48:25 -08: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
Daniel Watkins
265218c1cb Don't include model assertion name in FS path (LP: #1764541)
There can only be one model assertion, so we don't need to disambiguate them.
This also brings us in line with the behaviour of `snap prepare-image`, and
consistency is nice.
2018-04-18 12:41:47 -04:00
Daniel Watkins
a09c14c0ab Fix missing local variables 2018-04-18 10:06:55 -04:00
Daniel Watkins
a844c6f8cd Fix another unbound variable 2018-04-17 22:01:47 -04:00
Daniel Watkins
ed50ee0e0d Fix use of unbound variable 2018-04-17 17:35:10 -04:00
Daniel Watkins
d908e89a52 Fix typo 2018-04-17 16:32:44 -04:00
Daniel Watkins
54649b40c3 Allow custom model assertions in snap_prepare_assertions
This also splits up the preparation in to two functions, so that images that
want to use a custom model assertion but don't have any snaps to preinstall
don't end up with the core snap installed.
2018-04-17 14:46:56 -04:00
Robert C Jennings
26f31fbd9c live-build/functions: spelling fix 2018-04-10 16:33:22 -05:00
Robert C Jennings
5f12253791 live-build/functions: Help developers resolve snap download issues 2018-04-10 15:03:23 -05:00
Robert C Jennings
73dba1f31a snap preseeding: capture Ubuntu snap seeding policy in code
When no channel is given for a pre-seeded snap, the channel
should be stable/ubuntu-XX.YY to match Ubuntu policy.

This patch adds the LB_DISTRIBUTION var to config/{binary,chroot}
to have a common way of determining the Ubuntu XX.YY version
number between hooks and auto/build.
2018-04-10 11:59:19 -05:00
Robert C Jennings
cbcb5d3ed8 live-build/functions: reduce scope of snap account variable
* Only shell out to set $account when we need to use it.
* Reduce scope of $account to make it local to the function
* Fix indenting within an 'if' block
2018-04-10 10:09:26 -05:00
Robert C Jennings
0dbaf4cc9d live-build/functions: Drop spurious backslash 2018-04-06 20:14:23 -05:00
Robert C Jennings
936c3dbc79 live-build/functions: Update snap seed.yaml format to comply with yaml spec 2018-04-06 17:05:15 -05:00
Robert C Jennings
829716a6d7 live-build/functions: Change arithmetic to make the file 'sh' friendly 2018-04-06 17:03:27 -05:00
Robert C Jennings
e655aff7b1 live-build/functions: Migrate from generic snap account-id 2018-04-06 12:51:47 -05:00
Robert C Jennings
152adcaa04 live-build/functions: add snap preseeding support 2018-04-03 05:12:22 -05:00
Steve Langasek
8fddc6b469 Merge lp:~vorlon/livecd-rootfs/many-loops 2018-03-06 10:30:25 +01:00
Michael Hudson-Doyle
4407aaf1ae it is config/common, not config/binary, grr 2018-02-23 14:58:03 +13:00
Michael Hudson-Doyle
27eaa9328a source config/binary in 032-installer-squashfs.binary 2018-02-23 13:38:15 +13:00
Michael Hudson-Doyle
3e69d30c9e remove some of the cargo culted scorpions 2018-02-23 09:52:26 +13:00
Michael Hudson-Doyle
4b66f89e56 move skip_lb_stage to config 2018-02-23 09:37:51 +13:00
Michael Hudson-Doyle
416ef912ed make another possibly more generally useful function 2018-02-23 09:30:29 +13:00
Michael Hudson-Doyle
c85cae9bfe respond to some review feedback 2018-02-23 09:18:33 +13:00
Balint Reczey
3631c1f778 Zero fill space in UEFI partitions, too 2017-11-23 20:27:16 +01:00
Steve Langasek
1976255e5c divert /usr/bin/systemd-detect-virt as part of the grub diversions, so
that the grub kernel postinst hook is operational when we're building
in a container.  LP: #1729034.
2017-10-31 09:58:22 -07:00
Steve Langasek
dfaf247193 Properly handle loop device names when there are > 10 devices on the
system.
2017-10-21 00:54:02 -07:00
Dimitri John Ledkov
4b9e6e811f Now that grub-related diversions have been factored out in 2.466
instead of having bogus root=stuff arg generated in grub.cfg, it is
actually empty. Therefore update the sed command to make the arg in
the root= token optional. This should resolve non-booting livecd cpc
images.
2017-10-10 13:23:30 +01:00
Steve Langasek
90e7ee57c3 and the filename was still wrong 2017-10-04 23:50:26 -07:00
Steve Langasek
bc221a8d67 fix a remaining wrong reference to /etc/default/grub.d/40-partuuid 2017-10-04 23:38:22 -07:00
Steve Langasek
a75cbf210b Fix the force-partuuid handling to create the file under
/etc/default/grub.d/ with a .cfg extension as grub expects; it's unclear
how this ever worked without.
2017-10-04 22:51:30 -07:00
Steve Langasek
a5e27120c0 Factor out grub-related diversions and use them consistently, so we
don't end up with wrong os-probe output in our grub.cfg.
2017-10-04 22:33:41 -07:00
Balint Reczey
c5d01a6635 Force partuuid in /etc/default/grub.d/* instead of in /etc/default/grub
This prevents ucf questions upon installation of changed /etc/default/grub
2017-09-27 18:54:09 -04:00
Steve Langasek
3ed1f4fdd1 In a cloud environment, we can rely on the kernel being able to boot the
root filesystem directly, without an initramfs; enable this when
building minimized.
2017-09-26 22:39:09 -04:00
Balint Reczey
45201111a6 Mount using --make-rslave to ensure safe unmounts for rbind mounts 2017-09-25 11:42:28 -04:00
Steve Langasek
801aad2f77 * Improve teardown_mountpoint to recursively find all submounts and
unmount them, instead of working from a hard-coded list.  This makes
  the code resilient against other submounts being added later, including
  downstream.
* Also nuke the sleep / udevadm settle calls in the process, which should
  never be required and slow down the builds.
2017-09-13 13:42:28 -07:00
Steve Langasek
c9ef91e262 Restore the call to 'umount -R $mountpoint' from umount_partition,
accidentally dropped in previous upload.
2017-09-13 12:50:07 -07:00
Robert C Jennings
83b4f5338c live-build/ubuntu-cpc/functions: Add teardown_mountpoint to reverse setup_mountpoint
* live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint,
  to reverse the work done in setup_mountpoint.  Lack of this function
  has forced users of setup_mountpoint to implement this separately
  and the implementations have diverged. (LP: #1716992)
* live-build/ubuntu-cpc/functions: Remove umount_settle function.
  The was only used where teardown_mountpoint was lacking.
2017-09-13 13:31:12 -05:00