snapd icon indicating copy to clipboard operation
snapd copied to clipboard

snap-bootstrap: experimental: handling install/factory reset steps within snap-bootstrap

Open kubiko opened this issue 3 years ago • 3 comments

This is a reference PR implementing install and factory-reset modes within snap-bootstrap It should server also as tracking for the work done so far. This activity is split across multiple PRs and not all might be mentioned here, especially if they have already landed. As such, this PR can be regularly rebased and force-pushed to update tracking.

Current state: install mode support had landed on the master branch

Related PRs: Open: https://github.com/snapcore/snapd/pull/12641

Landed: https://github.com/snapcore/snapd/pull/12846

Keeping original descriptions around for reference: Original description:

Experimental attempt to handle install step within snap-bootstrap, effectively compressing initial install into a single boot.

Since the install step relies on additional tools to manage partitions, create file systems, set up encryption, this change has to be also accompanied by additional tools in initramfs. As a reference of initramfs size increases:

  • additional tools and extra features in snap-bootstrap (sec tools) resulted in 2.3MB size increase for UC22 (arm64, zstd compression)

TODOs: Improve seed meta loading. We load seed meta 3 times(assuming preseeded image)

  • initial essential snaps for install, hashes: kernel, base, gadget
  • handling preseed, hashes: all
  • post-install snapd handling, hashes: snapd Since we support parallelism we should ideally:
  • load all the essentials (kernel, core, snapd, gadget) most systems are either single and 4+ cores
  • reuse the hash of essential snaps and only hash other snaps

kubiko avatar Dec 01 '22 02:12 kubiko

@kubiko is this still useful/relevant?

ernestl avatar Feb 27 '24 23:02 ernestl

Discussed with @kubiko , this is still relevant and should not be removed.

ernestl avatar Feb 28 '24 07:02 ernestl