From 188ddd7fd0624a1cb5cae94380c99d914bb975fc Mon Sep 17 00:00:00 2001 From: Choong YinThong Date: Sun, 11 Jun 2017 12:48:35 -0700 Subject: [PATCH 1/9] mraa & upm: Updated to latest version Recipe update and rename to always take the latest version from github source. Signed-off-by: Choong YinThong --- .../recipes-sensors/mraa/{mraa_1.6.0.bb => mraa_git.bb} | 6 ++++-- .../recipes-sensors/upm/{upm_1.1.0.bb => upm_git.bb} | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) rename meta-refkit-core/recipes-sensors/mraa/{mraa_1.6.0.bb => mraa_git.bb} (91%) rename meta-refkit-core/recipes-sensors/upm/{upm_1.1.0.bb => upm_git.bb} (89%) diff --git a/meta-refkit-core/recipes-sensors/mraa/mraa_1.6.0.bb b/meta-refkit-core/recipes-sensors/mraa/mraa_git.bb similarity index 91% rename from meta-refkit-core/recipes-sensors/mraa/mraa_1.6.0.bb rename to meta-refkit-core/recipes-sensors/mraa/mraa_git.bb index 9be8b416ce..0ff356091a 100644 --- a/meta-refkit-core/recipes-sensors/mraa/mraa_1.6.0.bb +++ b/meta-refkit-core/recipes-sensors/mraa/mraa_git.bb @@ -5,8 +5,10 @@ AUTHOR = "Brendan Le Foll, Tom Ingleby, Dmitry Rozhkov" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=66493d54e65bfc12c7983ff2e884f37f" -SRC_URI = "git://github.com/intel-iot-devkit/mraa.git;protocol=http;tag=v${PV} \ - " +SRCREV = "8ddbcde84e2d146bc0f9e38504d6c89c14291480" +PV = "1.7.0-git${SRCPV}" + +SRC_URI = "git://github.com/intel-iot-devkit/${BPN}.git;protocol=http" S = "${WORKDIR}/git" diff --git a/meta-refkit-core/recipes-sensors/upm/upm_1.1.0.bb b/meta-refkit-core/recipes-sensors/upm/upm_git.bb similarity index 89% rename from meta-refkit-core/recipes-sensors/upm/upm_1.1.0.bb rename to meta-refkit-core/recipes-sensors/upm/upm_git.bb index 9c5b09d7c4..50ba17e59e 100644 --- a/meta-refkit-core/recipes-sensors/upm/upm_1.1.0.bb +++ b/meta-refkit-core/recipes-sensors/upm/upm_git.bb @@ -7,7 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=66493d54e65bfc12c7983ff2e884f37f" DEPENDS = "libjpeg-turbo mraa" -SRC_URI = "git://github.com/intel-iot-devkit/upm.git;protocol=http;tag=v${PV}" +SRCREV = "106b6c706268522ab0168a4ddb19e89ce832e084" +PV = "1.3.0-git${SRCPV}" + +SRC_URI = "git://github.com/intel-iot-devkit/${BPN}.git;protocol=http" S = "${WORKDIR}/git" From 96908e6170e3805e495daec6cfc2129be19edf5b Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Tue, 13 Jun 2017 16:30:06 +0300 Subject: [PATCH 2/9] meta-security-isafw: update to latest HEAD. * meta-security-isafw 15f4650...489abdc (1): > Merge pull request #84 from ipuustin/remove-cve-check-tool Signed-off-by: Ismo Puustinen --- meta-security-isafw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-security-isafw b/meta-security-isafw index 15f46506b7..489abdc65c 160000 --- a/meta-security-isafw +++ b/meta-security-isafw @@ -1 +1 @@ -Subproject commit 15f46506b7b59b511d7379204f9b64351a3d7b4c +Subproject commit 489abdc65cefb566d696c8b218aa0b9b99a350ae From 79bde35cc76fef7f575c4c8fb254427e071a8b6e Mon Sep 17 00:00:00 2001 From: Tuomas Katila Date: Mon, 12 Jun 2017 13:49:09 +0300 Subject: [PATCH 3/9] append: fix _append rules where there is no whitespace after '"' Signed-off-by: Tuomas Katila --- .../recipes-image/images/refkit-image-computervision.bb | 4 ++-- meta-refkit-core/conf/distro/include/refkit-config.inc | 2 +- meta-refkit-core/recipes-connectivity/avahi/avahi_%.bbappend | 2 +- .../recipes-connectivity/bluez5/bluez5_5%.bbappend | 2 +- meta-refkit-core/recipes-images/images/refkit-image-common.bb | 4 ++-- .../recipes-image/images/refkit-image-gateway.bb | 4 ++-- meta-refkit/lib/oeqa/selftest/cases/refkit_poky.py | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/meta-refkit-computervision/recipes-image/images/refkit-image-computervision.bb b/meta-refkit-computervision/recipes-image/images/refkit-image-computervision.bb index 76223a809b..66829eda27 100644 --- a/meta-refkit-computervision/recipes-image/images/refkit-image-computervision.bb +++ b/meta-refkit-computervision/recipes-image/images/refkit-image-computervision.bb @@ -15,7 +15,7 @@ REFKIT_IMAGE_COMPUTERVISION_EXTRA_FEATURES += "${@ '' if (d.getVar('IMAGE_MODE') # Example for customization in local.conf when building # refkit-image-computervision.bb: # IMAGE_BASENAME_pn-refkit-image-computervision = "my-refkit-image-reference" -# REFKIT_IMAGE_COMPUTERVISION_EXTRA_INSTALL_append = "my-own-package" -# REFKIT_IMAGE_COMPUTERVISION_EXTRA_FEATURES_append = "dev-pkgs" +# REFKIT_IMAGE_COMPUTERVISION_EXTRA_INSTALL_append = " my-own-package" +# REFKIT_IMAGE_COMPUTERVISION_EXTRA_FEATURES_append = " dev-pkgs" inherit refkit-image diff --git a/meta-refkit-core/conf/distro/include/refkit-config.inc b/meta-refkit-core/conf/distro/include/refkit-config.inc index bca8fdbee8..9653ad6256 100644 --- a/meta-refkit-core/conf/distro/include/refkit-config.inc +++ b/meta-refkit-core/conf/distro/include/refkit-config.inc @@ -107,7 +107,7 @@ BAD_RECOMMENDATIONS_append_refkit-config = " bluez5-client" # Prefer systemd way of creating getty@.service symlinks using # systemd-getty-generator (instead of the Yocto default # systemd-serialgetty that creates everything in do_install). -PACKAGECONFIG_append_pn-systemd_refkit-config = "serial-getty-generator" +PACKAGECONFIG_append_pn-systemd_refkit-config = " serial-getty-generator" # OE-core 7355a3c4f665e066925ea6327ac72365ab1f2f39 added a PACKAGECONFIG # to configure cairo/python3-cairo and enabled it by default. It used to diff --git a/meta-refkit-core/recipes-connectivity/avahi/avahi_%.bbappend b/meta-refkit-core/recipes-connectivity/avahi/avahi_%.bbappend index 4b2af2141b..38773997c9 100644 --- a/meta-refkit-core/recipes-connectivity/avahi/avahi_%.bbappend +++ b/meta-refkit-core/recipes-connectivity/avahi/avahi_%.bbappend @@ -5,7 +5,7 @@ RRECOMMENDS_avahi-daemon_remove_libc-glibc_refkit-config = " libnss-mdns" RRECOMMENDS_${PN}_remove_libc-glibc_refkit-config = " libnss-mdns" # provide libdns_sd.so and dns_sd.h header -EXTRA_OECONF_append_refkit-config = "--enable-compat-libdns_sd" +EXTRA_OECONF_append_refkit-config = " --enable-compat-libdns_sd" FILES_${PN}_append_refkit-config = " \ ${libdir}/libdns_sd.* \ diff --git a/meta-refkit-core/recipes-connectivity/bluez5/bluez5_5%.bbappend b/meta-refkit-core/recipes-connectivity/bluez5/bluez5_5%.bbappend index 75b3daead2..0865d65a96 100644 --- a/meta-refkit-core/recipes-connectivity/bluez5/bluez5_5%.bbappend +++ b/meta-refkit-core/recipes-connectivity/bluez5/bluez5_5%.bbappend @@ -4,4 +4,4 @@ DEPENDS_remove_refkit-config = "libusb" # split bluetoothctl into a subpackage PACKAGES_prepend_refkit-config = "${PN}-client " FILES_${PN}-client = "${@bb.utils.contains('PACKAGECONFIG', 'readline', '${bindir}/bluetoothctl', '', d)}" -RRECOMMENDS_${PN}_append_refkit-config += "${PN}-client" +RRECOMMENDS_${PN}_append_refkit-config = " ${PN}-client" diff --git a/meta-refkit-core/recipes-images/images/refkit-image-common.bb b/meta-refkit-core/recipes-images/images/refkit-image-common.bb index 93d6614251..2aa2eb6e44 100644 --- a/meta-refkit-core/recipes-images/images/refkit-image-common.bb +++ b/meta-refkit-core/recipes-images/images/refkit-image-common.bb @@ -26,7 +26,7 @@ REFKIT_IMAGE_EXTRA_INSTALL += "${REFKIT_IMAGE_COMMON_EXTRA_INSTALL}" # # Example for customization in local.conf when building refkit-image-common.bb: # IMAGE_BASENAME_pn-refkit-image-common = "my-refkit-image-reference" -# REFKIT_IMAGE_COMMON_EXTRA_INSTALL_append = "my-own-package" -# REFKIT_IMAGE_COMMON_EXTRA_FEATURES_append = "dev-pkgs" +# REFKIT_IMAGE_COMMON_EXTRA_INSTALL_append = " my-own-package" +# REFKIT_IMAGE_COMMON_EXTRA_FEATURES_append = " dev-pkgs" inherit refkit-image diff --git a/meta-refkit-gateway/recipes-image/images/refkit-image-gateway.bb b/meta-refkit-gateway/recipes-image/images/refkit-image-gateway.bb index cc452c65ce..831d4a2bb3 100644 --- a/meta-refkit-gateway/recipes-image/images/refkit-image-gateway.bb +++ b/meta-refkit-gateway/recipes-image/images/refkit-image-gateway.bb @@ -11,7 +11,7 @@ REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES_append = " iotivity nodejs-runtime bluetooth # Example for customization in local.conf when building # refkit-image-gateway.bb: # IMAGE_BASENAME_pn-refkit-image-gateway = "my-refkit-image-gateway" -# REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL_append = "my-own-package" -# REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES_append = "dev-pkgs" +# REFKIT_IMAGE_GATEWAY_EXTRA_INSTALL_append = " my-own-package" +# REFKIT_IMAGE_GATEWAY_EXTRA_FEATURES_append = " dev-pkgs" inherit refkit-image diff --git a/meta-refkit/lib/oeqa/selftest/cases/refkit_poky.py b/meta-refkit/lib/oeqa/selftest/cases/refkit_poky.py index adb865ae69..abd710bb15 100644 --- a/meta-refkit/lib/oeqa/selftest/cases/refkit_poky.py +++ b/meta-refkit/lib/oeqa/selftest/cases/refkit_poky.py @@ -236,7 +236,7 @@ def test_common_poky_config(self): # We need an image that we can log into, so zap the root password. self.append_config(''' -REFKIT_IMAGE_EXTRA_FEATURES_append = "empty-root-password" +REFKIT_IMAGE_EXTRA_FEATURES_append = " empty-root-password" ''') bitbake('refkit-image-common') with runqemu('refkit-image-common', From ff5687716bf61d294fdb1bd5981dfd779fc15271 Mon Sep 17 00:00:00 2001 From: Sudarsana Nagineni Date: Tue, 13 Jun 2017 16:06:25 +0300 Subject: [PATCH 4/9] meta-oic: update to latest HEAD. * meta-oic b9ba736...c8e87a3 (6): > doc: Translate README to ascii > Add Notification service and Easy Setup enrollee files and libraries > iotivity_1.2.1: Sanitize URIs to support older yocto versions > iotivity_1.2.0: Sanitize URIs to support older yocto versions > iotivity_1.1.1: Sanitize URIs to support older yocto versions > Add recipe for IoTivity 1.2.1 Signed-off-by: Sudarsana Nagineni --- meta-oic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-oic b/meta-oic index b9ba736871..c8e87a3fe8 160000 --- a/meta-oic +++ b/meta-oic @@ -1 +1 @@ -Subproject commit b9ba736871b8f8b741cc9c1d88dda56e63a35091 +Subproject commit c8e87a3fe82531371938b96a70584794496410a2 From f684b10712d7e988aaaadd8f2215c6bda294ab89 Mon Sep 17 00:00:00 2001 From: Sudarsana Nagineni Date: Tue, 13 Jun 2017 16:07:20 +0300 Subject: [PATCH 5/9] meta-iot-web: update to latest HEAD. * meta-iot-web e4310f8...1e515ff (11): > Merge pull request #42 from nagineni/update_restserver > iot-rest-api-server.bb: Update iot-rest-api-server to latest > Merge pull request #41 from TizenTeam:sandbox/pcoval/on/master/latest > iotivity-node: Update to 1.2.1-1 > Merge pull request #40 from nagineni/update_node > recipes-web: Update iotivity-node and iot-rest-api-server to latest version > nodejs: Upgrade to latest LTS v6.11.0 > Merge pull request #35 from gunnarx/add_arm64_squashed > Support aarch64 targets by passing arm64 to npm > Merge pull request #36 from nagineni/update_license > Update license to proper. Signed-off-by: Sudarsana Nagineni --- meta-iot-web | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-iot-web b/meta-iot-web index e4310f8a34..1e515ff48e 160000 --- a/meta-iot-web +++ b/meta-iot-web @@ -1 +1 @@ -Subproject commit e4310f8a34a985fa62eb66c7742088dc7943bedb +Subproject commit 1e515ff48e9d4960e10876b846cfbd9d8b094daa From 7297bd7c52792ebe886e9acf98c5e6efcd98e998 Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Wed, 7 Jun 2017 08:06:29 +0300 Subject: [PATCH 6/9] images: reduce image conversions Some image conversions are redundant and can be skipped in favor of optimizing CI build-times. It's enough to compress in xz format only. For download integrity checking, we use xz's built-in mechanism and change it to use sha256. Signed-off-by: Mikko Ylinen --- docker/tester-exec.sh | 7 +------ meta-refkit/conf/distro/include/refkit-ci.inc | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/docker/tester-exec.sh b/docker/tester-exec.sh index 91985fc217..e5948b1a7c 100755 --- a/docker/tester-exec.sh +++ b/docker/tester-exec.sh @@ -77,13 +77,8 @@ testimg() { wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.bmap wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.xz -O - | unxz - > ${FILENAME} if [ ! -s ${FILENAME} ]; then - wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.zip - if [ -s ${FILENAME}.zip ]; then - unzip ${FILENAME}.zip - else - echo "ERROR: No file ${FILENAME}.xz or ${FILENAME}.zip found, can not continue." + echo "ERROR: No file ${FILENAME}.xz, can not continue." exit 1 - fi fi set -e diff --git a/meta-refkit/conf/distro/include/refkit-ci.inc b/meta-refkit/conf/distro/include/refkit-ci.inc index cd48d70ef7..1fa89bbdff 100644 --- a/meta-refkit/conf/distro/include/refkit-ci.inc +++ b/meta-refkit/conf/distro/include/refkit-ci.inc @@ -44,7 +44,8 @@ require conf/distro/include/refkit-development.inc # If we can access /dev/kvm, then let's use it. QEMU_USE_KVM = "${@ 'intel-corei7-64 intel-core2-32 qemux86 qemux86-64' if os.access('/dev/kvm', os.R_OK|os.W_OK) else '' }" -REFKIT_VM_IMAGE_TYPES = "wic.xz wic.zip wic.bmap wic.xz.sha256sum" +XZ_INTEGRITY_CHECK = "sha256" +REFKIT_VM_IMAGE_TYPES = "wic.xz wic.bmap" # # pre/post-build oe-selftests started by CI builder, whitespace-separated. From 4b441353cf7bad68b99174b47ff2d95e37f1e422 Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Wed, 7 Jun 2017 08:48:57 +0300 Subject: [PATCH 7/9] image_types_extra.bbclass: drop as unused zip image conversion is already part of OE-core and the vdi format isn't used so it's safe to drop image_types_extra completely. Signed-off-by: Mikko Ylinen --- docker/build-common-util.sh | 1 - meta-refkit-core/classes/image_types_extra.bbclass | 10 ---------- meta-refkit-core/classes/refkit-image.bbclass | 2 -- 3 files changed, 13 deletions(-) delete mode 100644 meta-refkit-core/classes/image_types_extra.bbclass diff --git a/docker/build-common-util.sh b/docker/build-common-util.sh index 394e9cad6f..1114b5c320 100644 --- a/docker/build-common-util.sh +++ b/docker/build-common-util.sh @@ -38,7 +38,6 @@ EOF fi # lower compression levels in a PR build, to save build time if [ -z ${CI_ARCHIVER_MODE+x} ]; then - echo "ZIP_COMPRESSION_LEVEL ?= \"-1\"" >> conf/auto.conf echo "XZ_COMPRESSION_LEVEL ?= \"-0\"" >> conf/auto.conf fi } diff --git a/meta-refkit-core/classes/image_types_extra.bbclass b/meta-refkit-core/classes/image_types_extra.bbclass deleted file mode 100644 index 499cfeddad..0000000000 --- a/meta-refkit-core/classes/image_types_extra.bbclass +++ /dev/null @@ -1,10 +0,0 @@ -# IoT Reference OS Kit custom conversion types - -CONVERSIONTYPES_append = " vdi" -CONVERSION_CMD_vdi = "qemu-img convert -O vdi ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.vdi" -CONVERSION_DEPENDS_vdi = "qemu-native" - -CONVERSIONTYPES_append = " zip" -ZIP_COMPRESSION_LEVEL ?= "-9" -CONVERSION_CMD_zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" -CONVERSION_DEPENDS_zip = "zip-native" diff --git a/meta-refkit-core/classes/refkit-image.bbclass b/meta-refkit-core/classes/refkit-image.bbclass index da59c0bd67..bad901477a 100644 --- a/meta-refkit-core/classes/refkit-image.bbclass +++ b/meta-refkit-core/classes/refkit-image.bbclass @@ -212,8 +212,6 @@ NOISO = "1" REFKIT_QB_DRIVE_TYPE = "/dev/vd" QB_DRIVE_TYPE = "${REFKIT_QB_DRIVE_TYPE}" -inherit image_types_extra - # Replace the default "live" (aka HDDIMG) images with whole-disk images REFKIT_VM_IMAGE_TYPES ?= "" IMAGE_FSTYPES_append = " ${REFKIT_VM_IMAGE_TYPES}" From a1c56210dcd4ded6021bcd8917396c9a2dfd2b65 Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Wed, 7 Jun 2017 09:27:10 +0300 Subject: [PATCH 8/9] images: remove custom dsk image format wic image format has been the default for some time now and it's time to remove the unused custom dsk image format. image-dsk.bbclass is kept since do_uefiapp is still used but modified to: * work with empty DSK_IMAGE_LAYOUT (set as default) * not provide IMAGE_CMD_dsk anymore Signed-off-by: Mikko Ylinen --- meta-refkit-core/classes/image-dsk.bbclass | 97 ++--------- meta-refkit-core/lib/image-dsk.py | 180 --------------------- meta-refkit/conf/layer.conf | 6 - 3 files changed, 12 insertions(+), 271 deletions(-) delete mode 100644 meta-refkit-core/lib/image-dsk.py diff --git a/meta-refkit-core/classes/image-dsk.bbclass b/meta-refkit-core/classes/image-dsk.bbclass index 7eae234d24..82d5765ab0 100644 --- a/meta-refkit-core/classes/image-dsk.bbclass +++ b/meta-refkit-core/classes/image-dsk.bbclass @@ -5,25 +5,6 @@ # it with the efi stub obtained from systemd-boot. # The layout of the image is described in a separate, customizable json file. -# A layout files is built accordingly to the following example: -# { -# "gpt_initial_offset_mb": 3, <- Space allocated for the 1st GPT -# "gpt_tail_padding_mb": 3, <- Space allocated for the 2nd GPT -# "primary_uefi_boot_partition": { <-- Name of the entry in the dictionary -# "name": "primary_uefi", <-- Name of the partition in the GPT (MAX 16 ch) -# "uuid": 0, <-- UUID of the partition, 0 means random -# "size_mb": 30, <-- Size of the partition in MB -# "source": "${S}/hdd/boot", <-- Directory containing the root for the partition -# "filesystem": "vfat", <-- Filesystem for the partition -# "type": "ef00" <-- Type of the partition, to be used in the GPT -# }, -# [...] Iterate partitions as needed -# } -# -# The main rootfs partition is a special case and must be named "rootfs". -# This is required to identify it and pass its Partition UUID to the kernel, for booting. - - # By default, the full image is meant to fit into 4*10^9 bytes, i.e. # "4GB" regardless whether 1000 or 1024 is used as base. 64M are reserved # for potential partitioning overhead. @@ -49,16 +30,6 @@ do_uefiapp[depends] += " \ ${INITRD_IMAGE}:do_image_complete \ " -IMAGE_DEPENDS_dsk += " \ - gptfdisk-native:do_populate_sysroot \ - parted-native:do_populate_sysroot \ - mtools-native:do_populate_sysroot \ - dosfstools-native:do_populate_sysroot \ - dosfstools-native:do_populate_sysroot \ - python-native:do_populate_sysroot \ - bmap-tools-native:do_populate_sysroot \ - " - # Always ensure that the INITRD_IMAGE gets added to the initramfs .cpio. # This needs to be done even when the actual .dsk image format is inactive, # because the .cpio file gets copied into the rootfs, and that rootfs @@ -77,35 +48,7 @@ REMOVABLE_MEDIA_ROOTFS_PARTUUID_VALUE ?= "deadbeef-dead-beef-dead-beefdeadbeef" PARTITION_TYPE_EFI = "EF00" PARTITION_TYPE_EFI_BACKUP = "2700" -DSK_IMAGE_LAYOUT ??= ' \ -{ \ - "gpt_initial_offset_mb": 3, \ - "gpt_tail_padding_mb": 3, \ - "partition_01_primary_uefi_boot": { \ - "name": "primary_uefi", \ - "uuid": 0, \ - "size_mb": ${REFKIT_VFAT_MB}, \ - "source": "${IMAGE_ROOTFS}/boot/", \ - "filesystem": "vfat", \ - "type": "${PARTITION_TYPE_EFI}" \ - }, \ - "partition_02_secondary_uefi_boot": { \ - "name": "secondary_uefi", \ - "uuid": 0, \ - "size_mb": ${REFKIT_VFAT_MB}, \ - "source": "${IMAGE_ROOTFS}/boot/", \ - "filesystem": "vfat", \ - "type": "${PARTITION_TYPE_EFI_BACKUP}" \ - }, \ - "partition_03_rootfs": { \ - "name": "rootfs", \ - "uuid": "${REMOVABLE_MEDIA_ROOTFS_PARTUUID_VALUE}", \ - "size_mb": 3700, \ - "source": "${IMAGE_ROOTFS}", \ - "filesystem": "ext4", \ - "type": "8300" \ - } \ -}' +DSK_IMAGE_LAYOUT ??= '{}' inherit deploy @@ -140,9 +83,10 @@ export PART_%(pnum)d_FS=%(filesystem)s partition_table = json.loads(layout) full_image_size_mb = partition_table["gpt_initial_offset_mb"] + \ - partition_table["gpt_tail_padding_mb"] + partition_table["gpt_tail_padding_mb"] \ + if partition_table else 0 - rootfs_type = None + rootfs_type = '' pnum = 0 for key in sorted(partition_table.keys()): if not isinstance(partition_table[key], dict): @@ -154,7 +98,7 @@ export PART_%(pnum)d_FS=%(filesystem)s partition_table[key]['uuid'] = str(uuid.uuid4()) # Store these for the creation of the UEFI binary if partition_table[key]['name'] == 'rootfs': - rootfs_type = partition_table[key]['filesystem'] + rootfs_type = 'rootfstype=%s ' % partition_table[key]['filesystem'] int_part_uuid = d.getVar('INT_STORAGE_ROOTFS_PARTUUID_VALUE', True) else: int_part_uuid = partition_table[key]["uuid"] @@ -168,8 +112,8 @@ export PART_%(pnum)d_FS=%(filesystem)s } pnum = pnum + 1 - assert rootfs_type is not None - partition_data += "export PART_COUNT=%d\n" % pnum + if pnum > 0: + partition_data += "export PART_COUNT=%d\n" % pnum if os.path.exists(d.expand('${B}/initrd')): os.remove(d.expand('${B}/initrd')) @@ -188,7 +132,7 @@ export PART_%(pnum)d_FS=%(filesystem)s def generate_app(partuuid, cmdline, suffix): with open(d.expand('${B}/cmdline' + suffix + '.txt'), 'w') as f: - f.write(d.expand('${APPEND} root=PARTUUID=%s rootfstype=%s %s' % \ + f.write(d.expand('${APPEND} root=PARTUUID=%s %s%s' % \ (partuuid, rootfs_type, cmdline))) check_call(d.expand('objcopy ' + '--add-section .osrel=${B}/machine.txt ' + @@ -209,9 +153,10 @@ export PART_%(pnum)d_FS=%(filesystem)s generate_app(d.getVar('REMOVABLE_MEDIA_ROOTFS_PARTUUID_VALUE', True), "installer", "") generate_app(d.getVar('INT_STORAGE_ROOTFS_PARTUUID_VALUE', True), "", "_internal_storage") - with open(d.expand('${B}/emmc-partitions-data'), 'w') as emmc_part_data: - emmc_part_data.write(partition_data) - shutil.copyfile(d.expand('${B}/emmc-partitions-data'), d.expand('${DEPLOYDIR}/emmc-partitions-data')) + if partition_data: + with open(d.expand('${B}/emmc-partitions-data'), 'w') as emmc_part_data: + emmc_part_data.write(partition_data) + shutil.copyfile(d.expand('${B}/emmc-partitions-data'), d.expand('${DEPLOYDIR}/emmc-partitions-data')) # The RMC database is deployed unconditionally but not read if the BIOS is in SecureBoot mode. # XXX: However, the check for SecureBoot is not present. The bug is tracked in @@ -280,21 +225,3 @@ do_rootfs[depends] += '${@bb.utils.contains('IMAGE_FEATURES','secureboot','sbsig ROOTFS_POSTPROCESS_COMMAND += " ${@bb.utils.contains('IMAGE_FEATURES','secureboot','uefiapp_sign;','',d)} " ROOTFS_POSTPROCESS_COMMAND += " uefiapp_deploy; " - -# All variables explicitly passed to image-dsk.py. -IMAGE_DSK_VARIABLES = " \ - APPEND \ - IMGDEPLOYDIR \ - DSK_IMAGE_LAYOUT \ - IMAGE_LINK_NAME \ - IMAGE_NAME \ - IMAGE_ROOTFS \ - ROOTFS_TYPE \ - REMOVABLE_MEDIA_ROOTFS_PARTUUID_VALUE \ - PARTITION_TYPE_EFI \ - PARTITION_TYPE_EFI_BACKUP \ - S \ -" - -IMAGE_CMD_dsk = "${PYTHON} ${IMAGE_DSK_BASE}/lib/image-dsk.py ${@' '.join(["'%s=%s'" % (x, d.getVar(x, True) or '') for x in d.getVar('IMAGE_DSK_VARIABLES', True).split()])}" -IMAGE_CMD_dsk[vardeps] = "${IMAGE_DSK_VARIABLES}" diff --git a/meta-refkit-core/lib/image-dsk.py b/meta-refkit-core/lib/image-dsk.py deleted file mode 100644 index 2bddc5f9da..0000000000 --- a/meta-refkit-core/lib/image-dsk.py +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/env python -# -# Image creation class for GPT multi-partioned disk images for EFI systems. -# -# Copyright (C) 2015-2016 Intel Corporation -# Licensed under the MIT license - -import json -import os -import sys -import shutil -from re import sub -from glob import glob -from uuid import uuid4 -from subprocess import check_call -from bmaptools import Filemap - -VARS = dict([x.split('=', 1) for x in sys.argv[1:]]) - - -def lookup_var(varname, location=None): - """Look up a variable in the parameters or the environment.""" - if varname in VARS: - return VARS[varname] - if varname in os.environ: - return os.environ[varname] - exit("image-dsk.py: variable %s%s not passed by image-dsk.bbclass," - " add it to the parameters." % - (varname, ("used in " + location) if location else "")) - - -def symlink(src, dst): - """Helper for symlink housekeeping.""" - if os.path.exists(dst): - os.remove(dst) - os.symlink(src, dst) - - -def populate_rawcopy(src, dst): - """Argument src is a raw partition generated elsewhere.""" - shutil.copyfile(src, dst) - - -def populate_vfat(src, dst): - """Create and populate a FAT partition, out of a root directory .""" - check_call(['mkdosfs', dst]) - """this requires shell expansion for wildcard - check_call(['mcopy', '-i', dst, '-s', src + '/*', '::/'])""" - os.system('mcopy -i ' + dst + ' -s ' + src + '/* ::/') - - -def populate_ext4(src, dst): - """Create and populate an ext4 partition out of a root directory .""" - check_call(['mkfs.ext4', '-F', dst] + (['-d', src] if src else [])) - - -def expand_vars(arg_string, location=None): - """Expand variables in arg_string.""" - return sub(r'\$\{([^}]+)\}', lambda x: lookup_var(x.group(1), location), - arg_string) - - -def truncate_mib(fname, fsize): - """Create sparse file with requested size (in MiB).""" - with open(fname, "a+b") as fobj: - fobj.truncate(int(fsize) * 1024 * 1024) - - -def sparse_copy(src_fname, dst_fname, offset_mib=0): - """Efficiently copy sparse file to or into another file.""" - filemap = Filemap.filemap(src_fname) - try: - dst_file = open(dst_fname, 'r+b') - except IOError: - dst_file = open(dst_fname, 'wb') - - for first, last in filemap.get_mapped_ranges(0, filemap.blocks_cnt): - start = first * filemap.block_size - end = (last + 1) * filemap.block_size - - filemap._f_image.seek(start, os.SEEK_SET) - dst_file.seek((offset_mib * 1024 * 1024) + start, os.SEEK_SET) - - chunk_size = 1024 * 1024 - to_read = end - start - read = 0 - - while read < to_read: - if read + chunk_size > to_read: - chunk_size = to_read - read - chunk = filemap._f_image.read(chunk_size) - dst_file.write(chunk) - read += chunk_size - dst_file.close() - - -def do_dsk_image(): - """Entry point for generating the disk image.""" - # Load the descripton of the disk layout. - partition_table = json.loads(expand_vars('${DSK_IMAGE_LAYOUT}')) - - # Before adding up the size of each partition, add the size of the GPT - full_image_size_mb = partition_table["gpt_initial_offset_mb"] + \ - partition_table["gpt_tail_padding_mb"] - - # The rootfs is special, because its PARTUUID must be aligned with - # the kernel command line, to allow pivot-rooting. - for key in sorted(partition_table.iterkeys()): - if not isinstance(partition_table[key], dict): - continue - # Calculate the total image size. - full_image_size_mb += partition_table[key]["size_mb"] - # Generate randomized uuids, if required (uuid == 0) - # Otherwise leave whatever was set in the configuration file. - if str(partition_table[key]['uuid']) == '0': - partition_table[key]['uuid'] = str(uuid4()).lower() - # Store these for the creation of the UEFI binary - if partition_table[key]['name'] == 'rootfs': - # The rootfs partuuid is not randomized, because it is required - # by the command line embedded in the efi-combo-binary - # and it might be even preferrable to fix it to specific values - # for each product. - # Default to lower case, to avoid issues from camelcase. - partition_table[key]["uuid"] = \ - expand_vars("${REMOVABLE_MEDIA_ROOTFS_PARTUUID_VALUE}").lower() - - # Save to disk the layout with the PARTUUIDs used, to facilitate the - # job of accessing programmatically individual partitions. - disk_layout_file = \ - os.path.join(expand_vars("${IMGDEPLOYDIR}"), - expand_vars('${IMAGE_NAME}-disk-layout.json')) - disk_layout_file_link = \ - os.path.join(expand_vars("${IMGDEPLOYDIR}"), - expand_vars('${IMAGE_LINK_NAME}-disk-layout.json')) - with open(disk_layout_file, 'w') as disk_layout: - json.dump(obj=partition_table, fp=disk_layout, - indent=4, separators=(',', ': ')) - symlink(expand_vars('${IMAGE_NAME}-disk-layout.json'), - disk_layout_file_link) - - # First step in creating the full disk image: loop file + GPT partition. - full_image_name = \ - os.path.join(expand_vars("${IMGDEPLOYDIR}"), - expand_vars('${IMAGE_NAME}.dsk')) - truncate_mib(full_image_name, full_image_size_mb) - check_call(['sgdisk', '-o', full_image_name]) - - partition_start_mb = partition_table["gpt_initial_offset_mb"] - for key in sorted(partition_table.iterkeys()): - if not isinstance(partition_table[key], dict): - continue - # Generate even more auxiliary variable - partition_logical_name = str(partition_table[key]["name"]) - partition_size_mb = partition_table[key]["size_mb"] - partition_name = expand_vars("${IMAGE_NAME}") + '.' + \ - partition_table[key]["name"] + ".part" - partition_type = expand_vars(partition_table[key]["type"]) - full_partition_name = \ - os.path.join(expand_vars("${IMGDEPLOYDIR}"), partition_name) - # Create the temporary loop file for hostong the partition. - truncate_mib(full_partition_name, partition_size_mb) - # Populate the partition accordingly to its parameters. - eval('populate_' + str(partition_table[key]["filesystem"]) + - '("' + expand_vars(partition_table[key]["source"]) + '", "' + - full_partition_name + '")') - # Allocate space for the partition in the image loop file. - check_call(['sgdisk', '-c=0:' + partition_logical_name, - '-n=0:' + str(partition_start_mb) + 'M:+' + - str(partition_size_mb) + 'M', - '-t=0:' + partition_type, - '-u=0:' + str(partition_table[key]["uuid"]), - full_image_name]) - sparse_copy(full_partition_name, full_image_name, partition_start_mb) - # Remove the partition, now that it exists in the disk image. - if os.path.exists(full_partition_name): - os.remove(full_partition_name) - partition_start_mb += partition_table[key]["size_mb"] - -if __name__ == "__main__": - do_dsk_image() diff --git a/meta-refkit/conf/layer.conf b/meta-refkit/conf/layer.conf index 4a7b638e1f..9ba5d9ecda 100644 --- a/meta-refkit/conf/layer.conf +++ b/meta-refkit/conf/layer.conf @@ -11,15 +11,9 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/fixes/*/recipes-*/*/*/*.bbappend \ " -# Set a variable to get to the top of the metadata location -IMAGE_DSK_BASE := '${LAYERDIR}' - # Set a variable to get to the top of the IoT Reference OS Kit metadata location. META_REFKIT_BASE := '${LAYERDIR}' -# Used by image-dsk.bbclass to find lib/image-dsk.py. -IMAGE_DSK_BASE ?= '${META_REFKIT_BASE}' - # Required by stateless.bbclass to find patches needed only when # compiling stateless. STATELESS_PATCHES_BASE ?= "${META_REFKIT_BASE}/conf/distro/stateless-patches" From 4d0104d44f380caedf203b13baefa73811c41783 Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Wed, 14 Jun 2017 10:41:16 +0300 Subject: [PATCH 9/9] refkit-ci.inc: don't compress images in post selftesting Post-build testing builds images but only .wic is sufficient (default in IMAGE_FSTYPES). We skip compression and bmap formats for oe-selftests to optimize testing time. [YOCTO: #11506] Signed-off-by: Mikko Ylinen --- docker/post-build.sh | 5 +++++ meta-refkit-core/classes/refkit-image.bbclass | 2 +- meta-refkit/conf/distro/include/refkit-ci.inc | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/post-build.sh b/docker/post-build.sh index 09c81d00c7..f63b0baadd 100755 --- a/docker/post-build.sh +++ b/docker/post-build.sh @@ -28,6 +28,11 @@ set -u # create auto.conf using functions in build-common-util.sh auto_conf_common +# post-build testing builds images but only .wic is sufficient +# (default in IMAGE_FSTYPES). We skip compression and bmap formats +# to optimize testing time +echo "REFKIT_VM_IMAGE_TYPES = \"\"" >> conf/auto.conf + export BUILD_ID=${CI_BUILD_ID} export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE BUILD_ID" diff --git a/meta-refkit-core/classes/refkit-image.bbclass b/meta-refkit-core/classes/refkit-image.bbclass index bad901477a..7b354070be 100644 --- a/meta-refkit-core/classes/refkit-image.bbclass +++ b/meta-refkit-core/classes/refkit-image.bbclass @@ -213,7 +213,7 @@ REFKIT_QB_DRIVE_TYPE = "/dev/vd" QB_DRIVE_TYPE = "${REFKIT_QB_DRIVE_TYPE}" # Replace the default "live" (aka HDDIMG) images with whole-disk images -REFKIT_VM_IMAGE_TYPES ?= "" +REFKIT_VM_IMAGE_TYPES ??= "" IMAGE_FSTYPES_append = " ${REFKIT_VM_IMAGE_TYPES}" # unconditionally set in x86-base.inc so we just remove it to avoid diff --git a/meta-refkit/conf/distro/include/refkit-ci.inc b/meta-refkit/conf/distro/include/refkit-ci.inc index 1fa89bbdff..c44b6eba23 100644 --- a/meta-refkit/conf/distro/include/refkit-ci.inc +++ b/meta-refkit/conf/distro/include/refkit-ci.inc @@ -45,7 +45,7 @@ require conf/distro/include/refkit-development.inc QEMU_USE_KVM = "${@ 'intel-corei7-64 intel-core2-32 qemux86 qemux86-64' if os.access('/dev/kvm', os.R_OK|os.W_OK) else '' }" XZ_INTEGRITY_CHECK = "sha256" -REFKIT_VM_IMAGE_TYPES = "wic.xz wic.bmap" +REFKIT_VM_IMAGE_TYPES ?= "wic.xz wic.bmap" # # pre/post-build oe-selftests started by CI builder, whitespace-separated.