forked from canonical/pc-gadget
-
Notifications
You must be signed in to change notification settings - Fork 6
/
snapcraft.yaml
87 lines (81 loc) · 2.39 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: pc-desktop
version: '22-0.4'
type: gadget
build-base: core22
base: core22-desktop
summary: PC gadget for generic devices
description: |
This gadget enables generic pc devices to work with Ubuntu Core Desktop
confinement: strict
grade: stable
architectures:
- build-on: amd64
build-for: amd64
icon: icon.png
package-repositories:
- type: apt
ppa: ucdev/uc-staging-ppa
hooks:
prepare-device:
environment:
# If you are forking and building your own gadget:
# define your model's API key here
# See https://ubuntu.com/core/services/guide/serial-vault-overview
# for instructions on how to generate an API key
# DO NOT check this API key into a publicly accessible VCS
MODEL_APIKEY: ""
# Min version to support shim 15.7
# Using passthrough until LP#2019931 is fixed
passthrough:
assumes:
- snapd2.59.3
parts:
# Temporary workaround until pinning is supported by snapcraft
pin-ucdev:
plugin: nil
override-pull: |
# This is run before the pull step of grub part, so we make sure
# we get the packages from the PPA.
set -x
cat <<'EOF' > /etc/apt/preferences.d/ucdev
Package: *
Pin: release LP-PPA-ucdev-uc-staging-ppa,a=jammy,n=jammy
Pin: origin ppa.launchpad.net
Pin-Priority: 1000
EOF
mbr:
source: .
build-packages:
- ubuntu-dev-tools
plugin: make
grub:
after: [ pin-ucdev ]
plugin: nil
source: .
build-packages:
- ubuntu-dev-tools
- grub-pc-bin
- grub-common
- sbsigntool
stage-packages:
- grub-efi-amd64-signed
- shim-signed
override-build: |
set -x
# Make sure we have signatures from the UC certificates
sbverify --list "$CRAFT_PART_INSTALL"/usr/lib/shim/shimx64.efi.dualsigned |
grep -E 'Canonical Ltd. Secure Boot Signing \(Ubuntu Core'
sbverify --list "$CRAFT_PART_INSTALL"/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed |
grep -E 'Canonical Ltd. Secure Boot Signing \(Ubuntu Core'
# grub.conf lets snapd identify grub as the bootloader on boot
install -m 644 /dev/null "$CRAFT_PART_INSTALL"/grub.conf
organize:
usr/lib/shim/shimx64.efi.dualsigned: shim.efi.signed
usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed: grubx64.efi
prime:
- shim.efi.signed
- grubx64.efi
- grub.conf
extra:
source: ./extra
plugin: dump