summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.bb8
-rw-r--r--recipes-support/libgsystem/libgsystem_git.bb4
5 files changed, 40 insertions, 21 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..a9a9c2c 100644
--- a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
+++ b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
@@ -21,7 +21,7 @@ FILES_${PN} = " \
21 ${bindir}/system_info.sh \ 21 ${bindir}/system_info.sh \
22 ${sysconfdir}/sota_client.version \ 22 ${sysconfdir}/sota_client.version \
23 ${sysconfdir}/sota_certificates \ 23 ${sysconfdir}/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 \ 25 ${bindir}/sota_ostree.sh \
26 " 26 "
27 27
@@ -134,8 +134,10 @@ do_install() {
134 install -m 0755 run/system_info.sh ${D}${bindir} 134 install -m 0755 run/system_info.sh ${D}${bindir}
135 install -m 0755 run/sota_ostree.sh ${D}${bindir} 135 install -m 0755 run/sota_ostree.sh ${D}${bindir}
136 136
137 install -d ${D}${systemd_unitdir}/system 137 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
138 install -c ${S}/run/sota_client.service ${D}${systemd_unitdir}/system 138 install -d ${D}${systemd_unitdir}/system
139 install -c ${S}/run/sota_client.service ${D}${systemd_unitdir}/system
140 fi
139 141
140 install -d ${D}${sysconfdir} 142 install -d ${D}${sysconfdir}
141 install -c ${S}/run/sota_certificates ${D}${sysconfdir} 143 install -c ${S}/run/sota_certificates ${D}${sysconfdir}
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"