mbox series

[v11,0/8] Migrate to mmdebstrap

Message ID 20241106082117.1089554-1-amikan@ilbers.de
Headers show
Series Migrate to mmdebstrap | expand

Message

Anton Mikanovich Nov. 6, 2024, 8:21 a.m. UTC
Switch Isar from debootstrap to mmdebstrap.

It makes isar-bootstrap target ~10..30% faster on both cross and native
rootfs types. Some measurements on qemuarm64-bookworm (required debs are
predownloaded and used during deb-dl-import):

- 20s vs 28s for "isar-bootstrap-host"
- 1m32s vs 1m48s for "isar-bootstrap-target

Also mmdebstrap support using SOURCE_DATE_EPOCH for images reproducibly
out of the box. But the main advantage is an ability to remove sudo for
debootstrapping later on (this needs "uidmap" package installed).

This patchset was successfully tested with following downstreams:
- cip-core
- meta-iot2050
- xenomai-images

This change breaks Debian Buster support as host distro, but previous
isar-bootstrap (with Buster support) still can be selected by setting
in local.conf:

PREFERRED_PROVIDER_bootstrap-host ?= "isar-bootstrap-host"
PREFERRED_PROVIDER_bootstrap-target ?= "isar-bootstrap-target"

Changes since v10:
- Rebase on next.

Changes since v9:
- Rebase on next.
- Separate common code into bbclass.
- Skip deb cache on rootfs packing.

Changes since v8:
- Rebase on next.
- Keep isar-bootstrap recipes.
- Implement bootstrap provider selection.

Changes since v7:
- Rebase on next.

Changes since v6:
- Reorder patches.

Changes since v5:
- Improve keyring handling.
- Fix mmdebstrap hooks.

Changes since v4:
- Rebase on next.
- Migrate from apt-key to gpg.
- Fix Ubuntu and RPi targets.
- Cleanup debootstrap mentions.
- Fix commit messages.

Changes since v3:
- Rebase on latest next.
- Remove temporary patch 7 since kas:4.0 already includes mmdebstrap.

Changes since v2:
- Rebase on next.
- Fix commit messages.
- Update host requirements.

Changes since v1:
- Move mmdebstrap tmpdir to workdir.
- Fix kas building.
- Improve mounts cleanup.

Anton Mikanovich (8):
  isar-bootstrap: Move common parts to bbclass
  meta: Add mmdebstrap recipe
  meta: Allow selecting bootstrap providers
  testsuite: Allow variable bootstrap providers
  mmdebstrap: Fix missing dpkg available
  mmdebstrap: Move preparations to hooks
  isar-bootstrap: Use tar output instead of directory
  user_manual.md: Update boostrap related documentation

 RECIPE-API-CHANGELOG.md                       |  13 +
 doc/user_manual.md                            |  15 +-
 meta-isar/conf/local.conf.sample              |   4 +
 meta/classes/bootstrap.bbclass                | 226 ++++++++++++++++
 meta/classes/rootfs.bbclass                   |  13 +-
 meta/conf/bitbake.conf                        |   3 +
 .../isar-bootstrap/isar-bootstrap-host.bb     |   2 +
 .../isar-bootstrap/isar-bootstrap-target.bb   |   2 +
 .../isar-bootstrap/isar-bootstrap.inc         | 244 ++----------------
 .../isar-mmdebstrap/isar-mmdebstrap-host.bb   |  19 ++
 .../isar-mmdebstrap/isar-mmdebstrap-target.bb |  14 +
 .../isar-mmdebstrap/isar-mmdebstrap.inc       | 216 ++++++++++++++++
 testsuite/cibase.py                           |   9 +-
 13 files changed, 540 insertions(+), 240 deletions(-)
 create mode 100644 meta/classes/bootstrap.bbclass
 create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-host.bb
 create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-target.bb
 create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc

Comments

