forked from canonical/pi3-gadget
-
Notifications
You must be signed in to change notification settings - Fork 1
/
snapcraft.yaml
65 lines (65 loc) · 1.89 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
name: pi3
version: 16.04-0.5
summary: Raspberry Pi 3 support package
description: |
Support files for booting Raspberry Pi 3 for classic Ubuntu
type: gadget
architectures:
- armhf
confinement: strict
grade: stable
parts:
uboot:
plugin: nil
stage-packages:
- u-boot-rpi:armhf
build-packages:
- u-boot-tools
prime:
- boot-assets
- uboot.*
install: |
mkdir -p $SNAPCRAFT_PART_INSTALL/boot-assets
cp $SNAPCRAFT_PART_INSTALL/usr/lib/u-boot/rpi_3_32b/u-boot.bin $SNAPCRAFT_PART_INSTALL/boot-assets/uboot.bin
mkenvimage -r -s 131072 -o $SNAPCRAFT_PART_INSTALL/uboot.env uboot.env.in
ln -s uboot.env $SNAPCRAFT_PART_INSTALL/uboot.conf
boot-firmware:
plugin: nil
after:
- uboot
stage-packages:
- raspi3-firmware:armhf
prime: [ boot-assets ]
install: |
mkdir -p $SNAPCRAFT_PART_INSTALL/boot-assets
for file in fixup start bootcode; do
cp $SNAPCRAFT_PART_INSTALL/usr/lib/raspi3-firmware/${file}* $SNAPCRAFT_PART_INSTALL/boot-assets
done
configs:
plugin: dump
source: configs
after:
- boot-firmware
organize:
config.txt: boot-assets/config.txt
cmdline.txt: boot-assets/cmdline.txt
devicetrees:
plugin: nil
source: .
after:
- configs
prepare: |
PACKAGES="http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/universe/binary-armhf/Packages.gz"
PKGPATH="$(wget -q -O- $PACKAGES|zcat|grep-dctrl linux-raspi2 |\
grep linux-modules|grep Filename|tail -1| sed 's/^Filename: //')"
wget http://ports.ubuntu.com/ubuntu-ports/$PKGPATH
dpkg -x $(basename $PKGPATH) unpack/
install: |
mkdir -p $SNAPCRAFT_PART_INSTALL/boot-assets
cp -a unpack/lib/firmware/*/device-tree/* $SNAPCRAFT_PART_INSTALL/boot-assets
rm -rf unpack
build-packages:
- coreutils
- dctrl-tools
- sed
- wget