forked from canonical/core-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapcraft.yaml
86 lines (76 loc) · 2.47 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
name: core26
# version: "26"
adopt-info: bootstrap
summary: Runtime environment based on Ubuntu 24.04
description: |
The base snap based on the Ubuntu 24.04 release.
confinement: strict
type: base
# This one is to trick snapcraft to not use legacy code
build-base: devel
grade: devel
assumes: [snapd2.55.5]
parts:
chisel-libs:
plugin: nil
build-packages:
- golang
source: https://github.com/Meulengracht/chisel-releases.git
source-type: git
source-branch: ubuntu-24.04
override-build: |
go install github.com/canonical/chisel/cmd/chisel@latest
SLICES=(
bash_bins
base-files_base
ca-certificates_data
coreutils_bins
mount_bins
openssh-server_bins
passwd_config
libc6_config
libc6_gconv
libwrap0_host-files
sed_bins
tzdata_zoneinfo
)
case "$(dpkg --print-architecture)" in
amd64|i386)
SLICES+=(secureboot-db_data)
;;
esac
CHISEL_CACHE_DIR="$(mktemp -d)"
XDG_CACHE_HOME="$CHISEL_CACHE_DIR" chisel cut --release="${CRAFT_PART_SRC}" --root "${CRAFT_PART_INSTALL}" "${SLICES[@]}"
# Install foreign libraries
case "$(dpkg --print-architecture)" in
amd64)
XDG_CACHE_HOME="$CHISEL_CACHE_DIR" chisel cut --arch=i386 --release="${CRAFT_PART_SRC}" --root "${CRAFT_PART_INSTALL}" libnss-mdns_libs libc6_libs libc6_gconv libc6_config libgcc-s1_libs
;;
arm64)
XDG_CACHE_HOME="$CHISEL_CACHE_DIR" chisel cut --arch=armhf --release="${CRAFT_PART_SRC}" --root "${CRAFT_PART_INSTALL}" libnss-mdns_libs libc6_libs libc6_gconv libc6_config libgcc-s1_libs
;;
esac
"${CRAFT_PROJECT_DIR}/generate-manifest.sh" "$CHISEL_CACHE_DIR/chisel/sha256" "${CRAFT_PART_INSTALL}"
splash-theme:
plugin: dump
source: https://github.com/snapcore/plymouth-theme-ubuntu-core.git
source-type: git
organize:
ubuntu-core: usr/share/plymouth/themes/ubuntu-core
bootstrap:
after:
- chisel-libs
plugin: make
source: .
build-packages:
- shellcheck
- distro-info
override-pull: |
craftctl set version="$(/bin/date +%Y%m%d)"
craftctl default
override-prime: |
craftctl default
# run all the hooks
cd ${CRAFT_PART_SRC} && make hooks DESTDIR=${CRAFT_PRIME}
# ensure build-in tests are run
cd ${CRAFT_PART_SRC} && make test TESTDIR=${CRAFT_PRIME}