summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2020-03-03 10:06:15 +0100
committerGitHub <noreply@github.com>2020-03-03 10:06:15 +0100
commit64bf6f04f93f49160811e371d5ab572bad8621ae (patch)
tree52fa4a45ad114753f2250ac00aa5afd8b8098bd4
parentb3e96c54e1d1b16ee8e1df335599a41001650e39 (diff)
parentfc039fddce945c5d35d4053aac65c685f8655b97 (diff)
downloadmeta-updater-64bf6f04f93f49160811e371d5ab572bad8621ae.tar.gz
Merge pull request #693 from advancedtelematic/feat/thud/2020.3
Feat/thud/2020.3
-rw-r--r--.gitignore1
-rw-r--r--classes/image_repo_manifest.bbclass2
-rw-r--r--classes/image_types_ostree.bbclass6
-rw-r--r--classes/sota.bbclass2
-rw-r--r--classes/sota_bleeding.inc1
-rw-r--r--classes/target_version_example.bbclass2
-rw-r--r--conf/distro/sota.conf.inc3
-rw-r--r--lib/oeqa/selftest/cases/testutils.py1
-rw-r--r--lib/oeqa/selftest/cases/updater_qemux86_64.py26
-rw-r--r--recipes-core/images/initramfs-ostree-image.bb4
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb14
-rw-r--r--recipes-test/demo-config/files/30-ostree-pacman.toml2
-rw-r--r--recipes-test/demo-config/files/30-pacman-config.toml2
-rw-r--r--recipes-test/demo-config/secondary-config.bb22
-rw-r--r--recipes-test/demo-config/shared-conf.inc4
-rw-r--r--recipes-test/demo-network-config/files/25-dhcp-server.network4
-rw-r--r--recipes-test/demo-network-config/primary-network-config.bb2
-rw-r--r--recipes-test/demo-network-config/secondary-network-config.bb4
-rw-r--r--scripts/ci/Dockerfile.bitbake32
-rwxr-xr-xscripts/ci/build.sh3
-rwxr-xr-xscripts/ci/configure.sh40
-rwxr-xr-xscripts/ci/oe-selftest.sh14
-rw-r--r--scripts/qemucommand.py1
23 files changed, 145 insertions, 47 deletions
diff --git a/.gitignore b/.gitignore
index 8d35cb3..147f162 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
1__pycache__ 1__pycache__
2*.pyc 2*.pyc
3.idea/
diff --git a/classes/image_repo_manifest.bbclass b/classes/image_repo_manifest.bbclass
index 0b311bd..72dc28f 100644
--- a/classes/image_repo_manifest.bbclass
+++ b/classes/image_repo_manifest.bbclass
@@ -9,8 +9,6 @@
9# For more information, see: 9# For more information, see:
10# https://web.archive.org/web/20161224194009/https://wiki.cyanogenmod.org/w/Doc:_Using_manifests 10# https://web.archive.org/web/20161224194009/https://wiki.cyanogenmod.org/w/Doc:_Using_manifests
11 11
12HOSTTOOLS_NONFATAL += "repo python"
13
14# Write build information to target filesystem 12# Write build information to target filesystem
15buildinfo_manifest () { 13buildinfo_manifest () {
16 if [ $(which repo) ]; then 14 if [ $(which repo) ]; then
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 0f0fd28..533d338 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -5,6 +5,7 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
5OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs" 5OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs"
6OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" 6OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}"
7OSTREE_COMMIT_BODY ??= "" 7OSTREE_COMMIT_BODY ??= ""
8OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}"
8OSTREE_UPDATE_SUMMARY ??= "0" 9OSTREE_UPDATE_SUMMARY ??= "0"
9OSTREE_DEPLOY_DEVICETREE ??= "0" 10OSTREE_DEPLOY_DEVICETREE ??= "0"
10 11
@@ -169,6 +170,7 @@ IMAGE_CMD_ostreecommit () {
169 --branch=${OSTREE_BRANCHNAME} \ 170 --branch=${OSTREE_BRANCHNAME} \
170 --subject="${OSTREE_COMMIT_SUBJECT}" \ 171 --subject="${OSTREE_COMMIT_SUBJECT}" \
171 --body="${OSTREE_COMMIT_BODY}" \ 172 --body="${OSTREE_COMMIT_BODY}" \
173 --add-metadata-string=version="${OSTREE_COMMIT_VERSION}" \
172 --bind-ref="${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}" 174 --bind-ref="${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}"
173 175
174 if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then 176 if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then
@@ -236,10 +238,10 @@ IMAGE_CMD_garagesign () {
236 target_version=${ostree_target_hash} 238 target_version=${ostree_target_hash}
237 if [ -n "${GARAGE_TARGET_VERSION}" ]; then 239 if [ -n "${GARAGE_TARGET_VERSION}" ]; then
238 target_version=${GARAGE_TARGET_VERSION} 240 target_version=${GARAGE_TARGET_VERSION}
239 bbwarn "Target version is overriden with GARAGE_TARGET_VERSION variable. It is a dangerous operation, make sure you've read the respective secion in meta-updater/README.adoc" 241 bbwarn "Target version is overriden with GARAGE_TARGET_VERSION variable. This is a dangerous operation! See https://docs.ota.here.com/ota-client/latest/build-configuration.html#_overriding_target_version"
240 elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then 242 elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then
241 target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version") 243 target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version")
242 bbwarn "Target version is overriden with target_version file. It is a dangerous operation, make sure you've read the respective secion in meta-updater/README.adoc" 244 bbwarn "Target version is overriden with target_version file. This is a dangerous operation! See https://docs.ota.here.com/ota-client/latest/build-configuration.html#_overriding_target_version"
243 fi 245 fi
244 246
245 # Push may fail due to race condition when multiple build machines try to push simultaneously 247 # Push may fail due to race condition when multiple build machines try to push simultaneously
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index f6e904e..c248cfc 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -1,7 +1,5 @@
1DISTROOVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" 1DISTROOVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}"
2 2
3HOSTTOOLS_NONFATAL += "java"
4
5SOTA_CLIENT ??= "aktualizr" 3SOTA_CLIENT ??= "aktualizr"
6SOTA_CLIENT_PROV ??= "aktualizr-shared-prov" 4SOTA_CLIENT_PROV ??= "aktualizr-shared-prov"
7SOTA_DEPLOY_CREDENTIALS ?= "1" 5SOTA_DEPLOY_CREDENTIALS ?= "1"
diff --git a/classes/sota_bleeding.inc b/classes/sota_bleeding.inc
index fc5947d..77d004b 100644
--- a/classes/sota_bleeding.inc
+++ b/classes/sota_bleeding.inc
@@ -1 +1,2 @@
1SRCREV_pn-aktualizr ?= "${AUTOREV}" 1SRCREV_pn-aktualizr ?= "${AUTOREV}"
2SRCREV_pn-aktualizr-native ?= "${AUTOREV}"
diff --git a/classes/target_version_example.bbclass b/classes/target_version_example.bbclass
index ef119fb..c0b5aec 100644
--- a/classes/target_version_example.bbclass
+++ b/classes/target_version_example.bbclass
@@ -1,7 +1,5 @@
1# Writes target version to be used by garage-sign 1# Writes target version to be used by garage-sign
2 2
3HOSTTOOLS += " git "
4
5deploy_target_version () { 3deploy_target_version () {
6 version=$(git --git-dir=${METADIR}/.repo/manifests/.git/ rev-parse HEAD) 4 version=$(git --git-dir=${METADIR}/.repo/manifests/.git/ rev-parse HEAD)
7 echo -n ${version} > ${STAGING_DATADIR_NATIVE}/target_version 5 echo -n ${version} > ${STAGING_DATADIR_NATIVE}/target_version
diff --git a/conf/distro/sota.conf.inc b/conf/distro/sota.conf.inc
index f6111bf..1d5f8df 100644
--- a/conf/distro/sota.conf.inc
+++ b/conf/distro/sota.conf.inc
@@ -16,4 +16,5 @@ INHERIT += "reproducible_build_simple"
16export SOURCE_DATE_EPOCH ?= "0" 16export SOURCE_DATE_EPOCH ?= "0"
17REPRODUCIBLE_TIMESTAMP_ROOTFS ?= "0" 17REPRODUCIBLE_TIMESTAMP_ROOTFS ?= "0"
18 18
19HOSTTOOLS_append = " sync sha256sum" 19HOSTTOOLS += "git sync sha256sum"
20HOSTTOOLS_NONFATAL += "java repo python"
diff --git a/lib/oeqa/selftest/cases/testutils.py b/lib/oeqa/selftest/cases/testutils.py
index ea7781b..3455fa8 100644
--- a/lib/oeqa/selftest/cases/testutils.py
+++ b/lib/oeqa/selftest/cases/testutils.py
@@ -49,6 +49,7 @@ def qemu_boot_image(imagename, **kwargs):
49 args.overlay = kwargs.get('overlay', None) 49 args.overlay = kwargs.get('overlay', None)
50 args.dry_run = kwargs.get('dry_run', False) 50 args.dry_run = kwargs.get('dry_run', False)
51 args.secondary_network = kwargs.get('secondary_network', False) 51 args.secondary_network = kwargs.get('secondary_network', False)
52 args.uboot_enable = kwargs.get('uboot_enable', 'yes')
52 53
53 qemu = QemuCommand(args) 54 qemu = QemuCommand(args)
54 cmdline = qemu.command_line() 55 cmdline = qemu.command_line()
diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py
index 5f152ad..08220f4 100644
--- a/lib/oeqa/selftest/cases/updater_qemux86_64.py
+++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py
@@ -112,6 +112,32 @@ class SharedCredProvTests(OESelftestTestCase):
112 verifyProvisioned(self, machine, hwid) 112 verifyProvisioned(self, machine, hwid)
113 113
114 114
115class SharedCredProvTestsNonOSTree(SharedCredProvTests):
116
117 def setUpLocal(self):
118 layer = "meta-updater-qemux86-64"
119 result = runCmd('bitbake-layers show-layers')
120 if re.search(layer, result.output) is None:
121 self.meta_qemu = metadir() + layer
122 runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu)
123 else:
124 self.meta_qemu = None
125 self.append_config('MACHINE = "qemux86-64"')
126 self.append_config('SOTA_CLIENT_PROV = ""')
127 self.append_config('IMAGE_FSTYPES_remove = "ostreepush garagesign garagecheck"')
128 self.append_config('SOTA_HARDWARE_ID = "plain_reibekuchen_314"')
129
130 self.append_config('DISTRO = "poky"')
131 self.append_config('DISTRO_FEATURES_append = " systemd"')
132 self.append_config('VIRTUAL-RUNTIME_init_manager = "systemd"')
133 self.append_config('PREFERRED_RPROVIDER_virtual/network-configuration ??= "networkd-dhcp-conf"')
134 self.append_config('PACKAGECONFIG_pn-aktualizr = ""')
135 self.append_config('SOTA_DEPLOY_CREDENTIALS = "1"')
136 self.append_config('IMAGE_INSTALL_append += "aktualizr"')
137 self.append_config('IMAGE_INSTALL_append += " aktualizr-shared-prov"')
138 self.qemu, self.s = qemu_launch(machine='qemux86-64', uboot_enable='no')
139
140
115class ManualControlTests(OESelftestTestCase): 141class ManualControlTests(OESelftestTestCase):
116 142
117 def setUpLocal(self): 143 def setUpLocal(self):
diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb
index 7e03f3d..936c59a 100644
--- a/recipes-core/images/initramfs-ostree-image.bb
+++ b/recipes-core/images/initramfs-ostree-image.bb
@@ -13,6 +13,8 @@ IMAGE_LINGUAS = ""
13 13
14LICENSE = "MIT" 14LICENSE = "MIT"
15 15
16IMAGE_CLASSES_remove = "image_repo_manifest"
17
16IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" 18IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
17 19
18# Avoid circular dependencies 20# Avoid circular dependencies
@@ -28,5 +30,3 @@ IMAGE_ROOTFS_EXTRA_SPACE = "0"
28IMAGE_OVERHEAD_FACTOR = "1.0" 30IMAGE_OVERHEAD_FACTOR = "1.0"
29 31
30BAD_RECOMMENDATIONS += "busybox-syslog" 32BAD_RECOMMENDATIONS += "busybox-syslog"
31
32IMAGE_PREPROCESS_COMMAND_remove = "buildinfo_manifest;"
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 4460b53..9bcd86d 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -15,7 +15,7 @@ RDEPENDS_${PN}-ptest += "bash cmake curl python3-misc python3-modules openssl-bi
15PV = "1.0+git${SRCPV}" 15PV = "1.0+git${SRCPV}"
16PR = "7" 16PR = "7"
17 17
18GARAGE_SIGN_PV = "0.7.0-64-gc7c279f" 18GARAGE_SIGN_PV = "0.7.0-70-g3adf982"
19 19
20SRC_URI = " \ 20SRC_URI = " \
21 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \ 21 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \
@@ -27,10 +27,10 @@ SRC_URI = " \
27 ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \ 27 ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \
28 " 28 "
29 29
30SRC_URI[garagesign.md5sum] = "36dedbf79f71cb697a18251ea121bcc6" 30SRC_URI[garagesign.md5sum] = "7c4cbeacefd97eae69104d29cf5ff37a"
31SRC_URI[garagesign.sha256sum] = "f0a8e4bb258fd65a6f1fe561132d5ab3fe25b76aec0f1873993dc65bf2167608" 31SRC_URI[garagesign.sha256sum] = "e9a9b68eaa1ce4104eb2ab7f1f59d99742d50805e93216fb5b21d1f212aa3d82"
32 32
33SRCREV = "56ac8dafb552b1d15638162ca14e0b818ed5e65f" 33SRCREV = "9f2cc5d7b026eb1a1404f0c77ef6cb9377245423"
34BRANCH ?= "master" 34BRANCH ?= "master"
35 35
36S = "${WORKDIR}/git" 36S = "${WORKDIR}/git"
@@ -151,7 +151,7 @@ FILES_${PN} = " \
151 " 151 "
152 152
153FILES_${PN}-lib = " \ 153FILES_${PN}-lib = " \
154 ${libdir}/libaktualizr_lib.so \ 154 ${libdir}/libaktualizr.so \
155 " 155 "
156 156
157FILES_${PN}-resource-control = " \ 157FILES_${PN}-resource-control = " \
@@ -170,11 +170,11 @@ FILES_${PN}-secondary = " \
170 " 170 "
171 171
172FILES_${PN}-secondary-lib = " \ 172FILES_${PN}-secondary-lib = " \
173 ${libdir}/libaktualizr_secondary_lib.so \ 173 ${libdir}/libaktualizr_secondary.so \
174 " 174 "
175 175
176FILES_${PN}-sotatools-lib = " \ 176FILES_${PN}-sotatools-lib = " \
177 ${libdir}/libsota_tools_lib.so \ 177 ${libdir}/libsota_tools.so \
178 " 178 "
179 179
180FILES_${PN}-dev = "" 180FILES_${PN}-dev = ""
diff --git a/recipes-test/demo-config/files/30-ostree-pacman.toml b/recipes-test/demo-config/files/30-ostree-pacman.toml
deleted file mode 100644
index d2cf5b8..0000000
--- a/recipes-test/demo-config/files/30-ostree-pacman.toml
+++ /dev/null
@@ -1,2 +0,0 @@
1[pacman]
2type = "ostree"
diff --git a/recipes-test/demo-config/files/30-pacman-config.toml b/recipes-test/demo-config/files/30-pacman-config.toml
new file mode 100644
index 0000000..750cf5c
--- /dev/null
+++ b/recipes-test/demo-config/files/30-pacman-config.toml
@@ -0,0 +1,2 @@
1[pacman]
2type = @UPDATE_TYPE@
diff --git a/recipes-test/demo-config/secondary-config.bb b/recipes-test/demo-config/secondary-config.bb
index 58b18df..638f0ae 100644
--- a/recipes-test/demo-config/secondary-config.bb
+++ b/recipes-test/demo-config/secondary-config.bb
@@ -10,16 +10,32 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
10SECONDARY_SERIAL_ID ?= "" 10SECONDARY_SERIAL_ID ?= ""
11SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" 11SOTA_HARDWARE_ID ?= "${MACHINE}-sndry"
12SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" 12SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}"
13SECONDARY_UPDATE_TYPE ?= "ostree"
14
15UPDATE_TYPE = "${SECONDARY_UPDATE_TYPE}"
16python () {
17 update_type = d.getVar('UPDATE_TYPE')
18 if update_type not in [ 'ostree', 'file']:
19 bb.fatal('Unsupported type of an update specified for secondary: SECONDARY_UPDATE_TYPE = {}\n'
20 'Supported update types are: ostree and file'
21 .format(update_type))
22
23 if update_type == 'file':
24 d.setVar('UPDATE_TYPE', 'none')
25}
13 26
14SRC_URI = "\ 27SRC_URI = "\
15 file://30-ostree-pacman.toml \ 28 file://30-pacman-config.toml \
16 file://35-network-config.toml \ 29 file://35-network-config.toml \
17 file://45-id-config.toml \ 30 file://45-id-config.toml \
18 " 31 "
19 32
33
20do_install () { 34do_install () {
21 install -m 0700 -d ${D}${libdir}/sota/conf.d 35 install -m 0700 -d ${D}${libdir}/sota/conf.d
22 install -m 0644 ${WORKDIR}/30-ostree-pacman.toml ${D}${libdir}/sota/conf.d/30-ostree-pacman.toml 36
37 install -m 0644 ${WORKDIR}/30-pacman-config.toml ${D}${libdir}/sota/conf.d/30-pacman-config.toml
38 sed -i -e 's|@UPDATE_TYPE@|${UPDATE_TYPE}|g' ${D}${libdir}/sota/conf.d/30-pacman-config.toml
23 39
24 install -m 0644 ${WORKDIR}/35-network-config.toml ${D}${libdir}/sota/conf.d/35-network-config.toml 40 install -m 0644 ${WORKDIR}/35-network-config.toml ${D}${libdir}/sota/conf.d/35-network-config.toml
25 sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \ 41 sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \
@@ -36,7 +52,7 @@ do_install () {
36 52
37FILES_${PN} = " \ 53FILES_${PN} = " \
38 ${libdir}/sota/conf.d \ 54 ${libdir}/sota/conf.d \
39 ${libdir}/sota/conf.d/30-ostree-pacman.toml \ 55 ${libdir}/sota/conf.d/30-pacman-config.toml \
40 ${libdir}/sota/conf.d/35-network-config.toml \ 56 ${libdir}/sota/conf.d/35-network-config.toml \
41 ${libdir}/sota/conf.d/45-id-config.toml \ 57 ${libdir}/sota/conf.d/45-id-config.toml \
42 " 58 "
diff --git a/recipes-test/demo-config/shared-conf.inc b/recipes-test/demo-config/shared-conf.inc
index c5ab598..5523406 100644
--- a/recipes-test/demo-config/shared-conf.inc
+++ b/recipes-test/demo-config/shared-conf.inc
@@ -1,5 +1,5 @@
1SECONDARY_IP ?= "10.0.3.2" 1SECONDARY_IP ?= "192.168.254.2"
2SECONDARY_PORT ?= "9050" 2SECONDARY_PORT ?= "9050"
3PRIMARY_IP ?= "10.0.3.1" 3PRIMARY_IP ?= "192.168.254.1"
4PRIMARY_PORT ?= "9040" 4PRIMARY_PORT ?= "9040"
5PRIMARY_WAIT_TIMEOUT ?= "240" 5PRIMARY_WAIT_TIMEOUT ?= "240"
diff --git a/recipes-test/demo-network-config/files/25-dhcp-server.network b/recipes-test/demo-network-config/files/25-dhcp-server.network
index 4766f9a..03bb302 100644
--- a/recipes-test/demo-network-config/files/25-dhcp-server.network
+++ b/recipes-test/demo-network-config/files/25-dhcp-server.network
@@ -4,9 +4,9 @@ Name=enp0s4
4[Network] 4[Network]
5Description=Private internal network between aktualizr Primary and Secondary nodes 5Description=Private internal network between aktualizr Primary and Secondary nodes
6DHCPServer=yes 6DHCPServer=yes
7Address=10.0.3.1/24 7Address=192.168.254.1/24
8IPForward=yes 8IPForward=yes
9IPMasquerade=yes 9IPMasquerade=yes
10 10
11[DHCPServer] 11[DHCPServer]
12PoolOffset=10 \ No newline at end of file 12PoolOffset=10
diff --git a/recipes-test/demo-network-config/primary-network-config.bb b/recipes-test/demo-network-config/primary-network-config.bb
index 544a5ec..7ee873f 100644
--- a/recipes-test/demo-network-config/primary-network-config.bb
+++ b/recipes-test/demo-network-config/primary-network-config.bb
@@ -15,7 +15,7 @@ do_install() {
15 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/ 15 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/
16} 16}
17 17
18PRIMARY_IP ?= "10.0.3.1" 18PRIMARY_IP ?= "192.168.254.1"
19 19
20IP_ADDR = "${PRIMARY_IP}" 20IP_ADDR = "${PRIMARY_IP}"
21CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}" 21CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}"
diff --git a/recipes-test/demo-network-config/secondary-network-config.bb b/recipes-test/demo-network-config/secondary-network-config.bb
index ca83d53..b268cd3 100644
--- a/recipes-test/demo-network-config/secondary-network-config.bb
+++ b/recipes-test/demo-network-config/secondary-network-config.bb
@@ -19,9 +19,9 @@ do_install() {
19 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/ 19 install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/
20} 20}
21 21
22SECONDARY_IP ?= "10.0.3.2" 22SECONDARY_IP ?= "192.168.254.2"
23IP_ADDR = "${SECONDARY_IP}" 23IP_ADDR = "${SECONDARY_IP}"
24CONF_TYPE = "static" 24CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}"
25 25
26require network-config.inc 26require network-config.inc
27 27
diff --git a/scripts/ci/Dockerfile.bitbake b/scripts/ci/Dockerfile.bitbake
index c91f94c..51eaa57 100644
--- a/scripts/ci/Dockerfile.bitbake
+++ b/scripts/ci/Dockerfile.bitbake
@@ -1,15 +1,17 @@
1FROM debian:stable 1FROM debian:stretch
2LABEL Description="Image for bitbaking" 2LABEL Description="Image for bitbaking"
3 3
4RUN sed -i 's#deb http://deb.debian.org/debian stable main#deb http://deb.debian.org/debian stable main contrib#g' /etc/apt/sources.list 4RUN sed -i 's#deb http://deb.debian.org/debian stretch main#deb http://deb.debian.org/debian stretch main contrib#g' /etc/apt/sources.list
5RUN sed -i 's#deb http://deb.debian.org/debian stable-updates main#deb http://deb.debian.org/debian stable-updates main contrib#g' /etc/apt/sources.list 5RUN sed -i 's#deb http://deb.debian.org/debian stretch-updates main#deb http://deb.debian.org/debian stretch-updates main contrib#g' /etc/apt/sources.list
6RUN apt-get update -q && apt-get install -qy \ 6RUN apt-get update -q && apt-get install --no-install-suggests --no-install-recommends -qy \
7 awscli \
7 build-essential \ 8 build-essential \
8 bzip2 \ 9 bzip2 \
9 chrpath \ 10 chrpath \
10 cpio \ 11 cpio \
11 default-jre \ 12 default-jre \
12 diffstat \ 13 diffstat \
14 file \
13 gawk \ 15 gawk \
14 gcc-multilib \ 16 gcc-multilib \
15 git-core \ 17 git-core \
@@ -17,26 +19,40 @@ RUN apt-get update -q && apt-get install -qy \
17 iproute \ 19 iproute \
18 libpython-dev \ 20 libpython-dev \
19 libsdl1.2-dev \ 21 libsdl1.2-dev \
22 libvirt-clients \
23 libvirt-daemon-system \
20 locales \ 24 locales \
21 ovmf \ 25 ovmf \
26 openssh-client \
22 procps \ 27 procps \
23 python \ 28 python \
24 python3 \ 29 python3 \
25 python3-pexpect \ 30 python3-pexpect \
26 qemu \ 31 qemu-kvm \
27 socat \ 32 socat \
33 sudo \
28 texinfo \ 34 texinfo \
29 unzip \ 35 unzip \
30 wget \ 36 wget \
31 xterm \ 37 xterm \
32 xz-utils 38 xz-utils
33 39
34ARG uid=1000 40ARG uid=4321
35ARG gid=1000 41ARG gid=4321
36RUN groupadd -g $gid bitbake 42RUN groupadd -g $gid bitbake
37RUN useradd -m -u $uid -g $gid bitbake 43RUN useradd -m -u $uid -g $gid -s /bin/bash bitbake
38 44
39RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen 45RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
40ENV LC_ALL="en_US.UTF-8" 46ENV LC_ALL="en_US.UTF-8"
41ENV LANG="en_US.UTF-8" 47ENV LANG="en_US.UTF-8"
42ENV LANGUAGE="en_US.UTF-8" 48ENV LANGUAGE="en_US.UTF-8"
49
50# script to mirror kvm group id with host
51RUN echo "bitbake ALL=NOPASSWD: /usr/local/bin/setup_kvm.sh" >> /etc/sudoers
52COPY ./docker/setup_kvm.sh /usr/local/bin/setup_kvm.sh
53
54# other ci scripts
55RUN mkdir /scripts
56COPY configure.sh build.sh oe-selftest.sh /scripts/
57
58USER "bitbake"
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh
index 6235428..9fbae98 100755
--- a/scripts/ci/build.sh
+++ b/scripts/ci/build.sh
@@ -12,7 +12,10 @@ IMAGE_NAME=${1:-core-image-minimal}
12( 12(
13set +euo pipefail 13set +euo pipefail
14set +x 14set +x
15METADIR=$(realpath "$TEST_REPO_DIR")
16export METADIR
15. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" 17. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}"
16 18
19set -x
17bitbake "${IMAGE_NAME}" 20bitbake "${IMAGE_NAME}"
18) 21)
diff --git a/scripts/ci/configure.sh b/scripts/ci/configure.sh
index 960a0cc..ae78f06 100755
--- a/scripts/ci/configure.sh
+++ b/scripts/ci/configure.sh
@@ -8,9 +8,19 @@ TEST_BUILD_DIR=${TEST_BUILD_DIR:-build}
8TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} 8TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo}
9TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} 9TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-}
10 10
11TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} 11TEST_AKTUALIZR_REMOTE=${TEST_AKTUALIZR_REMOTE:-}
12TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} 12TEST_AKTUALIZR_TAG=${TEST_AKTUALIZR_TAG:-}
13TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} 13if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then
14 if [ -n "$TEST_AKTUALIZR_TAG" ]; then
15 TEST_AKTUALIZR_BRANCH=""
16 TEST_AKTUALIZR_REV=""
17 else
18 TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.}
19 TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master}
20 TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")}
21 fi
22fi
23
14TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} 24TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-}
15 25
16# move existing conf directory to backup, before generating a new one 26# move existing conf directory to backup, before generating a new one
@@ -21,6 +31,8 @@ mv "$TEST_BUILD_DIR/conf" "$TEST_BUILD_DIR/conf.old" || true
21set +euo pipefail 31set +euo pipefail
22set +x 32set +x
23echo ">> Running envsetup.sh" 33echo ">> Running envsetup.sh"
34METADIR=$(realpath "$TEST_REPO_DIR")
35export METADIR
24. "$TEST_REPO_DIR/meta-updater/scripts/envsetup.sh" "$TEST_MACHINE" "$TEST_BUILD_DIR" 36. "$TEST_REPO_DIR/meta-updater/scripts/envsetup.sh" "$TEST_MACHINE" "$TEST_BUILD_DIR"
25) 37)
26 38
@@ -31,19 +43,30 @@ SITE_CONF="$TEST_BUILD_DIR/conf/site.conf"
31echo ">> Set common bitbake config options" 43echo ">> Set common bitbake config options"
32cat << EOF > "$SITE_CONF" 44cat << EOF > "$SITE_CONF"
33SANITY_TESTED_DISTROS = "" 45SANITY_TESTED_DISTROS = ""
34SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH"
35IMAGE_FEATURES += "ssh-server-openssh" 46IMAGE_FEATURES += "ssh-server-openssh"
36 47
37EOF 48EOF
38 49
39echo ">> Set aktualizr branch in bitbake's config" 50if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then
40cat << EOF >> "$SITE_CONF" 51 echo ">> Set aktualizr branch in bitbake's config"
52 if [ -n "$TEST_AKTUALIZR_TAG" ]; then
53 # tag case
54 cat << EOF >> "$SITE_CONF"
55SRCREV_pn-aktualizr = ""
56SRCREV_pn-aktualizr-native = ""
57BRANCH_pn-aktualizr = ";nobranch=1;tag=$TEST_AKTUALIZR_TAG"
58BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}"
59EOF
60 else
61 # branch case
62 cat << EOF >> "$SITE_CONF"
41SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" 63SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV"
42SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" 64SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}"
43BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" 65BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH"
44BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" 66BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}"
45
46EOF 67EOF
68 fi
69fi
47 70
48if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then 71if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then
49 echo ">> Set aktualizr credentials" 72 echo ">> Set aktualizr credentials"
@@ -63,3 +86,6 @@ SSTATE_DIR = "$SSTATE_DIR"
63DL_DIR = "$DL_DIR" 86DL_DIR = "$DL_DIR"
64EOF 87EOF
65fi 88fi
89
90echo -e ">> Final configuration (site.conf):\\n"
91cat "$SITE_CONF"
diff --git a/scripts/ci/oe-selftest.sh b/scripts/ci/oe-selftest.sh
index 3124cce..d441d02 100755
--- a/scripts/ci/oe-selftest.sh
+++ b/scripts/ci/oe-selftest.sh
@@ -12,7 +12,19 @@ TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo}
12( 12(
13set +euo pipefail 13set +euo pipefail
14set +x 14set +x
15METADIR=$(realpath "$TEST_REPO_DIR")
16export METADIR
15. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" 17. "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}"
16 18
17oe-selftest -r updater 19set -x
20
21# work poky around bug on sumo and thud
22# see https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d3a94e5b9b3c107cf54d5639071cc6609c002f67
23mkdir -p "tmp/log"
24
25# This is apparently required here now as well.
26git config --global user.email "meta-updater-ci@example.org"
27git config --global user.name "meta-updater-ci"
28
29oe-selftest -r "$@"
18) 30)
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py
index 86b5b9f..30929ac 100644
--- a/scripts/qemucommand.py
+++ b/scripts/qemucommand.py
@@ -40,7 +40,6 @@ def random_mac():
40 40
41class QemuCommand(object): 41class QemuCommand(object):
42 def __init__(self, args): 42 def __init__(self, args):
43 print(args)
44 self.enable_u_boot = True 43 self.enable_u_boot = True
45 self.dry_run = args.dry_run 44 self.dry_run = args.dry_run
46 self.overlay = args.overlay 45 self.overlay = args.overlay