summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.adoc1
-rw-r--r--README.adoc36
-rw-r--r--classes/image_types_ostree.bbclass2
-rw-r--r--classes/image_types_ota.bbclass2
-rw-r--r--classes/sota.bbclass13
-rw-r--r--classes/sota_freedom-u540.bbclass12
-rw-r--r--conf/include/bblayers/sota_freedom-u540.inc2
-rw-r--r--conf/local.conf.sample.append2
-rw-r--r--lib/oeqa/selftest/cases/testutils.py19
-rw-r--r--lib/oeqa/selftest/cases/updater_qemux86_64.py4
-rw-r--r--recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service11
-rw-r--r--recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean14
-rw-r--r--recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb22
-rw-r--r--recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb19
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb10
-rw-r--r--scripts/qemucommand.py20
16 files changed, 146 insertions, 43 deletions
diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc
index 0b40438..d7dc1fa 100644
--- a/CONTRIBUTING.adoc
+++ b/CONTRIBUTING.adoc
@@ -2,6 +2,7 @@
2 2
3We welcome pull requests from anyone. The master branch is the primary branch for development, and if you wish to add new functionality, it probably belongs there. We attempt to maintain recent previous branches and welcome bug fixes and backports for those. Currently, the actively maintained branches are: 3We welcome pull requests from anyone. The master branch is the primary branch for development, and if you wish to add new functionality, it probably belongs there. We attempt to maintain recent previous branches and welcome bug fixes and backports for those. Currently, the actively maintained branches are:
4 4
5* warrior
5* thud 6* thud
6* sumo 7* sumo
7* rocko 8* rocko
diff --git a/README.adoc b/README.adoc
index b047f91..dd07425 100644
--- a/README.adoc
+++ b/README.adoc
@@ -61,7 +61,7 @@ and get as a result an `ostree_repo` folder in your images directory (`tmp/deplo
61 61
62* your OSTree repository, with the rootfs committed as an OSTree deployment, 62* your OSTree repository, with the rootfs committed as an OSTree deployment,
63* an `ota-ext4` bootstrap image, which is an OSTree physical sysroot as a burnable filesystem image, and optionally 63* an `ota-ext4` bootstrap image, which is an OSTree physical sysroot as a burnable filesystem image, and optionally
64* some machine-dependent live images (e.g. `.wic` for Raspberry Pi or `.porter-sdimg-ota` Renesas Porter board). 64* some machine-dependent live images (e.g. `.wic` for Raspberry Pi or `.porter-sdimg-ota` for Renesas Porter board).
65 65
66Although `aglsetup.sh` hooks provide reasonable defaults for SOTA-related variables, you may want to tune some of them. 66Although `aglsetup.sh` hooks provide reasonable defaults for SOTA-related variables, you may want to tune some of them.
67 67
@@ -71,11 +71,18 @@ Ubuntu users that encounter an error due to missing `Python.h` should install `l
71 71
72== Supported boards 72== Supported boards
73 73
74Currently supported platforms are 74Currently supported platforms are:
75 75
76* https://github.com/advancedtelematic/meta-updater-raspberrypi[Raspberry Pi3] 76* https://github.com/advancedtelematic/meta-updater-raspberrypi[Raspberry Pi 2 and 3]
77* https://github.com/advancedtelematic/meta-updater-minnowboard[Minnowboard] 77* https://github.com/advancedtelematic/meta-updater-minnowboard[Intel Minnowboard]
78* https://github.com/advancedtelematic/meta-updater-qemux86-64[Native QEMU emulation] 78* https://github.com/advancedtelematic/meta-updater-qemux86-64[Native QEMU emulation]
79* Renesas R-Car H3 and M3
80* https://github.com/advancedtelematic/meta-updater-ti/[TI BeagleBone Black] (rocko only, using TI SDK 05.03)
81* https://github.com/advancedtelematic/meta-updater-ti/[TI AM65x industrial development kit] (rocko only, using TI SDK 05.03)
82
83Additionally, there is community support for https://github.com/ricardosalveti/meta-updater-riscv[RISC-V] boards, in particular the Freedom U540.
84
85We also historically supported the https://github.com/advancedtelematic/meta-updater-porter[Renesas Porter] board.
79 86
80=== Adding support for your board 87=== Adding support for your board
81 88
@@ -92,6 +99,7 @@ Your images will also need network connectivity to be able to reach an actual OT
92 99
93== SOTA-related variables in local.conf 100== SOTA-related variables in local.conf
94 101
102* `OSTREE_BRANCHNAME` - OSTree branch name. Defaults to `${SOTA_HARDWARE_ID}`. Particularly useful for grouping similar images.
95* `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo` 103* `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo`
96* `OSTREE_OSNAME` - OS deployment name on your target device. For more information about deployments and osnames see the https://ostree.readthedocs.io/en/latest/manual/deployment/[OSTree documentation]. Defaults to "poky". 104* `OSTREE_OSNAME` - OS deployment name on your target device. For more information about deployments and osnames see the https://ostree.readthedocs.io/en/latest/manual/deployment/[OSTree documentation]. Defaults to "poky".
97* `OSTREE_COMMIT_BODY` - Message attached to OSTree commit. Empty by default. 105* `OSTREE_COMMIT_BODY` - Message attached to OSTree commit. Empty by default.
@@ -110,7 +118,7 @@ Your images will also need network connectivity to be able to reach an actual OT
110* `SOTA_DT_OVERLAYS` - whitespace-separated list of used device tree overlays for FIT image. This list is OSTree-updateable as well. 118* `SOTA_DT_OVERLAYS` - whitespace-separated list of used device tree overlays for FIT image. This list is OSTree-updateable as well.
111* `SOTA_EXTRA_CONF_FRAGS` - extra https://lxr.missinglinkelectronics.com/uboot/doc/uImage.FIT/overlay-fdt-boot.txt[configuration fragments] for FIT image. 119* `SOTA_EXTRA_CONF_FRAGS` - extra https://lxr.missinglinkelectronics.com/uboot/doc/uImage.FIT/overlay-fdt-boot.txt[configuration fragments] for FIT image.
112* `RESOURCE_xxx_pn-aktualizr` - controls maximum resource usage of the aktualizr service, when `aktualizr-resource-control` is installed on the image. See <<aktualizr service resource control>> for details. 120* `RESOURCE_xxx_pn-aktualizr` - controls maximum resource usage of the aktualizr service, when `aktualizr-resource-control` is installed on the image. See <<aktualizr service resource control>> for details.
113* `SOTA_POLLING_SEC` - sets polling interval for aktualizr to check for updates if aktualizr-polling-sec is included in the image. 121* `SOTA_POLLING_SEC` - sets polling interval for aktualizr to check for updates if aktualizr-polling-interval is included in the image.
114 122
115== Usage 123== Usage
116 124
@@ -191,7 +199,23 @@ RESOURCE_CPU_WEIGHT_pn-aktualizr = "50"
191 199
192== Development configuration 200== Development configuration
193 201
194There are a few settings that can be controlled in `local.conf` to simplify the development process: 202=== Logging
203
204To troubleshoot problems that you might encounter during development, we recommend that you enable persistent `systemd` logging. This setting is enabled by default for newly configured environments (see link:conf/local.conf.sample.append[]). To enable it manually, put this to your `local.conf`:
205
206....
207IMAGE_INSTALL_append += " systemd-journald-persistent"
208....
209
210It may also be helpful to run with debug logging enabled in aktualizr. To do so, add this to your `local.conf`:
211
212....
213IMAGE_INSTALL_append += " aktualizr-log-debug"
214....
215
216=== Custom aktualizr versions
217
218You can override the version of aktualizr included in your image. This requires that the version you wish to run is pushed to the https://github.com/advancedtelematic/aktualizr[aktualizr github repo]. You can then use these settings in your `local.conf` to simplify the development process:
195 219
196[options="header"] 220[options="header"]
197|====================== 221|======================
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index a9a8174..2e8e8f5 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -7,8 +7,6 @@ OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}"
7OSTREE_COMMIT_BODY ??= "" 7OSTREE_COMMIT_BODY ??= ""
8OSTREE_UPDATE_SUMMARY ??= "0" 8OSTREE_UPDATE_SUMMARY ??= "0"
9OSTREE_DEPLOY_DEVICETREE ??= "0" 9OSTREE_DEPLOY_DEVICETREE ??= "0"
10OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
11GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}"
12 10
13BUILD_OSTREE_TARBALL ??= "1" 11BUILD_OSTREE_TARBALL ??= "1"
14 12
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 12375ec..31e3887 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -45,6 +45,8 @@ do_image_ota[cleandirs] = "${OTA_SYSROOT}"
45do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \ 45do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \
46 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}" 46 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}"
47IMAGE_CMD_ota () { 47IMAGE_CMD_ota () {
48 export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION}
49
48 ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT} 50 ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT}
49 ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME} 51 ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME}
50 mkdir -p ${OTA_SYSROOT}/boot/loader.0 52 mkdir -p ${OTA_SYSROOT}/boot/loader.0
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 1a9d68b..86863d9 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -38,15 +38,17 @@ EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native
38INITRAMFS_FSTYPES ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER') == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}" 38INITRAMFS_FSTYPES ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER') == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}"
39 39
40# Please redefine OSTREE_REPO in order to have a persistent OSTree repo 40# Please redefine OSTREE_REPO in order to have a persistent OSTree repo
41export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 41OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
42export OSTREE_OSNAME ?= "poky" 42OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
43export OSTREE_BOOTLOADER ??= 'u-boot' 43OSTREE_OSNAME ?= "poky"
44export OSTREE_BOOT_PARTITION ??= "/boot" 44OSTREE_BOOTLOADER ??= 'u-boot'
45OSTREE_BOOT_PARTITION ??= "/boot"
45 46
46INITRAMFS_IMAGE ?= "initramfs-ostree-image" 47INITRAMFS_IMAGE ?= "initramfs-ostree-image"
47 48
48GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" 49GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo"
49GARAGE_SIGN_KEYNAME ?= "garage-key" 50GARAGE_SIGN_KEYNAME ?= "garage-key"
51GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}"
50GARAGE_TARGET_VERSION ?= "" 52GARAGE_TARGET_VERSION ?= ""
51GARAGE_TARGET_URL ?= "" 53GARAGE_TARGET_URL ?= ""
52GARAGE_CUSTOMIZE_TARGET ?= "" 54GARAGE_CUSTOMIZE_TARGET ?= ""
@@ -58,8 +60,9 @@ SOTA_MACHINE_m3ulcb = "m3ulcb"
58SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" 60SOTA_MACHINE_intel-corei7-64 ?= "minnowboard"
59SOTA_MACHINE_qemux86-64 ?= "qemux86-64" 61SOTA_MACHINE_qemux86-64 ?= "qemux86-64"
60SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi" 62SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi"
63SOTA_MACHINE_freedom-u540 ?= "freedom-u540"
61 64
62SOTA_OVERRIDES_BLACKLIST = "ostree ota" 65SOTA_OVERRIDES_BLACKLIST = "ostree ota"
63SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO" 66SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME"
64 67
65inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest 68inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest
diff --git a/classes/sota_freedom-u540.bbclass b/classes/sota_freedom-u540.bbclass
new file mode 100644
index 0000000..c287154
--- /dev/null
+++ b/classes/sota_freedom-u540.bbclass
@@ -0,0 +1,12 @@
1OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE}"
2
3OSTREE_BOOTLOADER ?= "u-boot"
4INITRAMFS_FSTYPES = "cpio.gz"
5PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot"
6
7IMAGE_BOOT_FILES += "uEnv.txt"
8IMAGE_BOOT_FILES_remove = "fitImage"
9
10OSTREE_KERNEL_ARGS_sota ?= "earlycon=sbi console=ttySIF0 ramdisk_size=16384 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/mmcblk0p3"
11
12WKS_FILE_sota = "freedom-u540-opensbi-sota.wks"
diff --git a/conf/include/bblayers/sota_freedom-u540.inc b/conf/include/bblayers/sota_freedom-u540.inc
new file mode 100644
index 0000000..977f96b
--- /dev/null
+++ b/conf/include/bblayers/sota_freedom-u540.inc
@@ -0,0 +1,2 @@
1BBLAYERS += "${METADIR}/meta-riscv"
2BBLAYERS += "${METADIR}/meta-updater-riscv"
diff --git a/conf/local.conf.sample.append b/conf/local.conf.sample.append
index 4588ec3..fc565f8 100644
--- a/conf/local.conf.sample.append
+++ b/conf/local.conf.sample.append
@@ -8,7 +8,7 @@ MACHINE = "##MACHINE##"
8DISTRO = "poky-sota-systemd" 8DISTRO = "poky-sota-systemd"
9 9
10# General SOTA setup 10# General SOTA setup
11#SOTA_CLIENT_PROV = "aktualizr-auto-prov" 11#SOTA_CLIENT_PROV = "aktualizr-shared-prov"
12#SOTA_PACKED_CREDENTIALS = "/path/to/credentials.zip" 12#SOTA_PACKED_CREDENTIALS = "/path/to/credentials.zip"
13 13
14# Uncomment this line to start an ssh server at boot automatically 14# Uncomment this line to start an ssh server at boot automatically
diff --git a/lib/oeqa/selftest/cases/testutils.py b/lib/oeqa/selftest/cases/testutils.py
index 8d618a6..802d665 100644
--- a/lib/oeqa/selftest/cases/testutils.py
+++ b/lib/oeqa/selftest/cases/testutils.py
@@ -119,20 +119,29 @@ def verifyNotProvisioned(testInst, machine):
119 'Device already provisioned!? ' + stderr.decode() + stdout.decode()) 119 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
120 120
121 121
122def verifyProvisioned(testInst, machine): 122def verifyProvisioned(testInst, machine, hwid=''):
123 # Verify that device HAS provisioned. 123 # Verify that device HAS provisioned.
124 # First loop while waiting for the device to boot.
124 ran_ok = False 125 ran_ok = False
125 for delay in [5, 5, 5, 5, 10, 10, 10, 10]: 126 for delay in [5, 5, 5, 5, 10, 10, 10, 10]:
126 stdout, stderr, retcode = testInst.qemu_command('aktualizr-info') 127 stdout, stderr, retcode = testInst.qemu_command('aktualizr-info')
127 if retcode == 0 and stderr == b'' and stdout.decode().find('Fetched metadata: yes') >= 0: 128 if retcode == 0 and stderr == b'':
128 ran_ok = True 129 ran_ok = True
129 break 130 break
130 sleep(delay) 131 sleep(delay)
131 testInst.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) 132 testInst.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode())
132 133 # Then wait for aktualizr to provision.
134 if stdout.decode().find('Fetched metadata: yes') < 0:
135 stdout, stderr, retcode = testInst.qemu_command('aktualizr-info --wait-until-provisioned')
136 testInst.assertFalse(retcode, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode())
137 testInst.assertEqual(stderr, b'', 'aktualizr-info failed: ' + stderr.decode() + stdout.decode())
133 testInst.assertIn(b'Device ID: ', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode()) 138 testInst.assertIn(b'Device ID: ', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode())
134 testInst.assertIn(b'Primary ecu hardware ID: ' + machine.encode(), stdout, 139 if hwid == '':
135 'Provisioning failed: ' + stderr.decode() + stdout.decode()) 140 testInst.assertIn(b'Primary ecu hardware ID: ' + machine.encode(), stdout,
141 'Provisioning failed: ' + stderr.decode() + stdout.decode())
142 else:
143 testInst.assertIn(b'Primary ecu hardware ID: ' + hwid.encode(), stdout,
144 'Provisioning failed: ' + stderr.decode() + stdout.decode())
136 testInst.assertIn(b'Fetched metadata: yes', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode()) 145 testInst.assertIn(b'Fetched metadata: yes', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode())
137 p = re.compile(r'Device ID: ([a-z0-9-]*)\n') 146 p = re.compile(r'Device ID: ([a-z0-9-]*)\n')
138 m = p.search(stdout.decode()) 147 m = p.search(stdout.decode())
diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py
index c65d6e9..24abcff 100644
--- a/lib/oeqa/selftest/cases/updater_qemux86_64.py
+++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py
@@ -85,6 +85,7 @@ class SharedCredProvTests(OESelftestTestCase):
85 self.append_config('MACHINE = "qemux86-64"') 85 self.append_config('MACHINE = "qemux86-64"')
86 self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "') 86 self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "')
87 self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"') 87 self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"')
88 self.append_config('SOTA_HARDWARE_ID = "plain_reibekuchen_314"')
88 self.qemu, self.s = qemu_launch(machine='qemux86-64') 89 self.qemu, self.s = qemu_launch(machine='qemux86-64')
89 90
90 def tearDownLocal(self): 91 def tearDownLocal(self):
@@ -107,7 +108,8 @@ class SharedCredProvTests(OESelftestTestCase):
107 self.assertEqual(value, machine, 108 self.assertEqual(value, machine,
108 'MACHINE does not match hostname: ' + machine + ', ' + value) 109 'MACHINE does not match hostname: ' + machine + ', ' + value)
109 110
110 verifyProvisioned(self, machine) 111 hwid = get_bb_var('SOTA_HARDWARE_ID')
112 verifyProvisioned(self, machine, hwid)
111 113
112 114
113class ManualControlTests(OESelftestTestCase): 115class ManualControlTests(OESelftestTestCase):
diff --git a/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service b/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service
new file mode 100644
index 0000000..8af8263
--- /dev/null
+++ b/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=Clean up bogus symlinked resolv.conf
3Before=network-pre.target
4Wants=network-pre.target
5
6[Service]
7Type=oneshot
8ExecStart=/usr/sbin/resolvconf-clean
9
10[Install]
11WantedBy=multi-user.target
diff --git a/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean b/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean
new file mode 100644
index 0000000..89c7e90
--- /dev/null
+++ b/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean
@@ -0,0 +1,14 @@
1#!/bin/sh
2
3set -e
4
5if [ ! -L /etc/resolv.conf ]; then
6 exit 0
7fi
8
9# 'readlink -f' will fail if the symlink doesn't resolve to an existing path
10if readlink /etc/resolv.conf | grep -q connman; then
11 echo "Replacing resolv.conf symlink: $(readlink /etc/resolv.conf) to /etc/resolv-conf.systemd"
12 rm /etc/resolv.conf
13 ln -s /etc/resolv-conf.systemd /etc/resolv.conf
14fi
diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb
index 0700ac6..b6076cd 100644
--- a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb
+++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb
@@ -8,21 +8,37 @@ inherit allarch systemd
8 8
9RPROVIDES_${PN} = "virtual/network-configuration" 9RPROVIDES_${PN} = "virtual/network-configuration"
10 10
11SRC_URI_append = " file://20-wired-dhcp.network" 11SRC_URI = " \
12 file://20-wired-dhcp.network \
13 file://resolvconf-clean \
14 file://clean-connman-symlink.service \
15 "
12PR = "r1" 16PR = "r1"
13 17
14RDEPENDS_${PN} = "systemd" 18RDEPENDS_${PN} = "systemd"
19RCONFLICTS_${PN} = "connman"
15 20
16S = "${WORKDIR}" 21S = "${WORKDIR}"
17 22
18PACKAGE_ARCH = "${MACHINE_ARCH}" 23PACKAGE_ARCH = "${MACHINE_ARCH}"
19 24
20FILES_${PN} = "${systemd_unitdir}/network/*" 25FILES_${PN} = " \
26 ${systemd_unitdir}/network/* \
27 ${sbindir}/resolvconf-clean \
28 ${systemd_unitdir}/system/clean-connman-symlink.service \
29 "
30
31SYSTEMD_SERVICE_${PN} = "clean-connman-symlink.service"
21 32
22DEV_MATCH_DIRECTIVE ?= "Name=en*" 33DEV_MATCH_DIRECTIVE ?= "Name=en*"
23 34
24do_install() { 35do_install() {
25 install -d ${D}/${systemd_unitdir}/network 36 install -d ${D}/${systemd_unitdir}/network
26 install -m 0644 ${WORKDIR}/20-wired-dhcp.network ${D}/${systemd_unitdir}/network 37 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 38 sed -i -e 's|@MATCH_DIRECTIVE@|${DEV_MATCH_DIRECTIVE}|g' ${D}${systemd_unitdir}/network/20-wired-dhcp.network
39
40 install -d ${D}${sbindir}
41 install -m 0755 ${WORKDIR}/resolvconf-clean ${D}${sbindir}/resolvconf-clean
42 install -d ${D}${systemd_unitdir}/system
43 install -m 0644 ${WORKDIR}/clean-connman-symlink.service ${D}${systemd_unitdir}/system/clean-connman-symlink.service
28} 44}
diff --git a/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb b/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb
index dbb5fde..2701c07 100644
--- a/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb
+++ b/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb
@@ -14,14 +14,17 @@ require credentials.inc
14do_install() { 14do_install() {
15 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then 15 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
16 install -m 0700 -d ${D}${localstatedir}/sota 16 install -m 0700 -d ${D}${localstatedir}/sota
17 cp "${SOTA_PACKED_CREDENTIALS}" ${D}${localstatedir}/sota/sota_provisioning_credentials.zip 17 # root.json contains the root metadata for bootstrapping the Uptane metadata verification process.
18 # Device should not be able to push data to treehub 18 # autoprov.url has the URL to the device gateway on the server, which is where we send most of our requests.
19 zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip treehub.json 19 # autoprov_credentials.p12 contains the shared provisioning credentials.
20 # Device has no use for the API Gateway. Remove if present. See: 20 for var in root.json autoprov.url autoprov_credentials.p12; do
21 # https://github.com/advancedtelematic/ota-plus-server/pull/1913/ 21 if unzip -l "${SOTA_PACKED_CREDENTIALS}" $var > /dev/null; then
22 if unzip -l ${D}${localstatedir}/sota/sota_provisioning_credentials.zip api_gateway.url > /dev/null; then 22 unzip "${SOTA_PACKED_CREDENTIALS}" $var -d ${T}
23 zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip api_gateway.url 23 zip -mj -q ${D}${localstatedir}/sota/sota_provisioning_credentials.zip ${T}/$var
24 fi 24 else
25 bbwarn "$var is missing from credentials.zip"
26 fi
27 done
25 fi 28 fi
26} 29}
27 30
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index e9efa35..69fc1e9 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -10,12 +10,12 @@ DEPENDS_append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' coreutils-native
10RDEPENDS_${PN}_class-target = "aktualizr-configs lshw" 10RDEPENDS_${PN}_class-target = "aktualizr-configs lshw"
11RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}" 11RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}"
12 12
13RDEPENDS_${PN}-ptest += "bash cmake curl net-tools python3-misc python3-modules openssl-bin sqlite3 valgrind" 13RDEPENDS_${PN}-ptest += "bash cmake curl net-tools python3-core python3-misc python3-modules openssl-bin sqlite3 valgrind"
14 14
15PV = "1.0+git${SRCPV}" 15PV = "1.0+git${SRCPV}"
16PR = "7" 16PR = "7"
17 17
18GARAGE_SIGN_PV = "0.7.0-3-gf5ba640" 18GARAGE_SIGN_PV = "0.7.0-19-g89ec974"
19 19
20SRC_URI = " \ 20SRC_URI = " \
21 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ 21 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
@@ -28,10 +28,10 @@ SRC_URI = " \
28 " 28 "
29 29
30# for garage-sign archive 30# for garage-sign archive
31SRC_URI[md5sum] = "e104ccd4f32e52571a5fc0e5042db050" 31SRC_URI[md5sum] = "3ed27c1142860cd9b4a2594067312b8b"
32SRC_URI[sha256sum] = "c590be1a57523bfe097af82279eda5c97cf40ae47fb27162cf33c469702c8a9b" 32SRC_URI[sha256sum] = "e54eef3863118f373c3ebd9e2877f9de5bab4950ed157a15fb4f4ec575bc2ece"
33 33
34SRCREV = "17c3713fb3085fe5459ac0e8244a2047d55cb7ec" 34SRCREV = "03778511cc937d07bf53a8092f8b268e65f5d9a6"
35BRANCH ?= "master" 35BRANCH ?= "master"
36 36
37S = "${WORKDIR}/git" 37S = "${WORKDIR}/git"
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py
index 3045b45..a869d4d 100644
--- a/scripts/qemucommand.py
+++ b/scripts/qemucommand.py
@@ -1,4 +1,4 @@
1from os.path import exists, join, realpath, abspath 1from os.path import exists, isdir, join, realpath, abspath
2from os import listdir 2from os import listdir
3import random 3import random
4import socket 4import socket
@@ -42,6 +42,8 @@ class QemuCommand(object):
42 if args.machine: 42 if args.machine:
43 self.machine = args.machine 43 self.machine = args.machine
44 else: 44 else:
45 if not isdir(args.dir):
46 raise ValueError("Directory %s does not exist, please specify a --machine or a valid images directory" % args.dir)
45 machines = listdir(args.dir) 47 machines = listdir(args.dir)
46 if len(machines) == 1: 48 if len(machines) == 1:
47 self.machine = machines[0] 49 self.machine = machines[0]
@@ -100,12 +102,8 @@ class QemuCommand(object):
100 cmdline += [ 102 cmdline += [
101 "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, 103 "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port,
102 "-m", self.mem, 104 "-m", self.mem,
103 "-usb",
104 "-object", "rng-random,id=rng0,filename=/dev/urandom", 105 "-object", "rng-random,id=rng0,filename=/dev/urandom",
105 "-device", "virtio-rng-pci,rng=rng0", 106 "-device", "virtio-rng-pci,rng=rng0",
106 "-device", "usb-tablet",
107 "-show-cursor",
108 "-vga", "std",
109 "-net", netuser, 107 "-net", netuser,
110 "-net", "nic,macaddr=%s" % self.mac_address 108 "-net", "nic,macaddr=%s" % self.mac_address
111 ] 109 ]
@@ -117,9 +115,17 @@ class QemuCommand(object):
117 '-device', 'e1000,netdev=vlan1,mac='+random_mac(), 115 '-device', 'e1000,netdev=vlan1,mac='+random_mac(),
118 ] 116 ]
119 if self.gui: 117 if self.gui:
120 cmdline += ["-serial", "stdio"] 118 cmdline += [
119 "-usb",
120 "-device", "usb-tablet",
121 "-show-cursor",
122 "-vga", "std"
123 ]
121 else: 124 else:
122 cmdline.append('-nographic') 125 cmdline += [
126 "-nographic",
127 "-monitor", "null",
128 ]
123 if self.kvm: 129 if self.kvm:
124 cmdline += ['-enable-kvm', '-cpu', 'host'] 130 cmdline += ['-enable-kvm', '-cpu', 'host']
125 else: 131 else: