Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

definition: Add Source.Components #741

Merged
merged 2 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/examples/scheme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ source:
suite: suite
same_as: bionic
skip_verification: false
components:
- main

targets:
lxc:
Expand Down
3 changes: 3 additions & 0 deletions doc/reference/source.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ source:
suite: <string>
same_as: <boolean>
skip_verification: <boolean>
components: <array>
```

The `downloader` field defines a downloader which pulls a rootfs image which will be used as a starting point.
Expand Down Expand Up @@ -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.)
1 change: 1 addition & 0 deletions shared/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions sources/debootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down