Felix Moessbauer Nov. 7, 2024, 6:26 a.m. UTC | #1
On Wed, 2024-11-06 at 10:21 +0200, Anton Mikanovich wrote:
> Switch Isar from debootstrap to mmdebstrap.
> 
> It makes isar-bootstrap target ~10..30% faster on both cross and
> native
> rootfs types. Some measurements on qemuarm64-bookworm (required debs
> are
> predownloaded and used during deb-dl-import):
> 
> - 20s vs 28s for "isar-bootstrap-host"
> - 1m32s vs 1m48s for "isar-bootstrap-target
> 
> Also mmdebstrap support using SOURCE_DATE_EPOCH for images
> reproducibly
> out of the box. But the main advantage is an ability to remove sudo
> for
> debootstrapping later on (this needs "uidmap" package installed).

Hi,

I'm really looking forward to switch to mmdebstrap. One of the biggest
advantage is that apt options can be passed - which are needed for the
snapshot mirrors. I'm also currently looking into optimizing the whole
chain to have reliable fetches from the snapshot mirrors. This includes
a fix of apt itself, which hopefully will get backported as well [1].

[1] https://salsa.debian.org/apt-team/apt/-/merge_requests/383

Best regards,
Felix

> 
> This patchset was successfully tested with following downstreams:
> - cip-core
> - meta-iot2050
> - xenomai-images
> 
> This change breaks Debian Buster support as host distro, but previous
> isar-bootstrap (with Buster support) still can be selected by setting
> in local.conf:
> 
> PREFERRED_PROVIDER_bootstrap-host ?= "isar-bootstrap-host"
> PREFERRED_PROVIDER_bootstrap-target ?= "isar-bootstrap-target"
> 
> Changes since v10:
> - Rebase on next.
> 
> Changes since v9:
> - Rebase on next.
> - Separate common code into bbclass.
> - Skip deb cache on rootfs packing.
> 
> Changes since v8:
> - Rebase on next.
> - Keep isar-bootstrap recipes.
> - Implement bootstrap provider selection.
> 
> Changes since v7:
> - Rebase on next.
> 
> Changes since v6:
> - Reorder patches.
> 
> Changes since v5:
> - Improve keyring handling.
> - Fix mmdebstrap hooks.
> 
> Changes since v4:
> - Rebase on next.
> - Migrate from apt-key to gpg.
> - Fix Ubuntu and RPi targets.
> - Cleanup debootstrap mentions.
> - Fix commit messages.
> 
> Changes since v3:
> - Rebase on latest next.
> - Remove temporary patch 7 since kas:4.0 already includes mmdebstrap.
> 
> Changes since v2:
> - Rebase on next.
> - Fix commit messages.
> - Update host requirements.
> 
> Changes since v1:
> - Move mmdebstrap tmpdir to workdir.
> - Fix kas building.
> - Improve mounts cleanup.
> 
> Anton Mikanovich (8):
>   isar-bootstrap: Move common parts to bbclass
>   meta: Add mmdebstrap recipe
>   meta: Allow selecting bootstrap providers
>   testsuite: Allow variable bootstrap providers
>   mmdebstrap: Fix missing dpkg available
>   mmdebstrap: Move preparations to hooks
>   isar-bootstrap: Use tar output instead of directory
>   user_manual.md: Update boostrap related documentation
> 
>  RECIPE-API-CHANGELOG.md                       |  13 +
>  doc/user_manual.md                            |  15 +-
>  meta-isar/conf/local.conf.sample              |   4 +
>  meta/classes/bootstrap.bbclass                | 226 ++++++++++++++++
>  meta/classes/rootfs.bbclass                   |  13 +-
>  meta/conf/bitbake.conf                        |   3 +
>  .../isar-bootstrap/isar-bootstrap-host.bb     |   2 +
>  .../isar-bootstrap/isar-bootstrap-target.bb   |   2 +
>  .../isar-bootstrap/isar-bootstrap.inc         | 244 ++--------------
> --
>  .../isar-mmdebstrap/isar-mmdebstrap-host.bb   |  19 ++
>  .../isar-mmdebstrap/isar-mmdebstrap-target.bb |  14 +
>  .../isar-mmdebstrap/isar-mmdebstrap.inc       | 216 ++++++++++++++++
>  testsuite/cibase.py                           |   9 +-
>  13 files changed, 540 insertions(+), 240 deletions(-)
>  create mode 100644 meta/classes/bootstrap.bbclass
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap-host.bb
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap-target.bb
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap.inc
> 
> -- 
> 2.34.1
>
Uladzimir Bely Nov. 14, 2024, 8:50 a.m. UTC | #2
On Wed, 2024-11-06 at 10:21 +0200, Anton Mikanovich wrote:
> Switch Isar from debootstrap to mmdebstrap.
> 
> It makes isar-bootstrap target ~10..30% faster on both cross and
> native
> rootfs types. Some measurements on qemuarm64-bookworm (required debs
> are
> predownloaded and used during deb-dl-import):
> 
> - 20s vs 28s for "isar-bootstrap-host"
> - 1m32s vs 1m48s for "isar-bootstrap-target
> 
> Also mmdebstrap support using SOURCE_DATE_EPOCH for images
> reproducibly
> out of the box. But the main advantage is an ability to remove sudo
> for
> debootstrapping later on (this needs "uidmap" package installed).
> 
> This patchset was successfully tested with following downstreams:
> - cip-core
> - meta-iot2050
> - xenomai-images
> 
> This change breaks Debian Buster support as host distro, but previous
> isar-bootstrap (with Buster support) still can be selected by setting
> in local.conf:
> 
> PREFERRED_PROVIDER_bootstrap-host ?= "isar-bootstrap-host"
> PREFERRED_PROVIDER_bootstrap-target ?= "isar-bootstrap-target"
> 
> Changes since v10:
> - Rebase on next.
> 
> Changes since v9:
> - Rebase on next.
> - Separate common code into bbclass.
> - Skip deb cache on rootfs packing.
> 
> Changes since v8:
> - Rebase on next.
> - Keep isar-bootstrap recipes.
> - Implement bootstrap provider selection.
> 
> Changes since v7:
> - Rebase on next.
> 
> Changes since v6:
> - Reorder patches.
> 
> Changes since v5:
> - Improve keyring handling.
> - Fix mmdebstrap hooks.
> 
> Changes since v4:
> - Rebase on next.
> - Migrate from apt-key to gpg.
> - Fix Ubuntu and RPi targets.
> - Cleanup debootstrap mentions.
> - Fix commit messages.
> 
> Changes since v3:
> - Rebase on latest next.
> - Remove temporary patch 7 since kas:4.0 already includes mmdebstrap.
> 
> Changes since v2:
> - Rebase on next.
> - Fix commit messages.
> - Update host requirements.
> 
> Changes since v1:
> - Move mmdebstrap tmpdir to workdir.
> - Fix kas building.
> - Improve mounts cleanup.
> 
> Anton Mikanovich (8):
>   isar-bootstrap: Move common parts to bbclass
>   meta: Add mmdebstrap recipe
>   meta: Allow selecting bootstrap providers
>   testsuite: Allow variable bootstrap providers
>   mmdebstrap: Fix missing dpkg available
>   mmdebstrap: Move preparations to hooks
>   isar-bootstrap: Use tar output instead of directory
>   user_manual.md: Update boostrap related documentation
> 
>  RECIPE-API-CHANGELOG.md                       |  13 +
>  doc/user_manual.md                            |  15 +-
>  meta-isar/conf/local.conf.sample              |   4 +
>  meta/classes/bootstrap.bbclass                | 226 ++++++++++++++++
>  meta/classes/rootfs.bbclass                   |  13 +-
>  meta/conf/bitbake.conf                        |   3 +
>  .../isar-bootstrap/isar-bootstrap-host.bb     |   2 +
>  .../isar-bootstrap/isar-bootstrap-target.bb   |   2 +
>  .../isar-bootstrap/isar-bootstrap.inc         | 244 ++--------------
> --
>  .../isar-mmdebstrap/isar-mmdebstrap-host.bb   |  19 ++
>  .../isar-mmdebstrap/isar-mmdebstrap-target.bb |  14 +
>  .../isar-mmdebstrap/isar-mmdebstrap.inc       | 216 ++++++++++++++++
>  testsuite/cibase.py                           |   9 +-
>  13 files changed, 540 insertions(+), 240 deletions(-)
>  create mode 100644 meta/classes/bootstrap.bbclass
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap-host.bb
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap-target.bb
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap.inc
> 
> -- 
> 2.34.1
> 

