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

actions: debootstrap: Add parent-suite property to indicate which suite a downstream is based on #424

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
15 changes: 14 additions & 1 deletion actions/debootstrap_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Example:

- parent-suite -- release code name which this suite is based on. Useful for downstreams which do
not use debian codenames for their suite names (e.g. "stable").

- script -- the full path of the script to use to build the target rootfs. (e.g. `/usr/share/debootstrap/scripts/kali`)
If unspecified, the property will be set to use the `unstable` script.
*/
package actions

Expand Down Expand Up @@ -78,6 +81,7 @@ type DebootstrapAction struct {
Components []string
MergedUsr bool `yaml:"merged-usr"`
CheckGpg bool `yaml:"check-gpg"`
Script string
}

func NewDebootstrapAction() *DebootstrapAction {
Expand Down Expand Up @@ -242,7 +246,16 @@ func (d *DebootstrapAction) Run(context *debos.DebosContext) error {
cmdline = append(cmdline, d.Suite)
cmdline = append(cmdline, context.Rootdir)
cmdline = append(cmdline, d.Mirror)
cmdline = append(cmdline, "/usr/share/debootstrap/scripts/unstable")

if len(d.Script) > 0 {
if _, err := os.Stat(d.Script); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done in verify not at run time

return fmt.Errorf("cannot find debootstrap script %s", d.Script)
}
} else {
d.Script = "/usr/share/debootstrap/scripts/unstable"
}

cmdline = append(cmdline, d.Script)

/* Make sure /etc/apt/apt.conf.d exists inside the fakemachine otherwise
debootstrap prints a warning about the path not existing. */
Expand Down