diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2020-03-03 10:06:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-03 10:06:15 +0100 |
commit | 64bf6f04f93f49160811e371d5ab572bad8621ae (patch) | |
tree | 52fa4a45ad114753f2250ac00aa5afd8b8098bd4 | |
parent | b3e96c54e1d1b16ee8e1df335599a41001650e39 (diff) | |
parent | fc039fddce945c5d35d4053aac65c685f8655b97 (diff) | |
download | meta-updater-64bf6f04f93f49160811e371d5ab572bad8621ae.tar.gz |
Merge pull request #693 from advancedtelematic/feat/thud/2020.3
Feat/thud/2020.3
23 files changed, 145 insertions, 47 deletions
@@ -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 | ||
12 | HOSTTOOLS_NONFATAL += "repo python" | ||
13 | |||
14 | # Write build information to target filesystem | 12 | # Write build information to target filesystem |
15 | buildinfo_manifest () { | 13 | buildinfo_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}" | |||
5 | OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs" | 5 | OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs" |
6 | OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" | 6 | OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" |
7 | OSTREE_COMMIT_BODY ??= "" | 7 | OSTREE_COMMIT_BODY ??= "" |
8 | OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}" | ||
8 | OSTREE_UPDATE_SUMMARY ??= "0" | 9 | OSTREE_UPDATE_SUMMARY ??= "0" |
9 | OSTREE_DEPLOY_DEVICETREE ??= "0" | 10 | OSTREE_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 @@ | |||
1 | DISTROOVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" | 1 | DISTROOVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" |
2 | 2 | ||
3 | HOSTTOOLS_NONFATAL += "java" | ||
4 | |||
5 | SOTA_CLIENT ??= "aktualizr" | 3 | SOTA_CLIENT ??= "aktualizr" |
6 | SOTA_CLIENT_PROV ??= "aktualizr-shared-prov" | 4 | SOTA_CLIENT_PROV ??= "aktualizr-shared-prov" |
7 | SOTA_DEPLOY_CREDENTIALS ?= "1" | 5 | SOTA_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 @@ | |||
1 | SRCREV_pn-aktualizr ?= "${AUTOREV}" | 1 | SRCREV_pn-aktualizr ?= "${AUTOREV}" |
2 | SRCREV_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 | ||
3 | HOSTTOOLS += " git " | ||
4 | |||
5 | deploy_target_version () { | 3 | deploy_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" | |||
16 | export SOURCE_DATE_EPOCH ?= "0" | 16 | export SOURCE_DATE_EPOCH ?= "0" |
17 | REPRODUCIBLE_TIMESTAMP_ROOTFS ?= "0" | 17 | REPRODUCIBLE_TIMESTAMP_ROOTFS ?= "0" |
18 | 18 | ||
19 | HOSTTOOLS_append = " sync sha256sum" | 19 | HOSTTOOLS += "git sync sha256sum" |
20 | HOSTTOOLS_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 | ||
115 | class 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 | |||
115 | class ManualControlTests(OESelftestTestCase): | 141 | class 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 | ||
14 | LICENSE = "MIT" | 14 | LICENSE = "MIT" |
15 | 15 | ||
16 | IMAGE_CLASSES_remove = "image_repo_manifest" | ||
17 | |||
16 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | 18 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" |
17 | 19 | ||
18 | # Avoid circular dependencies | 20 | # Avoid circular dependencies |
@@ -28,5 +30,3 @@ IMAGE_ROOTFS_EXTRA_SPACE = "0" | |||
28 | IMAGE_OVERHEAD_FACTOR = "1.0" | 30 | IMAGE_OVERHEAD_FACTOR = "1.0" |
29 | 31 | ||
30 | BAD_RECOMMENDATIONS += "busybox-syslog" | 32 | BAD_RECOMMENDATIONS += "busybox-syslog" |
31 | |||
32 | IMAGE_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 | |||
15 | PV = "1.0+git${SRCPV}" | 15 | PV = "1.0+git${SRCPV}" |
16 | PR = "7" | 16 | PR = "7" |
17 | 17 | ||
18 | GARAGE_SIGN_PV = "0.7.0-64-gc7c279f" | 18 | GARAGE_SIGN_PV = "0.7.0-70-g3adf982" |
19 | 19 | ||
20 | SRC_URI = " \ | 20 | SRC_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 | ||
30 | SRC_URI[garagesign.md5sum] = "36dedbf79f71cb697a18251ea121bcc6" | 30 | SRC_URI[garagesign.md5sum] = "7c4cbeacefd97eae69104d29cf5ff37a" |
31 | SRC_URI[garagesign.sha256sum] = "f0a8e4bb258fd65a6f1fe561132d5ab3fe25b76aec0f1873993dc65bf2167608" | 31 | SRC_URI[garagesign.sha256sum] = "e9a9b68eaa1ce4104eb2ab7f1f59d99742d50805e93216fb5b21d1f212aa3d82" |
32 | 32 | ||
33 | SRCREV = "56ac8dafb552b1d15638162ca14e0b818ed5e65f" | 33 | SRCREV = "9f2cc5d7b026eb1a1404f0c77ef6cb9377245423" |
34 | BRANCH ?= "master" | 34 | BRANCH ?= "master" |
35 | 35 | ||
36 | S = "${WORKDIR}/git" | 36 | S = "${WORKDIR}/git" |
@@ -151,7 +151,7 @@ FILES_${PN} = " \ | |||
151 | " | 151 | " |
152 | 152 | ||
153 | FILES_${PN}-lib = " \ | 153 | FILES_${PN}-lib = " \ |
154 | ${libdir}/libaktualizr_lib.so \ | 154 | ${libdir}/libaktualizr.so \ |
155 | " | 155 | " |
156 | 156 | ||
157 | FILES_${PN}-resource-control = " \ | 157 | FILES_${PN}-resource-control = " \ |
@@ -170,11 +170,11 @@ FILES_${PN}-secondary = " \ | |||
170 | " | 170 | " |
171 | 171 | ||
172 | FILES_${PN}-secondary-lib = " \ | 172 | FILES_${PN}-secondary-lib = " \ |
173 | ${libdir}/libaktualizr_secondary_lib.so \ | 173 | ${libdir}/libaktualizr_secondary.so \ |
174 | " | 174 | " |
175 | 175 | ||
176 | FILES_${PN}-sotatools-lib = " \ | 176 | FILES_${PN}-sotatools-lib = " \ |
177 | ${libdir}/libsota_tools_lib.so \ | 177 | ${libdir}/libsota_tools.so \ |
178 | " | 178 | " |
179 | 179 | ||
180 | FILES_${PN}-dev = "" | 180 | FILES_${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] | ||
2 | type = "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] | ||
2 | type = @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}" | |||
10 | SECONDARY_SERIAL_ID ?= "" | 10 | SECONDARY_SERIAL_ID ?= "" |
11 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" | 11 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" |
12 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" | 12 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" |
13 | SECONDARY_UPDATE_TYPE ?= "ostree" | ||
14 | |||
15 | UPDATE_TYPE = "${SECONDARY_UPDATE_TYPE}" | ||
16 | python () { | ||
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 | ||
14 | SRC_URI = "\ | 27 | SRC_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 | |||
20 | do_install () { | 34 | do_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 | ||
37 | FILES_${PN} = " \ | 53 | FILES_${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 @@ | |||
1 | SECONDARY_IP ?= "10.0.3.2" | 1 | SECONDARY_IP ?= "192.168.254.2" |
2 | SECONDARY_PORT ?= "9050" | 2 | SECONDARY_PORT ?= "9050" |
3 | PRIMARY_IP ?= "10.0.3.1" | 3 | PRIMARY_IP ?= "192.168.254.1" |
4 | PRIMARY_PORT ?= "9040" | 4 | PRIMARY_PORT ?= "9040" |
5 | PRIMARY_WAIT_TIMEOUT ?= "240" | 5 | PRIMARY_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] |
5 | Description=Private internal network between aktualizr Primary and Secondary nodes | 5 | Description=Private internal network between aktualizr Primary and Secondary nodes |
6 | DHCPServer=yes | 6 | DHCPServer=yes |
7 | Address=10.0.3.1/24 | 7 | Address=192.168.254.1/24 |
8 | IPForward=yes | 8 | IPForward=yes |
9 | IPMasquerade=yes | 9 | IPMasquerade=yes |
10 | 10 | ||
11 | [DHCPServer] | 11 | [DHCPServer] |
12 | PoolOffset=10 \ No newline at end of file | 12 | PoolOffset=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 | ||
18 | PRIMARY_IP ?= "10.0.3.1" | 18 | PRIMARY_IP ?= "192.168.254.1" |
19 | 19 | ||
20 | IP_ADDR = "${PRIMARY_IP}" | 20 | IP_ADDR = "${PRIMARY_IP}" |
21 | CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}" | 21 | CONF_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 | ||
22 | SECONDARY_IP ?= "10.0.3.2" | 22 | SECONDARY_IP ?= "192.168.254.2" |
23 | IP_ADDR = "${SECONDARY_IP}" | 23 | IP_ADDR = "${SECONDARY_IP}" |
24 | CONF_TYPE = "static" | 24 | CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('RPI_WIFI_ENABLE') != '1' else 'static'}" |
25 | 25 | ||
26 | require network-config.inc | 26 | require 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 @@ | |||
1 | FROM debian:stable | 1 | FROM debian:stretch |
2 | LABEL Description="Image for bitbaking" | 2 | LABEL Description="Image for bitbaking" |
3 | 3 | ||
4 | RUN 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 | 4 | RUN 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 |
5 | RUN 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 | 5 | RUN 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 |
6 | RUN apt-get update -q && apt-get install -qy \ | 6 | RUN 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 | ||
34 | ARG uid=1000 | 40 | ARG uid=4321 |
35 | ARG gid=1000 | 41 | ARG gid=4321 |
36 | RUN groupadd -g $gid bitbake | 42 | RUN groupadd -g $gid bitbake |
37 | RUN useradd -m -u $uid -g $gid bitbake | 43 | RUN useradd -m -u $uid -g $gid -s /bin/bash bitbake |
38 | 44 | ||
39 | RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen | 45 | RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen |
40 | ENV LC_ALL="en_US.UTF-8" | 46 | ENV LC_ALL="en_US.UTF-8" |
41 | ENV LANG="en_US.UTF-8" | 47 | ENV LANG="en_US.UTF-8" |
42 | ENV LANGUAGE="en_US.UTF-8" | 48 | ENV LANGUAGE="en_US.UTF-8" |
49 | |||
50 | # script to mirror kvm group id with host | ||
51 | RUN echo "bitbake ALL=NOPASSWD: /usr/local/bin/setup_kvm.sh" >> /etc/sudoers | ||
52 | COPY ./docker/setup_kvm.sh /usr/local/bin/setup_kvm.sh | ||
53 | |||
54 | # other ci scripts | ||
55 | RUN mkdir /scripts | ||
56 | COPY configure.sh build.sh oe-selftest.sh /scripts/ | ||
57 | |||
58 | USER "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 | ( |
13 | set +euo pipefail | 13 | set +euo pipefail |
14 | set +x | 14 | set +x |
15 | METADIR=$(realpath "$TEST_REPO_DIR") | ||
16 | export 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 | ||
19 | set -x | ||
17 | bitbake "${IMAGE_NAME}" | 20 | bitbake "${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} | |||
8 | TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} | 8 | TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} |
9 | TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} | 9 | TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} |
10 | 10 | ||
11 | TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} | 11 | TEST_AKTUALIZR_REMOTE=${TEST_AKTUALIZR_REMOTE:-} |
12 | TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} | 12 | TEST_AKTUALIZR_TAG=${TEST_AKTUALIZR_TAG:-} |
13 | TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} | 13 | if [ -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 | ||
22 | fi | ||
23 | |||
14 | TEST_AKTUALIZR_CREDENTIALS=${TEST_AKTUALIZR_CREDENTIALS:-} | 24 | TEST_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 | |||
21 | set +euo pipefail | 31 | set +euo pipefail |
22 | set +x | 32 | set +x |
23 | echo ">> Running envsetup.sh" | 33 | echo ">> Running envsetup.sh" |
34 | METADIR=$(realpath "$TEST_REPO_DIR") | ||
35 | export 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" | |||
31 | echo ">> Set common bitbake config options" | 43 | echo ">> Set common bitbake config options" |
32 | cat << EOF > "$SITE_CONF" | 44 | cat << EOF > "$SITE_CONF" |
33 | SANITY_TESTED_DISTROS = "" | 45 | SANITY_TESTED_DISTROS = "" |
34 | SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH" | ||
35 | IMAGE_FEATURES += "ssh-server-openssh" | 46 | IMAGE_FEATURES += "ssh-server-openssh" |
36 | 47 | ||
37 | EOF | 48 | EOF |
38 | 49 | ||
39 | echo ">> Set aktualizr branch in bitbake's config" | 50 | if [ -n "$TEST_AKTUALIZR_REMOTE" ]; then |
40 | cat << 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" | ||
55 | SRCREV_pn-aktualizr = "" | ||
56 | SRCREV_pn-aktualizr-native = "" | ||
57 | BRANCH_pn-aktualizr = ";nobranch=1;tag=$TEST_AKTUALIZR_TAG" | ||
58 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" | ||
59 | EOF | ||
60 | else | ||
61 | # branch case | ||
62 | cat << EOF >> "$SITE_CONF" | ||
41 | SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" | 63 | SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" |
42 | SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" | 64 | SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" |
43 | BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" | 65 | BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" |
44 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" | 66 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" |
45 | |||
46 | EOF | 67 | EOF |
68 | fi | ||
69 | fi | ||
47 | 70 | ||
48 | if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then | 71 | if [[ -n $TEST_AKTUALIZR_CREDENTIALS ]]; then |
49 | echo ">> Set aktualizr credentials" | 72 | echo ">> Set aktualizr credentials" |
@@ -63,3 +86,6 @@ SSTATE_DIR = "$SSTATE_DIR" | |||
63 | DL_DIR = "$DL_DIR" | 86 | DL_DIR = "$DL_DIR" |
64 | EOF | 87 | EOF |
65 | fi | 88 | fi |
89 | |||
90 | echo -e ">> Final configuration (site.conf):\\n" | ||
91 | cat "$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 | ( |
13 | set +euo pipefail | 13 | set +euo pipefail |
14 | set +x | 14 | set +x |
15 | METADIR=$(realpath "$TEST_REPO_DIR") | ||
16 | export 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 | ||
17 | oe-selftest -r updater | 19 | set -x |
20 | |||
21 | # work poky around bug on sumo and thud | ||
22 | # see https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d3a94e5b9b3c107cf54d5639071cc6609c002f67 | ||
23 | mkdir -p "tmp/log" | ||
24 | |||
25 | # This is apparently required here now as well. | ||
26 | git config --global user.email "meta-updater-ci@example.org" | ||
27 | git config --global user.name "meta-updater-ci" | ||
28 | |||
29 | oe-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 | ||
41 | class QemuCommand(object): | 41 | class 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 |