diff options
-rw-r--r-- | classes/image_types_ota.bbclass | 50 | ||||
-rw-r--r-- | lib/oeqa/selftest/cases/updater.py | 9 | ||||
-rwxr-xr-x | recipes-sota/aktualizr/aktualizr_git.bb | 5 | ||||
-rw-r--r-- | recipes-sota/config/aktualizr-example-interface.bb | 21 | ||||
-rw-r--r-- | recipes-sota/config/files/30-example-interface.toml | 2 |
5 files changed, 17 insertions, 70 deletions
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 4380494..929d092 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
@@ -122,55 +122,35 @@ fakeroot do_otasetup () { | |||
122 | rm -rf ${HOME_TMP} | 122 | rm -rf ${HOME_TMP} |
123 | } | 123 | } |
124 | 124 | ||
125 | ## Specific image creation | 125 | IMAGE_CMD_ota-ext4 () { |
126 | create_ota () { | ||
127 | FS_TYPE=${1} | ||
128 | # Calculate image type | 126 | # Calculate image type |
129 | OTA_ROOTFS_SIZE=$(calculate_size `du -ks $OTA_SYSROOT | cut -f 1` "${IMAGE_OVERHEAD_FACTOR}" "${IMAGE_ROOTFS_SIZE}" "${IMAGE_ROOTFS_MAXSIZE}" `expr ${IMAGE_ROOTFS_EXTRA_SPACE}` "${IMAGE_ROOTFS_ALIGNMENT}") | 127 | OTA_ROOTFS_SIZE=$(calculate_size `du -ks $OTA_SYSROOT | cut -f 1` "${IMAGE_OVERHEAD_FACTOR}" "${IMAGE_ROOTFS_SIZE}" "${IMAGE_ROOTFS_MAXSIZE}" `expr ${IMAGE_ROOTFS_EXTRA_SPACE}` "${IMAGE_ROOTFS_ALIGNMENT}") |
130 | 128 | ||
131 | if [ $OTA_ROOTFS_SIZE -lt 0 ]; then | 129 | if [ $OTA_ROOTFS_SIZE -lt 0 ]; then |
132 | exit -1 | 130 | bbfatal "create_ota failed to calculate OTA rootfs size!" |
133 | fi | 131 | fi |
132 | |||
134 | eval local COUNT=\"0\" | 133 | eval local COUNT=\"0\" |
135 | eval local MIN_COUNT=\"60\" | 134 | eval local MIN_COUNT=\"60\" |
136 | if [ $OTA_ROOTFS_SIZE -lt $MIN_COUNT ]; then | 135 | if [ $OTA_ROOTFS_SIZE -lt $MIN_COUNT ]; then |
137 | eval COUNT=\"$MIN_COUNT\" | 136 | eval COUNT=\"$MIN_COUNT\" |
138 | fi | 137 | fi |
139 | 138 | ||
140 | # create image | 139 | rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg |
141 | if [ "${FS_TYPE}" = "ext4" ]; then | 140 | sync |
142 | rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg | 141 | dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg seek=${OTA_ROOTFS_SIZE} count=$COUNT bs=1024 |
143 | sync | 142 | mkfs.ext4 -O ^64bit ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg -L otaroot -d ${OTA_SYSROOT} |
144 | dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg seek=${OTA_ROOTFS_SIZE} count=$COUNT bs=1024 | 143 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg |
145 | mkfs.ext4 -O ^64bit ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg -L otaroot -d ${OTA_SYSROOT} | 144 | ln -s ${IMAGE_NAME}.otaimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg |
146 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg | ||
147 | ln -s ${IMAGE_NAME}.otaimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg | ||
148 | elif [ "${FS_TYPE}" = "tar" ]; then | ||
149 | rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg.tar | ||
150 | tar -cf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg.tar -C ${OTA_SYSROOT} . | ||
151 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar | ||
152 | ln -s ${IMAGE_NAME}.otaimg.tar ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar | ||
153 | # To fit in with the rest of yocto's image utils, we create a rootfs.ota-tar in the deploy dir | ||
154 | cp ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ota-tar | ||
155 | else | ||
156 | rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg* | ||
157 | bbfatal "create_ota Function called with unknown or unspecified FS_TYPE of ${FS_TYPE}. Failing!" | ||
158 | fi | ||
159 | } | ||
160 | |||
161 | IMAGE_CMD_ota-ext4 () { | ||
162 | |||
163 | if ${@bb.utils.contains('IMAGE_FSTYPES', 'ota-ext4', 'true', 'false', d)}; then | ||
164 | # create ext4 | ||
165 | create_ota "ext4" | ||
166 | fi | ||
167 | } | 145 | } |
168 | 146 | ||
169 | IMAGE_CMD_ota-tar () { | 147 | IMAGE_CMD_ota-tar () { |
170 | if ${@bb.utils.contains('IMAGE_FSTYPES', 'ota-tar', 'true', 'false', d)}; then | 148 | rm -rf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg.tar |
171 | # create tarball | 149 | tar -cf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.otaimg.tar -C ${OTA_SYSROOT} . |
172 | create_ota "tar" | 150 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar |
173 | fi | 151 | ln -s ${IMAGE_NAME}.otaimg.tar ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar |
152 | # To fit in with the rest of yocto's image utils, we create a rootfs.ota-tar in the deploy dir | ||
153 | cp ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.otaimg.tar ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ota-tar | ||
174 | } | 154 | } |
175 | 155 | ||
176 | do_otasetup[doc] = "Sets up the base ota rootfs used for subsequent image generation" | 156 | do_otasetup[doc] = "Sets up the base ota rootfs used for subsequent image generation" |
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py index 38bdcbf..b555d92 100644 --- a/lib/oeqa/selftest/cases/updater.py +++ b/lib/oeqa/selftest/cases/updater.py | |||
@@ -150,8 +150,6 @@ class AutoProvTests(OESelftestTestCase): | |||
150 | self.meta_qemu = None | 150 | self.meta_qemu = None |
151 | self.append_config('MACHINE = "qemux86-64"') | 151 | self.append_config('MACHINE = "qemux86-64"') |
152 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') | 152 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') |
153 | # Test aktualizr-example-interface package. | ||
154 | self.append_config('IMAGE_INSTALL_append = " aktualizr-examples aktualizr-example-interface "') | ||
155 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | 153 | self.qemu, self.s = qemu_launch(machine='qemux86-64') |
156 | 154 | ||
157 | def tearDownLocal(self): | 155 | def tearDownLocal(self): |
@@ -185,12 +183,6 @@ class AutoProvTests(OESelftestTestCase): | |||
185 | self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) | 183 | self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) |
186 | 184 | ||
187 | verifyProvisioned(self, machine) | 185 | verifyProvisioned(self, machine) |
188 | # Test aktualizr-example-interface package. | ||
189 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') | ||
190 | self.assertIn(b'hardware ID: example1', stdout, | ||
191 | 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode()) | ||
192 | self.assertIn(b'hardware ID: example2', stdout, | ||
193 | 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode()) | ||
194 | 186 | ||
195 | 187 | ||
196 | class ManualControlTests(OESelftestTestCase): | 188 | class ManualControlTests(OESelftestTestCase): |
@@ -562,6 +554,7 @@ class HsmTests(OESelftestTestCase): | |||
562 | 554 | ||
563 | verifyProvisioned(self, machine) | 555 | verifyProvisioned(self, machine) |
564 | 556 | ||
557 | |||
565 | class SecondaryTests(OESelftestTestCase): | 558 | class SecondaryTests(OESelftestTestCase): |
566 | @classmethod | 559 | @classmethod |
567 | def setUpClass(cls): | 560 | def setUpClass(cls): |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 29164ed..751f529 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
@@ -26,7 +26,7 @@ SRC_URI = " \ | |||
26 | file://aktualizr-secondary.socket \ | 26 | file://aktualizr-secondary.socket \ |
27 | file://aktualizr-serialcan.service \ | 27 | file://aktualizr-serialcan.service \ |
28 | " | 28 | " |
29 | SRCREV = "512ad74c0b5339ca7775d8c9461b565a9e6ff5b3" | 29 | SRCREV = "6b0114e4fad0619d16ed2063e8ff10e3fb8500f2" |
30 | BRANCH ?= "master" | 30 | BRANCH ?= "master" |
31 | 31 | ||
32 | S = "${WORKDIR}/git" | 32 | S = "${WORKDIR}/git" |
@@ -48,7 +48,6 @@ EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF \ | |||
48 | -DAKTUALIZR_VERSION=${PV} \ | 48 | -DAKTUALIZR_VERSION=${PV} \ |
49 | -DBUILD_LOAD_TESTS=OFF" | 49 | -DBUILD_LOAD_TESTS=OFF" |
50 | EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ | 50 | EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ |
51 | -DBUILD_ISOTP=ON \ | ||
52 | ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " | 51 | ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " |
53 | EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ | 52 | EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ |
54 | -DBUILD_OSTREE=OFF \ | 53 | -DBUILD_OSTREE=OFF \ |
@@ -97,8 +96,6 @@ FILES_${PN} = " \ | |||
97 | 96 | ||
98 | FILES_${PN}-examples = " \ | 97 | FILES_${PN}-examples = " \ |
99 | ${libdir}/sota/demo_secondary.json \ | 98 | ${libdir}/sota/demo_secondary.json \ |
100 | ${bindir}/example-interface \ | ||
101 | ${bindir}/isotp-test-interface \ | ||
102 | ${bindir}/hmi_stub \ | 99 | ${bindir}/hmi_stub \ |
103 | " | 100 | " |
104 | 101 | ||
diff --git a/recipes-sota/config/aktualizr-example-interface.bb b/recipes-sota/config/aktualizr-example-interface.bb deleted file mode 100644 index ac75352..0000000 --- a/recipes-sota/config/aktualizr-example-interface.bb +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | SUMMARY = "Aktualizr example interface" | ||
2 | DESCRIPTION = "Aktualizr example interface for legacy secondaries" | ||
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
4 | SECTION = "base" | ||
5 | LICENSE = "MPL-2.0" | ||
6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
7 | |||
8 | SRC_URI = " \ | ||
9 | file://30-example-interface.toml \ | ||
10 | " | ||
11 | |||
12 | do_install_append () { | ||
13 | install -m 0700 -d ${D}${libdir}/sota/conf.d | ||
14 | install -m 0644 ${WORKDIR}/30-example-interface.toml ${D}${libdir}/sota/conf.d/30-example-interface.toml | ||
15 | } | ||
16 | |||
17 | FILES_${PN} = " \ | ||
18 | ${libdir}/sota/conf.d/30-example-interface.toml \ | ||
19 | " | ||
20 | |||
21 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-sota/config/files/30-example-interface.toml b/recipes-sota/config/files/30-example-interface.toml deleted file mode 100644 index fc4e9ec..0000000 --- a/recipes-sota/config/files/30-example-interface.toml +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | [uptane] | ||
2 | legacy_interface = "/usr/bin/example-interface" | ||