github.com/canonical/ubuntu-image@v0.0.0-20240430122802-2202fe98b290/internal/commands/snap.go (about) 1 package commands 2 3 // SnapArgs holds the model Assertion 4 type SnapArgs struct { 5 ModelAssertion string `positional-arg-name:"model_assertion" description:"Path to the model assertion file. This argument must be given unless the state machine is being resumed, in which case it cannot be given."` 6 } 7 8 // SnapOpts holds all flags that are specific to the snap command 9 type SnapOpts struct { 10 DisableConsoleConf bool `long:"disable-console-conf" description:"Disable console-conf on the resulting image."` 11 FactoryImage bool `long:"factory-image" description:"Hint that the image is meant to boot in a device factory."` 12 Preseed bool `long:"preseed" description:"Preseed the image (UC20 only)."` 13 AppArmorKernelFeaturesDir string `long:"apparmor-features-dir" description:"Optional path to apparmor kernel features directory"` 14 PreseedSignKey string `long:"preseed-sign-key" description:"Name of the key to use to sign preseed assertion, otherwise use the default key"` 15 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"` 16 CloudInit string `long:"cloud-init" description:"cloud-config data to be copied to the image" value-name:"USER-DATA-FILE"` 17 Revisions map[string]int `long:"revision" description:"The revision of a specific snap to install in the image." value-name:"REVISION"` 18 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"` 19 } 20 21 type SnapCommand struct { 22 SnapArgsPassed SnapArgs `positional-args:"true" required:"false"` 23 SnapOptsPassed SnapOpts 24 }