From 2a3ae73e7a32a3e988a2d9d7dcff9e4de6345a43 Mon Sep 17 00:00:00 2001 From: Ivan Kutepov Date: Wed, 28 Jun 2023 19:28:44 +0300 Subject: [PATCH 1/2] definition: Add Source.Components This is important for derivatives that can't be built with the main component alone, e.g., Astra Linux. This allows to specify other components. Signed-off-by: Ivan Kutepov --- doc/examples/scheme.yaml | 2 ++ shared/definition.go | 1 + sources/debootstrap.go | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/doc/examples/scheme.yaml b/doc/examples/scheme.yaml index 382d548e..41fbb0b6 100644 --- a/doc/examples/scheme.yaml +++ b/doc/examples/scheme.yaml @@ -21,6 +21,8 @@ source: suite: suite same_as: bionic skip_verification: false + components: + - main targets: lxc: diff --git a/shared/definition.go b/shared/definition.go index f8f202bf..75887fdd 100644 --- a/shared/definition.go +++ b/shared/definition.go @@ -166,6 +166,7 @@ type DefinitionSource struct { Suite string `yaml:"suite,omitempty"` SameAs string `yaml:"same_as,omitempty"` SkipVerification bool `yaml:"skip_verification,omitempty"` + Components []string `yaml:"components,omitempty"` } // A DefinitionTargetLXCConfig represents the config part of the metadata. diff --git a/sources/debootstrap.go b/sources/debootstrap.go index 1c45a207..c76562da 100644 --- a/sources/debootstrap.go +++ b/sources/debootstrap.go @@ -55,6 +55,10 @@ func (s *debootstrap) Run() error { args = append(args, fmt.Sprintf("--exclude=%s", strings.Join(earlyPackagesRemove, ","))) } + if len(s.definition.Source.Components) > 0 { + args = append(args, fmt.Sprintf("--components=%s", strings.Join(s.definition.Source.Components, ","))) + } + if len(s.definition.Source.Keys) > 0 { keyring, err := s.CreateGPGKeyring() if err != nil { From 4d2fd136a30009b11c1ef76b16d4f5979f50f5cf Mon Sep 17 00:00:00 2001 From: Ivan Kutepov Date: Wed, 28 Jun 2023 21:41:57 +0300 Subject: [PATCH 2/2] doc/reference: add components field Signed-off-by: Ivan Kutepov --- doc/reference/source.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/reference/source.md b/doc/reference/source.md index 145db98f..4ce65773 100644 --- a/doc/reference/source.md +++ b/doc/reference/source.md @@ -13,6 +13,7 @@ source: suite: same_as: skip_verification: + components: ``` The `downloader` field defines a downloader which pulls a rootfs image which will be used as a starting point. @@ -65,6 +66,8 @@ This can be used if you want to run `debootstrap foo` but `foo` is missing due t If `skip_verification` is true, the source tarball is not verified. +If the `components` field is set, `debootstrap` will use packages from the listed components. + If a package set has the `early` flag enabled, that list of packages will be installed while the source is being downloaded. (Note that `early` packages are only supported by the `debootstrap` downloader.)