├── COPYING.MIT ├── README.md ├── conf └── layer.conf ├── recipes-core ├── images │ └── snapd-demo-image.bb └── packagegroups │ └── packagegroup-snapd.bb ├── recipes-kernel └── linux │ ├── files │ └── snappy.cfg │ └── linux-yocto_%.bbappend └── recipes-support └── snapd ├── files ├── 0001-packaging-use-templates-for-relevant-systemd-units.patch └── 0002-cmd-add-poky-to-the-list-of-distros-which-don-t-supp.patch └── snapd_2.51.5.bb /COPYING.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | The Yocto support layer has moved to http://github.com/snapcore/meta-snapd 3 | -------------------------------------------------------------------------------- /conf/layer.conf: -------------------------------------------------------------------------------- 1 | BBPATH .= ":${LAYERDIR}" 2 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 3 | ${LAYERDIR}/recipes-*/*/*.bbappend" 4 | 5 | BBFILE_COLLECTIONS += "snappy" 6 | BBFILE_PATTERN_snappy = "^${LAYERDIR}/" 7 | BBFILE_PRIORITY_snappy = "7" 8 | 9 | # This should only be incremented on significant changes that will 10 | # cause compatibility issues with other layers 11 | LAYERVERSION_snappy = "1" 12 | LAYERSERIES_COMPAT_snappy = "honister" 13 | LAYERDEPENDS_snappy = "core filesystems-layer security" 14 | -------------------------------------------------------------------------------- /recipes-core/images/snapd-demo-image.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A small demo image to demo Snappy running on OpenEmbedded/Yocto" 2 | 3 | IMAGE_INSTALL = " \ 4 | packagegroup-core-boot \ 5 | ${CORE_IMAGE_EXTRA_INSTALL} \ 6 | packagegroup-snapd \ 7 | connman \ 8 | bash \ 9 | rpm \ 10 | " 11 | 12 | IMAGE_LINGUAS = " " 13 | 14 | LICENSE = "MIT" 15 | 16 | inherit core-image 17 | 18 | IMAGE_ROOTFS_SIZE ?= "819200" 19 | IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}" 20 | -------------------------------------------------------------------------------- /recipes-core/packagegroups/packagegroup-snapd.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Package group providing snap support" 2 | PR = "r0" 3 | 4 | inherit packagegroup 5 | 6 | RDEPENDS:${PN} = " \ 7 | snapd \ 8 | " 9 | -------------------------------------------------------------------------------- /recipes-kernel/linux/files/snappy.cfg: -------------------------------------------------------------------------------- 1 | # for more info, see REQUIREMENTS in systemd/README: 2 | CONFIG_DEVTMPFS=y 3 | CONFIG_CGROUPS=y 4 | CONFIG_INOTIFY_USER=y 5 | CONFIG_SIGNALFD=y 6 | CONFIG_TIMERFD=y 7 | CONFIG_EPOLL=y 8 | CONFIG_NET=y 9 | CONFIG_SYSFS=y 10 | CONFIG_PROC_FS=y 11 | CONFIG_FHANDLE=y 12 | # CONFIG_SYSFS_DEPRECATED is not set 13 | CONFIG_UEVENT_HELPER_PATH="" 14 | # CONFIG_FW_LOADER_USER_HELPER is not set 15 | CONFIG_DMIID=y 16 | CONFIG_BLK_DEV_BSG=y 17 | CONFIG_NET_NS=y 18 | CONFIG_DEVPTS_MULTIPLE_INSTANCES=y 19 | # Optional but strongly recommended: 20 | CONFIG_IPV6=y 21 | CONFIG_AUTOFS4_FS=y 22 | CONFIG_TMPFS_POSIX_ACL=y 23 | CONFIG_TMPFS_XATTR=y 24 | CONFIG_SECCOMP=y 25 | CONFIG_CGROUP_SCHED=y 26 | CONFIG_FAIR_GROUP_SCHED=y 27 | CONFIG_CFS_BANDWIDTH=y 28 | CONFIG_SCHEDSTATS=y 29 | CONFIG_SCHED_DEBUG=y 30 | CONFIG_EFIVAR_FS=y 31 | CONFIG_EFI_PARTITION=y 32 | # CONFIG_AUDIT is not set 33 | 34 | CONFIG_RD_BZIP2=y 35 | CONFIG_RD_LZMA=y 36 | CONFIG_RD_XZ=y 37 | CONFIG_REGULATOR=y 38 | CONFIG_RFKILL=y 39 | CONFIG_RFKILL_INPUT=y 40 | CONFIG_RFKILL_REGULATOR=m 41 | CONFIG_RFKILL_GPIO=m 42 | CONFIG_RAW_DRIVER=m 43 | CONFIG_FANOTIFY=y 44 | CONFIG_AUTOFS4_FS=y 45 | # CONFIG_USB_FUNCTIONFS is not set 46 | # CONFIG_USB_ZERO is not set 47 | # CONFIG_USB_MASS_STORAGE is not set 48 | # CONFIG_USB_G_MULTI_CDC is not set 49 | CONFIG_CONFIGFS_FS=y 50 | CONFIG_KEYS=y 51 | CONFIG_ENCRYPTED_KEYS=y 52 | CONFIG_SQUASHFS=m 53 | CONFIG_SQUASHFS_FILE_DIRECT=y 54 | CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y 55 | CONFIG_SQUASHFS_XATTR=y 56 | CONFIG_SQUASHFS_ZLIB=y 57 | CONFIG_SQUASHFS_LZ4=y 58 | CONFIG_SQUASHFS_LZO=y 59 | CONFIG_SQUASHFS_XZ=y 60 | 61 | # https://github.com/docker/docker/blob/master/contrib/check-config.sh 62 | CONFIG_NAMESPACES=y 63 | CONFIG_NET_NS=y 64 | CONFIG_PID_NS=y 65 | CONFIG_IPC_NS=y 66 | CONFIG_UTS_NS=y 67 | CONFIG_DEVPTS_MULTIPLE_INSTANCES=y 68 | CONFIG_CGROUPS=y 69 | CONFIG_CGROUP_CPUACCT=y 70 | CONFIG_CGROUP_DEVICE=y 71 | CONFIG_CGROUP_FREEZER=y 72 | CONFIG_CGROUP_SCHED=y 73 | CONFIG_CPUSETS=y 74 | CONFIG_MEMCG=y 75 | CONFIG_KEYS=y 76 | CONFIG_MACVLAN=m 77 | CONFIG_VETH=m 78 | CONFIG_BRIDGE=m 79 | CONFIG_BRIDGE_NETFILTER=m 80 | CONFIG_NF_NAT_IPV4=m 81 | CONFIG_IP_NF_FILTER=m 82 | CONFIG_IP_NF_TARGET_MASQUERADE=m 83 | CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m 84 | CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 85 | CONFIG_NF_NAT=m 86 | CONFIG_NF_NAT_NEEDED=y 87 | CONFIG_POSIX_MQUEUE=y 88 | # optional features 89 | CONFIG_USER_NS=y 90 | CONFIG_SECCOMP=y 91 | CONFIG_CGROUP_PIDS=y 92 | CONFIG_MEMCG_KMEM=y 93 | CONFIG_MEMCG_SWAP=y 94 | CONFIG_BLK_CGROUP=y 95 | CONFIG_BLK_DEV_THROTTLING=y 96 | CONFIG_IOSCHED_CFQ=y 97 | CONFIG_CFQ_GROUP_IOSCHED=y 98 | CONFIG_CGROUP_PERF=y 99 | CONFIG_CGROUP_HUGETLB=y 100 | CONFIG_NET_CLS_CGROUP=m 101 | CONFIG_CGROUP_NET_PRIO=y 102 | CONFIG_CFS_BANDWIDTH=y 103 | CONFIG_FAIR_GROUP_SCHED=y 104 | CONFIG_RT_GROUP_SCHED=m 105 | CONFIG_EXT4_FS=y 106 | CONFIG_EXT4_FS_POSIX_ACL=y 107 | CONFIG_EXT4_FS_SECURITY=y 108 | CONFIG_VXLAN=m 109 | CONFIG_BTRFS_FS=m 110 | CONFIG_BLK_DEV_DM=y 111 | CONFIG_DM_THIN_PROVISIONING=m 112 | CONFIG_OVERLAY_FS=m 113 | CONFIG_OVERLAY_FS_V1=y 114 | -------------------------------------------------------------------------------- /recipes-kernel/linux/linux-yocto_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | SRC_URI += "file://snappy.cfg" 3 | -------------------------------------------------------------------------------- /recipes-support/snapd/files/0001-packaging-use-templates-for-relevant-systemd-units.patch: -------------------------------------------------------------------------------- 1 | From 0ad3491ce6d26c3dc772a4397b98cb706dc53fbf Mon Sep 17 00:00:00 2001 2 | From: Simon Fels 3 | Date: Fri, 24 Mar 2017 17:54:48 +0100 4 | Subject: [PATCH 1/4] packaging: use templates for relevant systemd units 5 | 6 | To make packaging across different distributionis a bit easier we 7 | now use templates for some of our systemd units and replace things 8 | which are in a different location with sed at build time. 9 | --- 10 | data/systemd/snapd.autoimport.service | 10 ---------- 11 | data/systemd/snapd.autoimport.service.in | 10 ++++++++++ 12 | data/systemd/snapd.refresh.service | 11 ----------- 13 | data/systemd/snapd.refresh.service.in | 11 +++++++++++ 14 | data/systemd/snapd.service | 11 ----------- 15 | data/systemd/snapd.service.in | 11 +++++++++++ 16 | packaging/ubuntu-16.04/rules | 11 +++++++++++ 17 | 7 files changed, 43 insertions(+), 32 deletions(-) 18 | delete mode 100644 data/systemd/snapd.autoimport.service 19 | create mode 100644 data/systemd/snapd.autoimport.service.in 20 | delete mode 100644 data/systemd/snapd.refresh.service 21 | create mode 100644 data/systemd/snapd.refresh.service.in 22 | delete mode 100644 data/systemd/snapd.service 23 | create mode 100644 data/systemd/snapd.service.in 24 | 25 | diff --git a/data/systemd/snapd.autoimport.service b/data/systemd/snapd.autoimport.service 26 | deleted file mode 100644 27 | index 2c75f15..0000000 28 | --- a/data/systemd/snapd.autoimport.service 29 | +++ /dev/null 30 | @@ -1,10 +0,0 @@ 31 | -[Unit] 32 | -Description=Auto import assertions from block devices 33 | -After=snapd.service snapd.socket 34 | - 35 | -[Service] 36 | -Type=oneshot 37 | -ExecStart=/usr/bin/snap auto-import 38 | - 39 | -[Install] 40 | -WantedBy=multi-user.target 41 | diff --git a/data/systemd/snapd.autoimport.service.in b/data/systemd/snapd.autoimport.service.in 42 | new file mode 100644 43 | index 0000000..04b9a7e 44 | --- /dev/null 45 | +++ b/data/systemd/snapd.autoimport.service.in 46 | @@ -0,0 +1,10 @@ 47 | +[Unit] 48 | +Description=Auto import assertions from block devices 49 | +After=snapd.service snapd.socket 50 | + 51 | +[Service] 52 | +Type=oneshot 53 | +ExecStart=@bindir@/snap auto-import 54 | + 55 | +[Install] 56 | +WantedBy=multi-user.target 57 | diff --git a/data/systemd/snapd.refresh.service b/data/systemd/snapd.refresh.service 58 | deleted file mode 100644 59 | index 893217f..0000000 60 | --- a/data/systemd/snapd.refresh.service 61 | +++ /dev/null 62 | @@ -1,11 +0,0 @@ 63 | -[Unit] 64 | -Description=Automatically refresh installed snaps 65 | -After=network-online.target snapd.socket 66 | -Requires=snapd.socket 67 | -ConditionPathExistsGlob=/snap/*/current 68 | -Documentation=man:snap(1) 69 | - 70 | -[Service] 71 | -Type=oneshot 72 | -ExecStart=/usr/bin/snap refresh 73 | -Environment=SNAP_REFRESH_FROM_EMERGENCY_TIMER=1 74 | diff --git a/data/systemd/snapd.refresh.service.in b/data/systemd/snapd.refresh.service.in 75 | new file mode 100644 76 | index 0000000..d5cd14b 77 | --- /dev/null 78 | +++ b/data/systemd/snapd.refresh.service.in 79 | @@ -0,0 +1,11 @@ 80 | +[Unit] 81 | +Description=Automatically refresh installed snaps 82 | +After=network-online.target snapd.socket 83 | +Requires=snapd.socket 84 | +ConditionPathExistsGlob=@SNAP_MOUNTDIR@/*/current 85 | +Documentation=man:snap(1) 86 | + 87 | +[Service] 88 | +Type=oneshot 89 | +ExecStart=@bindir@/snap refresh 90 | +Environment=SNAP_REFRESH_FROM_EMERGENCY_TIMER=1 91 | diff --git a/data/systemd/snapd.service b/data/systemd/snapd.service 92 | deleted file mode 100644 93 | index 0863225..0000000 94 | --- a/data/systemd/snapd.service 95 | +++ /dev/null 96 | @@ -1,11 +0,0 @@ 97 | -[Unit] 98 | -Description=Snappy daemon 99 | -Requires=snapd.socket 100 | - 101 | -[Service] 102 | -ExecStart=/usr/lib/snapd/snapd 103 | -EnvironmentFile=/etc/environment 104 | -Restart=always 105 | - 106 | -[Install] 107 | -WantedBy=multi-user.target 108 | diff --git a/data/systemd/snapd.service.in b/data/systemd/snapd.service.in 109 | new file mode 100644 110 | index 0000000..009e62e 111 | --- /dev/null 112 | +++ b/data/systemd/snapd.service.in 113 | @@ -0,0 +1,11 @@ 114 | +[Unit] 115 | +Description=Snappy daemon 116 | +Requires=snapd.socket 117 | + 118 | +[Service] 119 | +ExecStart=@libexecdir@/snapd/snapd 120 | +EnvironmentFile=@SNAPD_ENVIRONMENT_FILE@ 121 | +Restart=always 122 | + 123 | +[Install] 124 | +WantedBy=multi-user.target 125 | diff --git a/packaging/ubuntu-16.04/rules b/packaging/ubuntu-16.04/rules 126 | index a1328ac..18611b6 100755 127 | --- a/packaging/ubuntu-16.04/rules 128 | +++ b/packaging/ubuntu-16.04/rules 129 | @@ -90,6 +90,16 @@ override_dh_auto_build: 130 | cd cmd && ( ./configure --prefix=/usr --libexecdir=/usr/lib/snapd $(VENDOR_ARGS)) 131 | $(MAKE) -C cmd all 132 | 133 | + # Generate the real systemd units out of the available templates 134 | + cat data/systemd/snapd.service.in | \ 135 | + sed s:@libexecdir@:/usr/lib:g | \ 136 | + sed s:@SNAPD_ENVIRONMENT_FILE@:/etc/environment:g > data/systemd/snapd.service 137 | + cat data/systemd/snapd.refresh.service.in | \ 138 | + sed s:@bindir@:/usr/bin:g | \ 139 | + sed s:@SNAP_MOUNTDIR@:/snap:g > data/systemd/snapd.refresh.service 140 | + cat data/systemd/snapd.autoimport.service.in | \ 141 | + sed s:@bindir@:/usr/bin:g > data/systemd/snapd.autoimport.service 142 | + 143 | override_dh_auto_test: 144 | dh_auto_test -- $(GCCGOFLAGS) 145 | # a tested default (production) build should have no test keys 146 | @@ -164,6 +174,7 @@ override_dh_install: 147 | if [ -d share/locale ]; then \ 148 | cp -R share/locale debian/snapd/usr/share; \ 149 | fi 150 | + 151 | # install snapd's systemd units, done here instead of 152 | # debian/snapd.install because the ubuntu/14.04 release 153 | # branch adds/changes bits here 154 | -- 155 | 2.7.4 156 | 157 | -------------------------------------------------------------------------------- /recipes-support/snapd/files/0002-cmd-add-poky-to-the-list-of-distros-which-don-t-supp.patch: -------------------------------------------------------------------------------- 1 | From 8462eb4536d0fa1e0ed704bc205b288341b66775 Mon Sep 17 00:00:00 2001 2 | From: Simon Fels 3 | Date: Wed, 29 Mar 2017 17:33:34 +0200 4 | Subject: [PATCH] cmd: add poky to the list of distros which don't support 5 | reexec 6 | 7 | 'poky' is the std. release id for the Yocto reference distribution. This 8 | wont cover all Yocto based product as Yocto is a meta distribution so 9 | users are fine to change the release id to whatever they want. However 10 | this clearly takes care just about our reference Yocto system. 11 | --- 12 | cmd/cmd.go | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/cmd/cmd.go b/cmd/cmd.go 16 | index c70b6cc..c681b39 100644 17 | --- a/cmd/cmd.go 18 | +++ b/cmd/cmd.go 19 | @@ -62,7 +62,7 @@ func ExecInCoreSnap() { 20 | 21 | // can we re-exec? some distributions will need extra work before re-exec really works. 22 | switch release.ReleaseInfo.ID { 23 | - case "fedora", "centos", "rhel", "opensuse", "suse": 24 | + case "fedora", "centos", "rhel", "opensuse", "suse", "poky": 25 | logger.Debugf("re-exec not supported on distro %q yet", release.ReleaseInfo.ID) 26 | return 27 | } 28 | -- 29 | 2.7.4 30 | 31 | -------------------------------------------------------------------------------- /recipes-support/snapd/snapd_2.51.5.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "The snapd and snap tools enable systems to work with .snap files." 2 | HOMEPAGE = "https://www.snapcraft.io" 3 | LICENSE = "GPL-3.0" 4 | LIC_FILES_CHKSUM = "file://${WORKDIR}/${PN}-${PV}/COPYING;md5=d32239bcb673463ab874e80d47fae504" 5 | 6 | SRC_URI = " \ 7 | https://${GO_IMPORT}/releases/download/${PV}/snapd_${PV}.vendor.tar.xz \ 8 | " 9 | 10 | SRC_URI[md5sum] = "0869cf83542632cef3ad721058db890a" 11 | SRC_URI[sha256sum] = "1e8c9e7c37cb4099d7bc0e877362d4bef2cf8383e56e7431970b99b23a726493" 12 | 13 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor', '', d)}" 14 | PACKAGECONFIG[apparmor] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" 15 | 16 | GO_IMPORT = "github.com/snapcore/snapd" 17 | 18 | SHARED_GO_INSTALL = " \ 19 | ${GO_IMPORT}/cmd/snap \ 20 | ${GO_IMPORT}/cmd/snapd \ 21 | ${GO_IMPORT}/cmd/snap-seccomp \ 22 | ${GO_IMPORT}/cmd/snap-failure \ 23 | " 24 | 25 | STATIC_GO_INSTALL = " \ 26 | ${GO_IMPORT}/cmd/snap-exec \ 27 | ${GO_IMPORT}/cmd/snap-update-ns \ 28 | ${GO_IMPORT}/cmd/snapctl \ 29 | " 30 | 31 | GO_INSTALL = "${SHARED_GO_INSTALL}" 32 | 33 | DEPENDS += " \ 34 | glib-2.0 \ 35 | udev \ 36 | xfsprogs \ 37 | libseccomp \ 38 | " 39 | 40 | RDEPENDS:${PN} += " \ 41 | ca-certificates \ 42 | kernel-module-squashfs \ 43 | bash \ 44 | " 45 | 46 | S = "${WORKDIR}/${PN}-${PV}" 47 | 48 | EXTRA_OECONF += " \ 49 | --libexecdir=${libdir}/snapd \ 50 | --with-snap-mount-dir=/snap \ 51 | " 52 | 53 | inherit systemd autotools pkgconfig go 54 | 55 | # disable shared runtime for x86 56 | # https://forum.snapcraft.io/t/yocto-rocko-core-snap-panic/3261 57 | # GO_DYNLINK is set with arch overrides in goarch.bbclass 58 | GO_DYNLINK:x86 = "" 59 | GO_DYNLINK:x86-64 = "" 60 | GO_DYNLINK:arm = "" 61 | GO_DYNLINK:aarch64 = "" 62 | 63 | # Our tools build with autotools are inside the cmd subdirectory 64 | # and we need to tell the autotools class to look in there. 65 | AUTOTOOLS_SCRIPT_PATH = "${S}/cmd" 66 | 67 | SYSTEMD_SERVICE:${PN} = "snapd.service" 68 | 69 | do_configure:prepend() { 70 | (cd ${S} ; ./mkversion.sh ${PV}) 71 | } 72 | 73 | # The go class does export a do_configure function, of which we need 74 | # to change the symlink set-up, to target snapd's environment. 75 | do_configure() { 76 | mkdir -p ${S}/src/github.com/snapcore 77 | ln -snf ${S} ${S}/src/${GO_IMPORT} 78 | go_do_configure 79 | autotools_do_configure 80 | } 81 | 82 | do_compile() { 83 | export GO111MODULE=off 84 | go_do_compile 85 | # these *must* be built statically 86 | for prog in ${STATIC_GO_INSTALL}; do 87 | ${GO} install -v \ 88 | -ldflags="${GO_RPATH} -linkmode=external -extldflags '${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS} -static'" \ 89 | $prog 90 | done 91 | 92 | # build the rest 93 | autotools_do_compile 94 | } 95 | 96 | do_install() { 97 | install -d ${D}${libdir}/snapd 98 | install -d ${D}${bindir} 99 | install -d ${D}${systemd_unitdir}/system 100 | install -d ${D}/var/lib/snapd 101 | install -d ${D}/var/lib/snapd/snaps 102 | install -d ${D}/var/lib/snapd/lib/gl 103 | install -d ${D}/var/lib/snapd/desktop 104 | install -d ${D}/var/lib/snapd/environment 105 | install -d ${D}/var/snap 106 | install -d ${D}${sysconfdir}/profile.d 107 | install -d ${D}${systemd_unitdir}/system-generators 108 | 109 | oe_runmake -C ${B} install DESTDIR=${D} 110 | oe_runmake -C ${S}/data/systemd install \ 111 | DESTDIR=${D} \ 112 | BINDIR=${bindir} \ 113 | LIBEXECDIR=${libdir} \ 114 | SYSTEMDSYSTEMUNITDIR=${systemd_system_unitdir} \ 115 | SNAP_MOUNT_DIR=/snap \ 116 | SNAPD_ENVIRONMENT_FILE=${sysconfdir}/default/snapd 117 | 118 | # systemd system-environment-generators directory is not handled with a 119 | # varaible in systemd.pc so the build code does an educated guess of using 120 | # ${prefix}/lib/systemd/system-environment-generators which ends up as 121 | # /usr/lib/systemd/.., but we want /lib/systemd/.. 122 | cp -av ${D}${prefix}${systemd_unitdir}/system-environment-generators \ 123 | ${D}${systemd_unitdir} 124 | rm -rf ${D}${prefix}${systemd_unitdir} 125 | 126 | install -m 0755 ${B}/${GO_BUILD_BINDIR}/snapd ${D}${libdir}/snapd/ 127 | install -m 0755 ${B}/${GO_BUILD_BINDIR}/snap-exec ${D}${libdir}/snapd/ 128 | install -m 0755 ${B}/${GO_BUILD_BINDIR}/snap-seccomp ${D}${libdir}/snapd/ 129 | install -m 0755 ${B}/${GO_BUILD_BINDIR}/snap-update-ns ${D}${libdir}/snapd/ 130 | install -m 0755 ${B}/${GO_BUILD_BINDIR}/snapctl ${D}${libdir}/snapd/ 131 | install -m 0755 ${B}/${GO_BUILD_BINDIR}/snap-failure ${D}${libdir}/snapd/ 132 | install -m 0755 ${B}/${GO_BUILD_BINDIR}/snap ${D}${bindir} 133 | ln -s ${libdir}/snapd/snapctl ${D}${bindir}/snapctl 134 | 135 | echo "PATH=\$PATH:/snap/bin" > ${D}${sysconfdir}/profile.d/20-snap.sh 136 | 137 | # ubuntu-core-launcher is dead 138 | rm -fv ${D}${bindir}/ubuntu-core-launcher 139 | # drop unnecessary units 140 | rm -fv ${D}${systemd_unitdir}/system/snapd.system-shutdown.service 141 | rm -fv ${D}${systemd_unitdir}/system/snapd.snap-repair.* 142 | rm -fv ${D}${systemd_unitdir}/system/snapd.core-fixup.* 143 | # and related scripts 144 | rm -fv ${D}${libdir}/snapd/snapd.core-fixup.sh 145 | } 146 | 147 | RDEPENDS:{PN} += "squashfs-tools" 148 | FILES:${PN} += " \ 149 | ${systemd_unitdir}/system/ \ 150 | ${systemd_unitdir}/system-generators/ \ 151 | ${systemd_unitdir}/system-environment-generators/ \ 152 | /var/lib/snapd \ 153 | /var/snap \ 154 | ${baselib}/udev/snappy-app-dev \ 155 | " 156 | --------------------------------------------------------------------------------