39 Commits

Author SHA1 Message Date
Dimitri John Ledkov
dc7519a44a Create subiquity meta-package hint 2023-10-02 17:28:40 +01:00
Dimitri John Ledkov
deb31732db Ensure chroot_linux-image is only exectued on live layers
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2023-10-02 10:39:30 +01:00
Steve Langasek
b30e7e4146 lb_chroot_layered: if the unmount of the chroot mountpoint fails, dump mount information for debugging. 2023-08-29 10:39:21 -07:00
Michael Hudson-Doyle
6890dfe5ca Deduplicate the layers just before creating the squashfs, to enable deduplication of the result of binary hooks as well. 2023-08-23 22:14:15 +12:00
Michael Hudson-Doyle
cf75120068 lb_chroot_layered: use rsync to make more minimal overlay layers. (LP: #2028213) 2023-08-02 13:18:03 +12:00
Michael Hudson-Doyle
75fe0241f3 lb_chroot_layered: fix quoting when searching for trusted.overlay.opaque 2021-07-30 11:56:07 +12:00
Michael Hudson-Doyle
bb0bba1793 address review comments 2021-07-08 11:50:22 +12:00
Michael Hudson-Doyle
2928c3d9cd fix reduce_pass_size behaviour around deleted directories 2021-07-07 19:31:53 +12:00
Michael Hudson-Doyle
18bf308be0 go back to only running 'lb chroot_archives' on root layers
but still run configure_universe after archive removal, not before
2021-07-01 11:16:11 +12:00
Michael Hudson-Doyle
c4402139a2 go back to only running lb_chroot_hacks on live layers
otherwise each and every layer above a layer with a kernel gets its own
initramfs, which is silly.

Copy/paste the cruft cleaning bit of lb_chroot_hacks to be run on
non-live layers.
2021-07-01 11:16:11 +12:00
Michael Hudson-Doyle
653b925646 attempt to fix obscure failure 2021-07-01 11:16:11 +12:00
Michael Hudson-Doyle
30cc2f1982 lb_chroot_layered: install archives on each layer
also only call configure_universe after packages are installed.
2021-07-01 11:16:10 +12:00
Michael Hudson-Doyle
3a3558203b run chroot_hacks on each layer in lb_chroot_layered
the comment says this was not done to avoid overlay size inflation but aiui reduce_pass_size
deals with that now
2021-07-01 11:16:10 +12:00
Sebastien Bacher
fb0d16ea8a Correctly set the environment needed by snapd in layered
The change is similar to commit #1ca11c97 but for the canary image.
2020-11-24 11:38:10 +01:00
Dimitri John Ledkov
9a6f28c131 lb_chroot_layered: also snap_validate_seed after all snaps are seeded
Cherrypick of the similar change done in the non-layered codepath.
2019-09-13 12:36:20 +01:00
Dimitri John Ledkov
b9f9dc1ca5 Execute chroot_hacks in live layer only.
As discussed and explained to Jibel and Didier on 17th of June, based
on canary image build logs, it showed clearly that lb controlled
initrd was only built once at the very first layer by
chroot_hacks. However, that is the wrong layer to build the final
initrd at, as at this point casper is not present yet and is not part
of the build.

Thus insure that chroot_hacks only runs at the live layer.

Ideally a subset of chroot_hacks should run on every layer, as each
layer should be squeaky clean, and most of layers without
initrds. However, jibel & didrocks are still implementing requested
patches to unbreak layer images and make each layer smaller. Hence
this minimal portion of the overall required work.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2019-09-11 14:40:56 +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
Colin Watson
ce58687eed Fix placement of update-grub undiversion
Chroot deconfiguration should happen in the opposite order from chroot
configuration, so, for symmetry, undivert_grub should be called between
"lb chroot_debianchroot remove" and "lb chroot_sysfs remove".
2019-08-27 09:17:55 +01:00
Julian Andres Klode
e95ad81c47 Run clean_debian_chroot after minimize_manual
This avoids us having apt cache files in the final image.

For auto/build, we move the call to clean_debian_chroot to the end,
this also takes care of the caches generated by apt-get update
in case of a preinstalled-pool.

For layered, it's just a simple swap of the lines.

LP: #1826377
2019-04-25 11:51:30 +02:00
Jean-Baptiste Lallement
38bb0b3301 Fix grub divert for multilayer images
grub-probe must not be called during image build so grub is diverted. In
multilayer image the chroot is always the tip of the filesystem, so we
divert grub at the beginning of each pass and undivdert it as the end.
For flat images, it's diverted just before building the chroot and
undiverted after.
2019-03-18 09:33:07 +01:00
Jean-Baptiste Lallement
f5d3233c64 Fixed wonky indentation 2019-01-31 09:39:22 +01:00
Jean-Baptiste Lallement
f84d92d76f Calculate total size of the image + typos 2019-01-30 12:29:57 +01:00
Jean-Baptiste Lallement
52d9bd3ead Run live specific scripts on non live layers
Allow execution of lb_binary_linux-image and lb_chroot_live-packages on
any layer by setting LIVE_PASSES.
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
d1a2e24c41 Adds reduce_pass_size
Adds a function reduce_pass_size which removes duplicated files between
layers. A duplicate file is a file with same path, size, mode, owners
and content on 2 related layers.
2019-01-30 12:29:56 +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
2d2ce6eea4 Rename chroot.$PASS -> overlay.$PASS 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
15cacaee96 configure network manager _after_ installing network-manager 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
9dba350834 Added lb_binary_layered
Created lb_binary_layered based on lb_binary
Factorized several helpers
These helpers are called from lb_chroot
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
693e0a7360 Clean up chroot helpers
Removed obsolete chroot helpers on Disco+:
 - selinux
 - sysv-rc
 - upstart

Added a note about needlessly triggering chroot_archives on each pass.
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
9077289332 Add includes by pass
lb_chroot_includes now takes the name of the pass as first argument and
will includes files for the corresponding pass from the directory
include.chroot.<pass>
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
a9908e0c9d Add support for negative package lists 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
53b06af931 Added sublayers support
Adds support for sublayers by defining package lists corresponding to
each sublayer. The name of the package list defines the name of the
layer.
2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
903ba3b276 Actually install snap for each layer. 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
0f4fcbc7d3 lb_chroot_layered: Export _PASS as PASS to be available in hooks 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
7e2f4d4304 live-build/lb_chroot_layered: removed useless comment 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
940873e6cb live-build/lb_chroot_layered: overlayfs supports only 2 stacked layers. Changed the code to use several lower dirs instead like casper does 2019-01-30 12:29:56 +01:00
Jean-Baptiste Lallement
7b4acba31d * Added lb_chroot_layered to add support for multi layered squashfs images
* auto/*: Added live-layered image format
2019-01-30 12:29:56 +01:00