summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.adoc3
-rw-r--r--classes/sota_am335x-evm-wifi.bbclass1
-rw-r--r--classes/sota_m3ulcb.bbclass3
-rw-r--r--classes/sota_minnowboard.bbclass4
-rw-r--r--classes/sota_porter.bbclass2
-rw-r--r--classes/sota_qemux86-64.bbclass2
-rw-r--r--classes/sota_raspberrypi.bbclass4
-rw-r--r--conf/distro/poky-sota-systemd.conf3
-rw-r--r--conf/distro/poky-sota.conf2
-rw-r--r--recipes-connectivity/connman/connman_%.bbappend1
-rw-r--r--recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network5
-rw-r--r--recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb28
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb14
-rw-r--r--recipes-sota/aktualizr/garage-sign-version.inc36
-rw-r--r--recipes-test/images/secondary-image.bb3
15 files changed, 60 insertions, 51 deletions
diff --git a/README.adoc b/README.adoc
index d603ade..b23f04b 100644
--- a/README.adoc
+++ b/README.adoc
@@ -74,6 +74,8 @@ You may take a look into https://github.com/advancedtelematic/meta-updater-minno
74 74
75Although we have used U-Boot so far, other boot loaders can be configured work with OSTree as well. 75Although we have used U-Boot so far, other boot loaders can be configured work with OSTree as well.
76 76
77Your images will also need network connectivity to be able to reach an actual OTA backend. Our 'poky-sota' distribution does not mandate or install a default network manager but our supported platforms use the `virtual/network-configuration` recipe, which can be used as a starting example.
78
77== SOTA-related variables in local.conf 79== SOTA-related variables in local.conf
78 80
79* `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo` 81* `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo`
@@ -82,6 +84,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
82* `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}` 84* `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}`
83* `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default. 85* `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default.
84* `OSTREE_DEPLOY_DEVICETREE` - Set this to '1' to include devicetree(s) to boot 86* `OSTREE_DEPLOY_DEVICETREE` - Set this to '1' to include devicetree(s) to boot
87* `GARAGE_SIGN_AUTOVERSION` - Set this to '1' to automatically fetch the last version of the garage tools installed by the aktualizr-native. Otherwise use the fixed version specified in the recipe.
85* `INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy. 88* `INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy.
86* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push]. 89* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push].
87* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. 90* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build.
diff --git a/classes/sota_am335x-evm-wifi.bbclass b/classes/sota_am335x-evm-wifi.bbclass
index adefb47..1458d44 100644
--- a/classes/sota_am335x-evm-wifi.bbclass
+++ b/classes/sota_am335x-evm-wifi.bbclass
@@ -7,7 +7,6 @@ IMAGE_BOOT_FILES_sota = "bootfiles/*"
7OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/mmcblk0p2 console=ttyO0,115200n8l" 7OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/mmcblk0p2 console=ttyO0,115200n8l"
8 8
9IMAGE_INSTALL_append_sota = " uim iw wl18xx-calibrator wlconf wl18xx-fw hostapd wpa-supplicant" 9IMAGE_INSTALL_append_sota = " uim iw wl18xx-calibrator wlconf wl18xx-fw hostapd wpa-supplicant"
10IMAGE_INSTALL_remove_sota = " connman connman-client"
11 10
12PREFERRED_VERSION_linux-ti-staging_sota = "4.4.54+gitAUTOINC+ecd4eada6f" 11PREFERRED_VERSION_linux-ti-staging_sota = "4.4.54+gitAUTOINC+ecd4eada6f"
13 12
diff --git a/classes/sota_m3ulcb.bbclass b/classes/sota_m3ulcb.bbclass
index 6b63af4..b93cc40 100644
--- a/classes/sota_m3ulcb.bbclass
+++ b/classes/sota_m3ulcb.bbclass
@@ -6,3 +6,6 @@ IMAGE_BOOT_FILES_sota += "m3ulcb-ota-bootfiles/*"
6 6
7OSTREE_BOOTLOADER ?= "u-boot" 7OSTREE_BOOTLOADER ?= "u-boot"
8UBOOT_MACHINE_sota = "m3ulcb_defconfig" 8UBOOT_MACHINE_sota = "m3ulcb_defconfig"
9
10PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman"
11IMAGE_INSTALL_append_sota = " virtual/network-configuration "
diff --git a/classes/sota_minnowboard.bbclass b/classes/sota_minnowboard.bbclass
index 63510e3..a907217 100644
--- a/classes/sota_minnowboard.bbclass
+++ b/classes/sota_minnowboard.bbclass
@@ -6,5 +6,7 @@ IMAGE_BOOT_FILES_sota = ""
6 6
7IMAGE_FSTYPES_remove_sota = "live hddimg" 7IMAGE_FSTYPES_remove_sota = "live hddimg"
8OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 console=ttyS0,115200 console=tty0" 8OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 console=ttyS0,115200 console=tty0"
9
10IMAGE_INSTALL_append = " minnowboard-efi-startup" 9IMAGE_INSTALL_append = " minnowboard-efi-startup"
10
11PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman"
12IMAGE_INSTALL_append_sota = " virtual/network-configuration "
diff --git a/classes/sota_porter.bbclass b/classes/sota_porter.bbclass
index 75ae579..80062e1 100644
--- a/classes/sota_porter.bbclass
+++ b/classes/sota_porter.bbclass
@@ -7,3 +7,5 @@ IMAGE_BOOT_FILES_sota += "porter-bootfiles/*"
7OSTREE_BOOTLOADER ?= "u-boot" 7OSTREE_BOOTLOADER ?= "u-boot"
8UBOOT_MACHINE_sota = "porter_config" 8UBOOT_MACHINE_sota = "porter_config"
9 9
10PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman"
11IMAGE_INSTALL_append_sota = " virtual/network-configuration "
diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass
index 0850af6..fc4aa7c 100644
--- a/classes/sota_qemux86-64.bbclass
+++ b/classes/sota_qemux86-64.bbclass
@@ -12,3 +12,5 @@ IMAGE_ROOTFS_EXTRA_SPACE = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '655
12 12
13# fix for u-boot/swig build issue 13# fix for u-boot/swig build issue
14HOSTTOOLS_NONFATAL += "x86_64-linux-gnu-gcc" 14HOSTTOOLS_NONFATAL += "x86_64-linux-gnu-gcc"
15
16IMAGE_INSTALL_append_sota = " virtual/network-configuration "
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass
index e1c0054..3add247 100644
--- a/classes/sota_raspberrypi.bbclass
+++ b/classes/sota_raspberrypi.bbclass
@@ -12,6 +12,9 @@ UBOOT_DTBO_LOADADDRESS = "0x06000000"
12# Deploy config fragment list to OSTree root fs 12# Deploy config fragment list to OSTree root fs
13IMAGE_INSTALL_append = " fit-conf" 13IMAGE_INSTALL_append = " fit-conf"
14 14
15DEV_MATCH_DIRECTIVE_pn-networkd-dhcp-conf = "Driver=smsc95xx lan78xx"
16IMAGE_INSTALL_append_sota = " virtual/network-configuration "
17
15PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" 18PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot"
16UBOOT_ENTRYPOINT_sota ?= "0x00008000" 19UBOOT_ENTRYPOINT_sota ?= "0x00008000"
17 20
@@ -34,4 +37,3 @@ SOTA_DT_OVERLAYS_raspberrypi3 ?= "vc4-kms-v3d.dtbo rpi-ft5406.dtbo"
34OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=614 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 " 37OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=614 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 "
35 38
36SOTA_CLIENT_FEATURES_append = " ubootenv" 39SOTA_CLIENT_FEATURES_append = " ubootenv"
37
diff --git a/conf/distro/poky-sota-systemd.conf b/conf/distro/poky-sota-systemd.conf
index 7d008a9..b30b322 100644
--- a/conf/distro/poky-sota-systemd.conf
+++ b/conf/distro/poky-sota-systemd.conf
@@ -9,5 +9,4 @@ DISTRO_CODENAME = "sota"
9 9
10DISTRO_FEATURES_append = " systemd" 10DISTRO_FEATURES_append = " systemd"
11VIRTUAL-RUNTIME_init_manager = "systemd" 11VIRTUAL-RUNTIME_init_manager = "systemd"
12 12PREFERRED_RPROVIDER_virtual/network-configuration ??= "networkd-dhcp-conf"
13IMAGE_INSTALL_append = " connman connman-client"
diff --git a/conf/distro/poky-sota.conf b/conf/distro/poky-sota.conf
index 2bbc62b..3fb1d20 100644
--- a/conf/distro/poky-sota.conf
+++ b/conf/distro/poky-sota.conf
@@ -5,5 +5,3 @@ DISTRO = "poky-sota"
5DISTRO_NAME = "OTA-enabled Linux" 5DISTRO_NAME = "OTA-enabled Linux"
6DISTRO_VERSION = "1.0" 6DISTRO_VERSION = "1.0"
7DISTRO_CODENAME = "sota" 7DISTRO_CODENAME = "sota"
8
9IMAGE_INSTALL_append = " connman connman-client"
diff --git a/recipes-connectivity/connman/connman_%.bbappend b/recipes-connectivity/connman/connman_%.bbappend
new file mode 100644
index 0000000..b3633cc
--- /dev/null
+++ b/recipes-connectivity/connman/connman_%.bbappend
@@ -0,0 +1 @@
RPROVIDES_${PN} += "virtual/network-configuration"
diff --git a/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network
new file mode 100644
index 0000000..edb3678
--- /dev/null
+++ b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network
@@ -0,0 +1,5 @@
1[Match]
2@MATCH_DIRECTIVE@
3
4[Network]
5DHCP=yes
diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb
new file mode 100644
index 0000000..1a515a2
--- /dev/null
+++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb
@@ -0,0 +1,28 @@
1SUMMARY = "systemd-networkd config to setup wired interface with dhcp"
2DESCRIPTION = "Provides automatic dhcp network configuration for wired \
3interfaces through systemd-networkd"
4LICENSE = "MPL-2.0"
5LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
6
7inherit systemd
8
9RPROVIDES_${PN} = "virtual/network-configuration"
10
11SRC_URI_append = " file://20-wired-dhcp.network"
12PR = "r1"
13
14RDEPENDS_${PN} = "systemd"
15
16S = "${WORKDIR}"
17
18PACKAGE_ARCH = "${MACHINE_ARCH}"
19
20FILES_${PN} = "${systemd_unitdir}/network/*"
21
22DEV_MATCH_DIRECTIVE ?= "Name=en*"
23
24do_install() {
25 install -d ${D}/${systemd_unitdir}/network
26 install -m 0644 ${WORKDIR}/20-wired-dhcp.network ${D}/${systemd_unitdir}/network
27 sed -i -e 's|@MATCH_DIRECTIVE@|${DEV_MATCH_DIRECTIVE}|g' ${D}${systemd_unitdir}/network/20-wired-dhcp.network
28}
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index a69bd4d..0354fa0 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -5,8 +5,6 @@ SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7 7
8require garage-sign-version.inc
9
10DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native" 8DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native"
11RDEPENDS_${PN}_class-target = "aktualizr-check-discovery aktualizr-configs lshw" 9RDEPENDS_${PN}_class-target = "aktualizr-check-discovery aktualizr-configs lshw"
12RDEPENDS_${PN}-secondary = "aktualizr-check-discovery" 10RDEPENDS_${PN}-secondary = "aktualizr-check-discovery"
@@ -15,16 +13,22 @@ RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${
15PV = "1.0+git${SRCPV}" 13PV = "1.0+git${SRCPV}"
16PR = "7" 14PR = "7"
17 15
16GARAGE_SIGN_PV = "0.6.0-3-gc38b9f3"
17
18SRC_URI = " \ 18SRC_URI = " \
19 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ 19 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
20 file://aktualizr.service \ 20 file://aktualizr.service \
21 file://aktualizr-secondary.service \ 21 file://aktualizr-secondary.service \
22 file://aktualizr-secondary.socket \ 22 file://aktualizr-secondary.socket \
23 file://aktualizr-serialcan.service \ 23 file://aktualizr-serialcan.service \
24 ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \
24 " 25 "
25 26
27# for garage-sign archive
28SRC_URI[md5sum] = "30d7f0931e2236954679e75d1bae174f"
29SRC_URI[sha256sum] = "46d8c6448ce14cbb9af6a93eba7e29d38579e566dcd6518d22f723a8da16cad5"
26 30
27SRCREV = "c71ec0a320d85a3e75ba37bff7dc40ad02e9d655" 31SRCREV = "ea03a5cf57def6b8d368f783cb12b91255365a80"
28BRANCH ?= "master" 32BRANCH ?= "master"
29 33
30S = "${WORKDIR}/git" 34S = "${WORKDIR}/git"
@@ -37,9 +41,7 @@ SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket"
37 41
38EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV}" 42EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV}"
39 43
40GARAGE_SIGN_OPS = "${@ '-DGARAGE_SIGN_VERSION=%s' % d.getVar('GARAGE_SIGN_VERSION') if d.getVar('GARAGE_SIGN_VERSION') is not None else ''} \ 44GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}"
41 ${@ '-DGARAGE_SIGN_SHA256=%s' % d.getVar('GARAGE_SIGN_SHA256') if d.getVar('GARAGE_SIGN_SHA256') is not None else ''} \
42 "
43 45
44PACKAGECONFIG ?= "ostree ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}" 46PACKAGECONFIG ?= "ostree ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}"
45PACKAGECONFIG_class-native = "sota-tools" 47PACKAGECONFIG_class-native = "sota-tools"
diff --git a/recipes-sota/aktualizr/garage-sign-version.inc b/recipes-sota/aktualizr/garage-sign-version.inc
deleted file mode 100644
index 2cea6c9..0000000
--- a/recipes-sota/aktualizr/garage-sign-version.inc
+++ /dev/null
@@ -1,36 +0,0 @@
1
2python () {
3 if d.getVar("GARAGE_SIGN_VERSION") or not d.getVar("SOTA_PACKED_CREDENTIALS"):
4 return
5 import json
6 import urllib.request
7 import zipfile
8 with zipfile.ZipFile(d.getVar("SOTA_PACKED_CREDENTIALS"), 'r') as zip_ref:
9 try:
10 with zip_ref.open('tufrepo.url', mode='r') as url_file:
11 url = url_file.read().decode().strip(' \t\n') + '/health/version'
12 except (KeyError, ValueError, RuntimeError):
13 return
14 connected = False
15 tries = 3
16 for i in range(tries):
17 try:
18 r = urllib.request.urlopen(url)
19 if r.code == 200:
20 connected = True
21 break
22 else:
23 print('Bad return code from server ' + url + ': ' + str(r.code) +
24 ' (attempt ' + str(i + 1) + ' of ' + str(tries) + ')')
25 except urllib.error.URLError as e:
26 print('Error connecting to server ' + url + ': ' + str(e) +
27 ' (attempt ' + str(i + 1) + ' of ' + str(tries) + ')')
28 if not connected:
29 return
30 resp = r.read().decode('utf-8')
31 j = json.loads(resp)
32 version = 'cli-' + j['version'] + '.tgz'
33 d.setVar("GARAGE_SIGN_VERSION", version)
34}
35
36# vim:set ts=4 sw=4 sts=4 expandtab:
diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb
index 1a41169..61df85b 100644
--- a/recipes-test/images/secondary-image.bb
+++ b/recipes-test/images/secondary-image.bb
@@ -15,8 +15,7 @@ IMAGE_INSTALL_remove = " \
15 aktualizr-ca-implicit-prov-creds \ 15 aktualizr-ca-implicit-prov-creds \
16 aktualizr-hsm-prov \ 16 aktualizr-hsm-prov \
17 aktualizr-uboot-env-rollback \ 17 aktualizr-uboot-env-rollback \
18 connman \ 18 virtual/network-configuration \
19 connman-client \
20 " 19 "
21 20
22IMAGE_INSTALL_append = " \ 21IMAGE_INSTALL_append = " \