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

expose sysfs overlay option #182

Merged
merged 4 commits into from
Feb 15, 2024
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
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
ubuntu-image (3.2) UNRELEASED; urgency=medium

[Masahiro Nakagawa]
* Add sysfs-overlay option used with --presseed option.
* This option is required to generate a preseeding image which enhances the initial boot time of Ubuntu Core 20+.

-- Masahiro nakagawa <[email protected]> Thu, 8 Feb 2024 13:56:00 +0900

ubuntu-image (3.2) UNRELEASED; urgency=medium

[ Paul Mars ]
Expand Down
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
2 changes: 1 addition & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ summary: Create Ubuntu images
description: |
Official tool for building Ubuntu images, currently supporing Ubuntu Core
snap-based images and preinstalled Ubuntu classic images.
version: "3.2+snap2"
version: "3.2+snap3"
grade: stable
confinement: classic
base: core22
Expand Down
9 changes: 9 additions & 0 deletions ubuntu-image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ model_assertion
both a revision and channel are provided, the revision specified will be
installed in the image, and updates will come from the specified channel

--preseed
Preseed the image (UC20+ only).

--preseed-sign-key=<key>
Name of the key to use to sign preseed assertion, otherwise use the default key

--sysfs-overlay=<path to folder contains sysfs overlay>
specify folder contains sysfsoverlay directory. This options also requires --presseding options and --preseed-sign-key option.

Classic command options
-----------------------

Expand Down
Loading