Hello all.

We would like to merge the patchset next week (Nov 19), if there a no
objections.
Uladzimir Bely Nov. 20, 2024, 5:34 a.m. UTC | #3
On Wed, 2024-11-06 at 10:21 +0200, Anton Mikanovich wrote:
> Switch Isar from debootstrap to mmdebstrap.
> 
> It makes isar-bootstrap target ~10..30% faster on both cross and
> native
> rootfs types. Some measurements on qemuarm64-bookworm (required debs
> are
> predownloaded and used during deb-dl-import):
> 
> - 20s vs 28s for "isar-bootstrap-host"
> - 1m32s vs 1m48s for "isar-bootstrap-target
> 
> Also mmdebstrap support using SOURCE_DATE_EPOCH for images
> reproducibly
> out of the box. But the main advantage is an ability to remove sudo
> for
> debootstrapping later on (this needs "uidmap" package installed).
> 
> This patchset was successfully tested with following downstreams:
> - cip-core
> - meta-iot2050
> - xenomai-images
> 
> This change breaks Debian Buster support as host distro, but previous
> isar-bootstrap (with Buster support) still can be selected by setting
> in local.conf:
> 
> PREFERRED_PROVIDER_bootstrap-host ?= "isar-bootstrap-host"
> PREFERRED_PROVIDER_bootstrap-target ?= "isar-bootstrap-target"
> 
> Changes since v10:
> - Rebase on next.
> 
> Changes since v9:
> - Rebase on next.
> - Separate common code into bbclass.
> - Skip deb cache on rootfs packing.
> 
> Changes since v8:
> - Rebase on next.
> - Keep isar-bootstrap recipes.
> - Implement bootstrap provider selection.
> 
> Changes since v7:
> - Rebase on next.
> 
> Changes since v6:
> - Reorder patches.
> 
> Changes since v5:
> - Improve keyring handling.
> - Fix mmdebstrap hooks.
> 
> Changes since v4:
> - Rebase on next.
> - Migrate from apt-key to gpg.
> - Fix Ubuntu and RPi targets.
> - Cleanup debootstrap mentions.
> - Fix commit messages.
> 
> Changes since v3:
> - Rebase on latest next.
> - Remove temporary patch 7 since kas:4.0 already includes mmdebstrap.
> 
> Changes since v2:
> - Rebase on next.
> - Fix commit messages.
> - Update host requirements.
> 
> Changes since v1:
> - Move mmdebstrap tmpdir to workdir.
> - Fix kas building.
> - Improve mounts cleanup.
> 
> Anton Mikanovich (8):
>   isar-bootstrap: Move common parts to bbclass
>   meta: Add mmdebstrap recipe
>   meta: Allow selecting bootstrap providers
>   testsuite: Allow variable bootstrap providers
>   mmdebstrap: Fix missing dpkg available
>   mmdebstrap: Move preparations to hooks
>   isar-bootstrap: Use tar output instead of directory
>   user_manual.md: Update boostrap related documentation
> 
>  RECIPE-API-CHANGELOG.md                       |  13 +
>  doc/user_manual.md                            |  15 +-
>  meta-isar/conf/local.conf.sample              |   4 +
>  meta/classes/bootstrap.bbclass                | 226 ++++++++++++++++
>  meta/classes/rootfs.bbclass                   |  13 +-
>  meta/conf/bitbake.conf                        |   3 +
>  .../isar-bootstrap/isar-bootstrap-host.bb     |   2 +
>  .../isar-bootstrap/isar-bootstrap-target.bb   |   2 +
>  .../isar-bootstrap/isar-bootstrap.inc         | 244 ++--------------
> --
>  .../isar-mmdebstrap/isar-mmdebstrap-host.bb   |  19 ++
>  .../isar-mmdebstrap/isar-mmdebstrap-target.bb |  14 +
>  .../isar-mmdebstrap/isar-mmdebstrap.inc       | 216 ++++++++++++++++
>  testsuite/cibase.py                           |   9 +-
>  13 files changed, 540 insertions(+), 240 deletions(-)
>  create mode 100644 meta/classes/bootstrap.bbclass
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap-host.bb
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap-target.bb
>  create mode 100644 meta/recipes-core/isar-mmdebstrap/isar-
> mmdebstrap.inc
> 
> -- 
> 2.34.1
> 

Applied to next.