summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOYTIS <tossel@gmail.com>2016-12-20 15:19:17 +0100
committerGitHub <noreply@github.com>2016-12-20 15:19:17 +0100
commit17e728e33bcb430b01dc3c424b313d1bbe3aae7c (patch)
treed890826197dcd77c5384691332f1d167f1a63208
parent7ad5573662a0e6b3845e00e860846ca9c579f1e6 (diff)
parent65535be95067665b1212d7f7963e474f3b628af5 (diff)
downloadmeta-updater-17e728e33bcb430b01dc3c424b313d1bbe3aae7c.tar.gz
Merge pull request #12 from advancedtelematic/feat/nosystemd
Make systemd optional
-rw-r--r--classes/image_types_ostree.bbclass35
-rw-r--r--conf/distro/sota.conf.inc5
-rw-r--r--recipes-sota/ostree/ostree_git.bb9
-rw-r--r--recipes-sota/rvi-sota-client/rvi-sota-client_git.bb149
-rw-r--r--recipes-support/libgsystem/libgsystem_git.bb4
5 files changed, 102 insertions, 100 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 32ea98f..f88140c 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -14,6 +14,8 @@ RAMDISK_EXT_arm ?= ".ext4.gz.u-boot"
14 14
15OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" 15OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
16 16
17export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}"
18
17IMAGE_CMD_ostree () { 19IMAGE_CMD_ostree () {
18 if [ -z "$OSTREE_REPO" ]; then 20 if [ -z "$OSTREE_REPO" ]; then
19 bbfatal "OSTREE_REPO should be set in your local.conf" 21 bbfatal "OSTREE_REPO should be set in your local.conf"
@@ -51,13 +53,21 @@ IMAGE_CMD_ostree () {
51 fi 53 fi
52 done 54 done
53 55
54 if [ ! -d "usr/etc/tmpfiles.d" ]; then 56 if [ -n "$SYSTEMD_USED" ]; then
55 mkdir usr/etc/tmpfiles.d 57 mkdir -p usr/etc/tmpfiles.d
58 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf
59 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf}
60 echo "L /var/rootdirs/home - - - - /sysroot/home" >>${tmpfiles_conf}
61 else
62 mkdir -p usr/etc/init.d
63 tmpfiles_conf=usr/etc/init.d/tmpfiles.sh
64 echo '#!/bin/sh' > ${tmpfiles_conf}
65 echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf}
66 echo "ln -sf /sysroot/home /var/rootdirs/home" >> ${tmpfiles_conf}
67
68 ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh
56 fi 69 fi
57 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf
58 70
59 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf}
60 echo "L /var/rootdirs/home - - - - /sysroot/home" >>${tmpfiles_conf}
61 # Preserve data in /home to be later copied to /sysroot/home by 71 # Preserve data in /home to be later copied to /sysroot/home by
62 # sysroot generating procedure 72 # sysroot generating procedure
63 mkdir -p usr/homedirs 73 mkdir -p usr/homedirs
@@ -74,7 +84,12 @@ IMAGE_CMD_ostree () {
74 if [ "$(ls -A $dir)" ]; then 84 if [ "$(ls -A $dir)" ]; then
75 bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr" 85 bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr"
76 fi 86 fi
77 echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf} 87
88 if [ -n "$SYSTEMD_USED" ]; then
89 echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf}
90 else
91 echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf}
92 fi
78 rm -rf ${dir} 93 rm -rf ${dir}
79 ln -sf var/rootdirs/${dir} ${dir} 94 ln -sf var/rootdirs/${dir} ${dir}
80 fi 95 fi
@@ -84,7 +99,13 @@ IMAGE_CMD_ostree () {
84 if [ "$(ls -A root)" ]; then 99 if [ "$(ls -A root)" ]; then
85 bberror "Data in /root directory is not preserved by OSTree." 100 bberror "Data in /root directory is not preserved by OSTree."
86 fi 101 fi
87 echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf} 102
103 if [ -n "$SYSTEMD_USED" ]; then
104 echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf}
105 else
106 echo "mkdir -p /var/roothome; chown 755 /var/roothome" >>${tmpfiles_conf}
107 fi
108
88 rm -rf root 109 rm -rf root
89 ln -sf var/roothome root 110 ln -sf var/roothome root
90 fi 111 fi
diff --git a/conf/distro/sota.conf.inc b/conf/distro/sota.conf.inc
index 5520154..3136092 100644
--- a/conf/distro/sota.conf.inc
+++ b/conf/distro/sota.conf.inc
@@ -27,9 +27,4 @@ PREFERRED_PROVIDER_virtual/bootloader_raspberrypi3 = "u-boot"
27# Some BSPs (e.g. meta-raspberrypi) use this variable to turn debug on/off 27# Some BSPs (e.g. meta-raspberrypi) use this variable to turn debug on/off
28DISTRO_TYPE ?= "${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "debug", "release",d)}" 28DISTRO_TYPE ?= "${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "debug", "release",d)}"
29 29
30DISTRO_FEATURES_append = " systemd"
31PREFERRED_PROVIDER_udev ?= "systemd"
32PREFERRED_PROVIDER_udev-utils ?= "systemd"
33VIRTUAL-RUNTIME_init_manager = "systemd"
34
35DISTROOVERRIDES_append = ":sota" 30DISTROOVERRIDES_append = ":sota"
diff --git a/recipes-sota/ostree/ostree_git.bb b/recipes-sota/ostree/ostree_git.bb
index d444669..b6adf9b 100644
--- a/recipes-sota/ostree/ostree_git.bb
+++ b/recipes-sota/ostree/ostree_git.bb
@@ -14,7 +14,9 @@ S = "${WORKDIR}/git"
14 14
15BBCLASSEXTEND = "native" 15BBCLASSEXTEND = "native"
16 16
17DEPENDS += "attr libarchive glib-2.0 pkgconfig gpgme libgsystem fuse libsoup-2.4 e2fsprogs systemd" 17DEPENDS += "attr libarchive glib-2.0 pkgconfig gpgme libgsystem fuse libsoup-2.4 e2fsprogs"
18DEPENDS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
19
18DEPENDS_remove_class-native = "systemd-native" 20DEPENDS_remove_class-native = "systemd-native"
19 21
20RDEPENDS_${PN} = "python util-linux-libuuid util-linux-libblkid util-linux-libmount libcap xz os-release" 22RDEPENDS_${PN} = "python util-linux-libuuid util-linux-libblkid util-linux-libmount libcap xz os-release"
@@ -25,7 +27,7 @@ EXTRA_OEMAKE = "CFLAGS='-g'"
25EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat" 27EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat"
26 28
27SYSTEMD_REQUIRED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" 29SYSTEMD_REQUIRED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
28SYSTEMD_REQUIRED_class-native = "" 30SYSTEMD_REQUIRED_class-native = "false"
29 31
30SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service" 32SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service"
31SYSTEMD_SERVICE_${PN}_class-native = "" 33SYSTEMD_SERVICE_${PN}_class-native = ""
@@ -52,8 +54,7 @@ do_compile_prepend() {
52export SYSTEMD_REQUIRED 54export SYSTEMD_REQUIRED
53 55
54do_install_append() { 56do_install_append() {
55 if [ -n ${SYSTEMD_REQUIRED} ]; then 57 if [ "$SYSTEMD_REQUIRED" == "true" ]; then
56 install -p -D ${S}/src/boot/ostree-prepare-root.service ${D}${systemd_unitdir}/system/ostree-prepare-root.service
57 install -p -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service 58 install -p -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service
58 fi 59 fi
59} 60}
diff --git a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
index 9a7ec10..0acc6c6 100644
--- a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
+++ b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
@@ -8,97 +8,90 @@ inherit cargo systemd
8 8
9S = "${WORKDIR}/git" 9S = "${WORKDIR}/git"
10 10
11SRCREV = "72e6096d9122cde2d9ece4e2693bd470e2b57abe" 11SRCREV = "7fa3b3e088ed002d8d99b5496c5755f0fb358ab0"
12 12
13# Generate with: 13# Generate with:
14# git describe --tags | cut -b2- 14# git describe --tags | cut -b2-
15PV = "v0.2.22-4-g72e6096" 15PV = "0.2.23-5-g7fa3b3e"
16 16
17BBCLASSEXTEND = "native" 17BBCLASSEXTEND = "native"
18 18
19FILES_${PN} = " \ 19FILES_${PN} = " \
20 ${bindir}/sota_client \ 20 /usr/bin/sota_client \
21 ${bindir}/system_info.sh \ 21 /usr/bin/sota_sysinfo.sh \
22 ${sysconfdir}/sota_client.version \ 22 /etc/sota_client.version \
23 ${sysconfdir}/sota_certificates \ 23 /etc/sota_certificates \
24 ${systemd_unitdir}/system/sota_client.service \ 24 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota_client.service', '', d)} \
25 ${bindir}/sota_ostree.sh \
26 " 25 "
27 26
28SRC_URI = " \ 27SRC_URI = " \
29crate://crates.io/aho-corasick/0.5.3 \ 28crate://crates.io/aho-corasick/0.5.3 \
30crate://crates.io/time/0.1.35 \
31crate://crates.io/url/1.2.1 \
32crate://crates.io/ws2_32-sys/0.2.1 \
33crate://crates.io/hyper/0.9.4 \
34crate://crates.io/log/0.3.6 \
35crate://crates.io/unicase/1.4.0 \
36crate://crates.io/bitflags/0.7.0 \
37crate://crates.io/bit-set/0.2.0 \ 29crate://crates.io/bit-set/0.2.0 \
38crate://crates.io/lazy_static/0.2.1 \ 30crate://crates.io/bit-vec/0.4.3 \
39crate://crates.io/rust-crypto/0.2.36 \ 31crate://crates.io/bitflags/0.4.0 \
40crate://crates.io/typeable/0.1.2 \ 32crate://crates.io/bitflags/0.7.0 \
41crate://crates.io/pkg-config/0.3.8 \ 33crate://crates.io/bytes/0.3.0 \
42crate://crates.io/httparse/1.1.2 \ 34crate://crates.io/cfg-if/0.1.0 \
43crate://crates.io/openssl/0.8.3 \ 35crate://crates.io/chan-signal/0.1.7 \
44crate://crates.io/user32-sys/0.2.0 \
45crate://crates.io/regex/0.1.77 \
46crate://crates.io/unicode-normalization/0.1.2 \
47crate://crates.io/idna/0.1.0 \
48crate://crates.io/unicode-bidi/0.2.3 \
49crate://crates.io/rand/0.3.14 \
50crate://crates.io/gcc/0.3.37 \
51crate://crates.io/chan/0.1.18 \ 36crate://crates.io/chan/0.1.18 \
52crate://crates.io/kernel32-sys/0.2.2 \ 37crate://crates.io/cookie/0.2.5 \
53crate://crates.io/winapi/0.2.8 \
54crate://crates.io/crossbeam/0.2.10 \ 38crate://crates.io/crossbeam/0.2.10 \
55crate://crates.io/bitflags/0.4.0 \
56crate://crates.io/thread-id/2.0.0 \
57crate://crates.io/mime/0.2.2 \
58crate://crates.io/thread_local/0.2.7 \
59crate://crates.io/utf8-ranges/0.1.3 \
60crate://crates.io/net2/0.2.26 \
61crate://crates.io/dbus/0.4.1 \ 39crate://crates.io/dbus/0.4.1 \
62crate://crates.io/winapi-build/0.1.1 \ 40crate://crates.io/env_logger/0.3.5 \
63crate://crates.io/chan-signal/0.1.7 \ 41crate://crates.io/gcc/0.3.39 \
64crate://crates.io/bit-vec/0.4.3 \ 42crate://crates.io/gdi32-sys/0.2.0 \
65crate://crates.io/toml/0.2.1 \
66crate://crates.io/quick-error/0.2.2 \
67crate://crates.io/ws/0.5.3 \
68crate://crates.io/traitobject/0.0.1 \
69crate://crates.io/cfg-if/0.1.0 \
70crate://crates.io/matches/0.1.3 \
71crate://crates.io/getopts/0.2.14 \ 43crate://crates.io/getopts/0.2.14 \
72crate://crates.io/sha1/0.2.0 \ 44crate://crates.io/hpack/0.2.0 \
73crate://crates.io/openssl-sys/0.7.17 \ 45crate://crates.io/httparse/1.2.1 \
74crate://crates.io/cookie/0.2.5 \ 46crate://crates.io/hyper/0.9.13 \
75crate://crates.io/libressl-pnacl-sys/2.1.6 \ 47crate://crates.io/idna/0.1.0 \
48crate://crates.io/kernel32-sys/0.2.2 \
76crate://crates.io/language-tags/0.2.2 \ 49crate://crates.io/language-tags/0.2.2 \
77crate://crates.io/semver/0.1.20 \ 50crate://crates.io/lazy_static/0.1.16 \
78crate://crates.io/unix_socket/0.5.0 \ 51crate://crates.io/lazy_static/0.2.2 \
52crate://crates.io/libc/0.2.18 \
53crate://crates.io/log/0.3.6 \
54crate://crates.io/matches/0.1.4 \
79crate://crates.io/memchr/0.1.11 \ 55crate://crates.io/memchr/0.1.11 \
80crate://crates.io/gdi32-sys/0.2.0 \ 56crate://crates.io/mime/0.2.2 \
81crate://crates.io/nom/1.2.4 \
82crate://crates.io/mio/0.5.1 \ 57crate://crates.io/mio/0.5.1 \
83crate://crates.io/tempdir/0.3.5 \
84crate://crates.io/miow/0.1.3 \ 58crate://crates.io/miow/0.1.3 \
85crate://crates.io/pnacl-build-helper/1.4.10 \ 59crate://crates.io/net2/0.2.26 \
86crate://crates.io/libc/0.2.17 \
87crate://crates.io/nix/0.5.1 \ 60crate://crates.io/nix/0.5.1 \
61crate://crates.io/nom/1.2.4 \
62crate://crates.io/num_cpus/1.2.0 \
63crate://crates.io/openssl-sys/0.9.3 \
64crate://crates.io/openssl/0.9.3 \
65crate://crates.io/pkg-config/0.3.8 \
66crate://crates.io/rand/0.3.15 \
67crate://crates.io/regex-syntax/0.3.9 \
68crate://crates.io/regex/0.1.80 \
69crate://crates.io/rust-crypto/0.2.36 \
70crate://crates.io/rustc-serialize/0.3.22 \
88crate://crates.io/rustc_version/0.1.7 \ 71crate://crates.io/rustc_version/0.1.7 \
72crate://crates.io/semver/0.1.20 \
73crate://crates.io/sha1/0.2.0 \
89crate://crates.io/slab/0.1.3 \ 74crate://crates.io/slab/0.1.3 \
90crate://crates.io/rustc-serialize/0.3.19 \ 75crate://crates.io/solicit/0.4.4 \
91crate://crates.io/env_logger/0.3.5 \ 76crate://crates.io/thread-id/2.0.0 \
92crate://crates.io/vecio/0.1.0 \ 77crate://crates.io/thread_local/0.2.7 \
93crate://crates.io/rotor/0.6.3 \ 78crate://crates.io/time/0.1.35 \
94crate://crates.io/openssl-sys-extras/0.7.14 \ 79crate://crates.io/toml/0.2.1 \
95crate://crates.io/regex-syntax/0.3.7 \ 80crate://crates.io/traitobject/0.0.1 \
96crate://crates.io/bytes/0.3.0 \ 81crate://crates.io/typeable/0.1.2 \
97crate://crates.io/void/1.0.2 \ 82crate://crates.io/unicase/1.4.0 \
98crate://crates.io/spmc/0.2.1 \ 83crate://crates.io/unicode-bidi/0.2.3 \
99crate://crates.io/openssl-verify/0.1.0 \ 84crate://crates.io/unicode-normalization/0.1.2 \
100crate-index://crates.io/7670a5aa394d0dcd7598905b352d1634ca74d84a \ 85crate://crates.io/unix_socket/0.5.0 \
86crate://crates.io/url/1.2.3 \
87crate://crates.io/user32-sys/0.2.0 \
88crate://crates.io/utf8-ranges/0.1.3 \
89crate://crates.io/winapi-build/0.1.1 \
90crate://crates.io/winapi/0.2.8 \
91crate://crates.io/ws/0.5.3 \
92crate://crates.io/ws2_32-sys/0.2.1 \
101git://github.com/advancedtelematic/rvi_sota_client \ 93git://github.com/advancedtelematic/rvi_sota_client \
94crate-index://crates.io/213b1a455d9270888c03a42c8d29975369102caa \
102" 95"
103SRC_URI[index.md5sum] = "79f10f436dbf26737cc80445746f16b4" 96SRC_URI[index.md5sum] = "79f10f436dbf26737cc80445746f16b4"
104SRC_URI[index.sha256sum] = "86114b93f1f51aaf0aec3af0751d214b351f4ff9839ba031315c1b19dcbb1913" 97SRC_URI[index.sha256sum] = "86114b93f1f51aaf0aec3af0751d214b351f4ff9839ba031315c1b19dcbb1913"
@@ -113,30 +106,22 @@ RDEPENDS_${PN} = " libcrypto \
113 lshw \ 106 lshw \
114 jq \ 107 jq \
115 " 108 "
116export SOTA_VERSION = "${PV}"
117 109
118do_compile_prepend() { 110do_compile_prepend() {
119 # Fetch and build the specific build of hyper that is specified in cargo.toml. 111 export SOTA_VERSION=$(make sota-version)
120 # meta-rust doesn't support fetching crates that don't point to a specific tag
121 # and rvi-sota-client needs a specific work-around to function correctly.
122 make rust-openssl
123}
124
125do_compile_append() {
126 # Ensure that the 'make rust-openssl' above resulted in the local build of
127 # rust-openssl being used rather than the default one.
128 strings target/${TARGET_SYS}/release/sota_client | grep ${EXTENDPE}${PV}-${PR}/git/rust-openssl -q || (bberror "local rust-open ssl package not used"; exit 1)
129} 112}
130 113
131do_install() { 114do_install() {
132 install -d ${D}${bindir} 115 install -d ${D}${bindir}
133 install -m 0755 target/${TARGET_SYS}/release/sota_client ${D}${bindir} 116 install -m 0755 target/${TARGET_SYS}/release/sota_client ${D}${bindir}
134 install -m 0755 run/system_info.sh ${D}${bindir} 117 install -m 0755 run/sota_sysinfo.sh ${D}${bindir}
135 install -m 0755 run/sota_ostree.sh ${D}${bindir}
136 118
137 install -d ${D}${systemd_unitdir}/system 119 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
138 install -c ${S}/run/sota_client.service ${D}${systemd_unitdir}/system 120 install -d ${D}${systemd_unitdir}/system
121 install -c ${S}/run/sota_client.service ${D}${systemd_unitdir}/system
122 fi
139 123
140 install -d ${D}${sysconfdir} 124 install -d ${D}${sysconfdir}
125 echo `git log -1 --pretty=format:%H` > ${D}${sysconfdir}/sota_client.version
141 install -c ${S}/run/sota_certificates ${D}${sysconfdir} 126 install -c ${S}/run/sota_certificates ${D}${sysconfdir}
142} 127}
diff --git a/recipes-support/libgsystem/libgsystem_git.bb b/recipes-support/libgsystem/libgsystem_git.bb
index 181dd42..048c44b 100644
--- a/recipes-support/libgsystem/libgsystem_git.bb
+++ b/recipes-support/libgsystem/libgsystem_git.bb
@@ -9,9 +9,9 @@ S = "${WORKDIR}/git"
9 9
10inherit autotools-brokensep gobject-introspection 10inherit autotools-brokensep gobject-introspection
11 11
12DEPENDS += "attr glib-2.0 pkgconfig libcap" 12DEPENDS += "attr glib-2.0 pkgconfig libcap xz"
13RDEPENDS_${PN} = "xz systemd"
14 13
14RDEPENDS_${PN}_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
15RDEPENDS_${PN}_remove_class-native = "systemd-native" 15RDEPENDS_${PN}_remove_class-native = "systemd-native"
16 16
17BBCLASSEXTEND = "native" 17BBCLASSEXTEND = "native"