diff --git a/docs/how-to-guides/image-creation/build-a-gadget-snap.md b/docs/how-to-guides/image-creation/build-a-gadget-snap.md index 1919f37f..f0bb7491 100644 --- a/docs/how-to-guides/image-creation/build-a-gadget-snap.md +++ b/docs/how-to-guides/image-creation/build-a-gadget-snap.md @@ -359,7 +359,7 @@ There are typically two methods for building a gadget snap, _native building_ an ### Requirements -The build system must support [snap](https://snapcraft.io/docs/installing-snapd), and have both the [Snapcraft](https://snapcraft.io/docs/snapcraft-overview) build tool and the [LXD](https://canonical.com/lxd) virtualisation platform installed, all of which are provided by any Ubuntu release. +The build system must support [snap](https://snapcraft.io/docs/installing-snapd), and have both the [Snapcraft](https://snapcraft.io/docs/snapcraft-overview) build tool and the [LXD](https://canonical.com/lxd/install) virtualisation platform installed, all of which are provided by any Ubuntu release. Ensure your user has been added to the `lxd` group and you've initialized LXD with `lxd init` before proceeding. See [Set up Snapcraft](https://documentation.ubuntu.com/snapcraft/stable/how-to/setup/set-up-snapcraft/#install-lxd) for further details. ### Native building @@ -384,7 +384,7 @@ git checkout 22-amd64-pc With the correct git branch selected, `snap/snapcraft.yaml` now contains everything required to build the PC gadget snap. -This example embeds the pre-built [Canonical reference PC gadget](https://github.com/snapcore/pc-gadget) as a base from the *snapcraft.yaml*. To build the gadget, run the the _snapcraft_ command: +This example embeds the pre-built [Canonical reference PC gadget](https://github.com/snapcore/pc-gadget) as a base from the *snapcraft.yaml*. To build the gadget, run the _snapcraft_ command: ```bash $ snapcraft diff --git a/docs/how-to-guides/image-creation/build-a-kernel-snap.md b/docs/how-to-guides/image-creation/build-a-kernel-snap.md index 53b1a6b5..71a5c95c 100644 --- a/docs/how-to-guides/image-creation/build-a-kernel-snap.md +++ b/docs/how-to-guides/image-creation/build-a-kernel-snap.md @@ -443,7 +443,7 @@ parts: # part used instead. This will most commonly happen on non-x86_64 platforms. initrd: after: [firmware, kernel] - # The initrd plugin handles the work of running ubuntu-core-initramfs + # The initrd plugin handles the work of running ubuntu-core-initramfs. plugin: initrd # Set this to true if: # * the gadget bootloader is GRUB @@ -459,6 +459,11 @@ parts: # https://github.com/canonical/iot-field-gadget-snap/blob/main/u-boot/boot.scr.in # * the IoT Field example gadget on the 22-arm64-odroid-hc4 branch uses separate files: # https://github.com/canonical/iot-field-gadget-snap/blob/22-arm64-odroid-hc4/u-boot/boot.scr + # + # Missing snapcraft support? + # If snapcraft does not include support for the initrd plugin, a pre-built snapcraft snap with + # the initrd plugin included can be downloaded from here: + # https://launchpad.net/~ondrak/+snap/snapcraft-kernel-initrd-split initrd-build-efi-image: true # NOTE: any modules required for booting the target hardware (like those # required to mount the root filesystem, such as squashfs or mmc drivers) @@ -533,7 +538,7 @@ snap install snapcraft --classic With _snapcraft.yaml_ complete, and the kernel source either cloned locally or linked to from the snapcraft.yaml, the `snapcraft` command will build the kernel. As mentioned earlier, it's often more convenient to build the kernel within the host environment, using `--destructive-mode`: ```bash -# snapcraft --destructive-mode --target-arch=arm64 +# snapcraft --destructive-mode --build-for=arm64 [...] Snapped kernal-snap-name_arm64.snap ``` diff --git a/docs/tutorials/build-your-first-image/build-the-image.md b/docs/tutorials/build-your-first-image/build-the-image.md index df2ef9d4..ee9e2a84 100644 --- a/docs/tutorials/build-your-first-image/build-the-image.md +++ b/docs/tutorials/build-your-first-image/build-the-image.md @@ -7,16 +7,17 @@ Images are built from the recipe contained in the [model assertion](/tutorials/b First, install the `ubuntu-image` command from its snap: ``` -sudo snap install ubuntu-image --classic +sudo snap install ubuntu-image --classic --edge ``` -The `ubuntu-image` command requires two arguments; `snap` to indicate we're building a snap-based Ubuntu Core image, and the filename of our previously-signed model assertion to build an image: +The `ubuntu-image` command requires three arguments; `snap` to indicate we're building a snap-based Ubuntu Core image, `--allow-snapd-kernel-mismatch` to ignore a difference in the versions of snapd we're using, and finally, the filename of our previously-signed model assertion to build an image: ```bash -$ ubuntu-image snap my-model.model +$ ubuntu-image snap --allow-snapd-kernel-mismatch my-model.model [0] prepare_image WARNING: proceeding to download snaps ignoring validations, this default will change in the future. For now use --validation=enforce for validations to be taken into account, pass instead --validation=ignore to preserve current behavior going forward WARNING: the kernel for the specified UC20+ model does not carry assertion max formats information, assuming possibly incorrectly the kernel revision can use the same formats as snapd +WARNING: snapd 2.68+ is not compatible with a kernel containing snapd prior to 2.68 [1] load_gadget_yaml [2] set_artifact_names [3] populate_rootfs_contents @@ -28,7 +29,7 @@ WARNING: the kernel for the specified UC20+ model does not carry assertion max f [9] generate_snap_manifest Build successful ``` -You can safely ignore both of the above warnings, and the entire process should only take a few minutes (depending on your connectivity), with the creation of a `pi.img` Ubuntu Core image file being the end result. +You can safely ignore the warnings, and the entire process should only take a few minutes (depending on your connectivity), with the creation of a `pi.img` Ubuntu Core image file being the end result. ```{admonition} Console-conf as a separate snap in Ubuntu Core 24+ :class: tip