Skip to content

Commit

Permalink
expose sysfs overlay option
Browse files Browse the repository at this point in the history
This change allows to pass sysfs-overlay option required to generate a preseeding image which enhances the initial boot time of Ubuntu Core 20.
  • Loading branch information
jawn-smith authored and masahiro-nakagawa committed Feb 8, 2024
1 parent b223c38 commit 709226d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/commands/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type SnapOpts struct {
Snaps []string `long:"snap" description:"Install extra snaps. These are passed through to \"snap prepare-image\". The snap argument can include additional information about the channel and/or risk with the following syntax: <snap>=<channel|risk>" value-name:"SNAP"`
CloudInit string `long:"cloud-init" description:"cloud-config data to be copied to the image" value-name:"USER-DATA-FILE"`
Revisions map[string]int `long:"revision" description:"The revision of a specific snap to install in the image." value-name:"REVISION"`
SysfsOverlay string `long:"sysfs-overlay" description:"The optional sysfs overlay to used for preseeding. Directories from /sys/class/* and /sys/devices/platform will be bind-mounted to the chroot when preseeding"`
}

type SnapCommand struct {
Expand Down
1 change: 1 addition & 0 deletions internal/statemachine/snap_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (stateMachine *StateMachine) prepareImage() error {
// preseeding-related
imageOpts.Preseed = snapStateMachine.Opts.Preseed
imageOpts.PreseedSignKey = snapStateMachine.Opts.PreseedSignKey
imageOpts.SysfsOverlay = snapStateMachine.Opts.SysfsOverlay
imageOpts.AppArmorKernelFeaturesDir = snapStateMachine.Opts.AppArmorKernelFeaturesDir
imageOpts.SeedManifestPath = filepath.Join(stateMachine.commonFlags.OutputDir, "seed.manifest")

Expand Down

0 comments on commit 709226d

Please sign in to comment.