diff options
Diffstat (limited to 'meta/classes')
30 files changed, 143 insertions, 80 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index bd0d6e3ca6..3014767b8a 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -100,8 +100,8 @@ def get_lic_checksum_file_list(d): # We only care about items that are absolute paths since # any others should be covered by SRC_URI. try: - path = bb.fetch.decodeurl(url)[2] - if not path: + (method, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) + if method != "file" or not path: raise bb.fetch.MalformedUrl(url) if path[0] == '/': diff --git a/meta/classes/clutter.bbclass b/meta/classes/clutter.bbclass index 167407dfdc..f5cd04f97f 100644 --- a/meta/classes/clutter.bbclass +++ b/meta/classes/clutter.bbclass @@ -14,7 +14,7 @@ REALNAME = "${@get_real_name("${BPN}")}" CLUTTER_SRC_FTP = "${GNOME_MIRROR}/${REALNAME}/${VERMINOR}/${REALNAME}-${PV}.tar.xz;name=archive" -CLUTTER_SRC_GIT = "git://git.gnome.org/${REALNAME}" +CLUTTER_SRC_GIT = "git://gitlab.gnome.org/GNOME/${REALNAME};protocol=https" SRC_URI = "${CLUTTER_SRC_FTP}" S = "${WORKDIR}/${REALNAME}-${PV}" diff --git a/meta/classes/gio-module-cache.bbclass b/meta/classes/gio-module-cache.bbclass index a8190b7b89..e429bd3197 100644 --- a/meta/classes/gio-module-cache.bbclass +++ b/meta/classes/gio-module-cache.bbclass @@ -9,6 +9,7 @@ if [ "x$D" != "x" ]; then mlprefix=${MLPREFIX} \ binprefix=${MLPREFIX} \ libdir=${libdir} \ + libexecdir=${libexecdir} \ base_libdir=${base_libdir} \ bindir=${bindir} else diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass index 7a388d5c60..1623c15988 100644 --- a/meta/classes/image-live.bbclass +++ b/meta/classes/image-live.bbclass @@ -40,7 +40,7 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ LABELS_LIVE ?= "boot install" ROOT_LIVE ?= "root=/dev/ram0" -INITRD_IMAGE_LIVE ?= "core-image-minimal-initramfs" +INITRD_IMAGE_LIVE ?= "${MLPREFIX}core-image-minimal-initramfs" INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz" LIVE_ROOTFS_TYPE ?= "ext4" @@ -92,7 +92,7 @@ build_iso() { for fs in ${INITRD} do if [ ! -s "$fs" ]; then - bbnote "ISO image will not be created. $fs is invalid." + bbwarn "ISO image will not be created. $fs is invalid." return fi done diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index d93de02b75..d88ce5c07f 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -441,6 +441,8 @@ python () { # This means the task's hash can be stable rather than having hardcoded # date/time values. It will get expanded at execution time. # Similarly TMPDIR since otherwise we see QA stamp comparision problems + # Expand PV else it can trigger get_srcrev which can fail due to these variables being unset + localdata.setVar('PV', d.getVar('PV')) localdata.delVar('DATETIME') localdata.delVar('DATE') localdata.delVar('TMPDIR') diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index d09d1277ea..e881d0cc2d 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass @@ -104,7 +104,7 @@ IMAGE_CMD_btrfs () { size=${MIN_BTRFS_SIZE} bbwarn "Rootfs size is too small for BTRFS. Filesystem will be extended to ${size}K" fi - dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs count=${size} bs=1024 + dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs seek=${size} count=0 bs=1024 mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs } diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass index 222ae00433..dcf620cee0 100644 --- a/meta/classes/image_types_wic.bbclass +++ b/meta/classes/image_types_wic.bbclass @@ -41,6 +41,9 @@ WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH} do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}" do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('parted', 'gptfdisk', 'dosfstools', 'mtools'))}" +# We ensure all artfacts are deployed (e.g virtual/bootloader) +do_image_wic[recrdeptask] += "do_deploy" + WKS_FILE_DEPENDS_DEFAULT = "syslinux-native bmap-tools-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native" WKS_FILE_DEPENDS_BOOTLOADERS = "" WKS_FILE_DEPENDS_BOOTLOADERS_x86 = "syslinux grub-efi systemd-boot" diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass index d036fcf20c..c7b33d99ff 100644 --- a/meta/classes/kernel-arch.bbclass +++ b/meta/classes/kernel-arch.bbclass @@ -25,6 +25,8 @@ def map_kernel_arch(a, d): elif re.match('armeb$', a): return 'arm' elif re.match('aarch64$', a): return 'arm64' elif re.match('aarch64_be$', a): return 'arm64' + elif re.match('aarch64_ilp32$', a): return 'arm64' + elif re.match('aarch64_be_ilp32$', a): return 'arm64' elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'mips' elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc' elif re.match('sh(3|4)$', a): return 'sh' diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index 179185b6b2..9baf399f2e 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass @@ -7,9 +7,12 @@ python __anonymous () { depends = "%s u-boot-mkimage-native dtc-native" % depends d.setVar("DEPENDS", depends) - if d.getVar("UBOOT_ARCH") == "mips": + uarch = d.getVar("UBOOT_ARCH") + if uarch == "arm64": + replacementtype = "Image" + elif uarch == "mips": replacementtype = "vmlinuz.bin" - elif d.getVar("UBOOT_ARCH") == "x86": + elif uarch == "x86": replacementtype = "bzImage" else: replacementtype = "zImage" diff --git a/meta/classes/kernel-uboot.bbclass b/meta/classes/kernel-uboot.bbclass index 87f02654fa..2364053f31 100644 --- a/meta/classes/kernel-uboot.bbclass +++ b/meta/classes/kernel-uboot.bbclass @@ -3,6 +3,10 @@ uboot_prep_kimage() { vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux" linux_suffix="" linux_comp="none" + elif [ -e arch/${ARCH}/boot/Image ] ; then + vmlinux_path="vmlinux" + linux_suffix="" + linux_comp="none" elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then rm -f linux.bin cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index 1d447951c4..663c6557d9 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass @@ -107,20 +107,31 @@ do_kernel_metadata() { cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" if [ $? -ne 0 ]; then bbwarn "defconfig detected in WORKDIR. ${KBUILD_DEFCONFIG} skipped" + else + cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig fi else cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig - sccs="${WORKDIR}/defconfig" fi + sccs="${WORKDIR}/defconfig" else bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree" fi fi - sccs="$sccs ${@" ".join(find_sccs(d))}" + sccs_from_src_uri="${@" ".join(find_sccs(d))}" patches="${@" ".join(find_patches(d))}" feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}" + # a quick check to make sure we don't have duplicate defconfigs + # If there's a defconfig in the SRC_URI, did we also have one from + # the KBUILD_DEFCONFIG processing above ? + if [ -n "$sccs" ]; then + # we did have a defconfig from above. remove any that might be in the src_uri + sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '{ if ($0!="defconfig") { print $0 } }' RS=' ') + fi + sccs="$sccs $sccs_from_src_uri" + # check for feature directories/repos/branches that were part of the # SRC_URI. If they were supplied, we convert them into include directives # for the update part of the process @@ -146,7 +157,7 @@ do_kernel_metadata() { if [ -z "$bsp_definition" ]; then echo "$sccs" | grep -q defconfig if [ $? -ne 0 ]; then - bberror "Could not locate BSP definition for ${KMACHINE}/${LINUX_KERNEL_TYPE} and no defconfig was provided" + bbfatal_log "Could not locate BSP definition for ${KMACHINE}/${LINUX_KERNEL_TYPE} and no defconfig was provided" fi fi meta_dir=$(kgit --meta) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 756707a3c2..14f41e9b17 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -595,19 +595,27 @@ do_strip[dirs] = "${B}" addtask strip before do_sizecheck after do_kernel_link_images # Support checking the kernel size since some kernels need to reside in partitions -# with a fixed length or there is a limit in transferring the kernel to memory +# with a fixed length or there is a limit in transferring the kernel to memory. +# If more than one image type is enabled, warn on any that don't fit but only fail +# if none fit. do_sizecheck() { if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'` if [ -n "$invalid" ]; then - die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)" + die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integer (The unit is Kbytes)" fi + at_least_one_fits= for type in ${KERNEL_IMAGETYPES} ; do size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk '{print $1}'` if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then - warn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device. Please reduce the size of the kernel by making more of it modular." + bbwarn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device." + else + at_least_one_fits=y fi done + if [ -z "$at_least_one_fits" ]; then + die "All kernel images are too big for your device. Please reduce the size of the kernel by making more of it modular." + fi fi } do_sizecheck[dirs] = "${B}" diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index d353110464..5103ed8533 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -226,9 +226,7 @@ def get_deployed_dependencies(d): # The manifest file name contains the arch. Because we are not running # in the recipe context it is necessary to check every arch used. sstate_manifest_dir = d.getVar("SSTATE_MANIFESTS") - sstate_archs = d.getVar("SSTATE_ARCHS") - extra_archs = d.getVar("PACKAGE_EXTRA_ARCHS") - archs = list(set(("%s %s" % (sstate_archs, extra_archs)).split())) + archs = list(set(d.getVar("SSTATE_ARCHS").split())) for dep in depends: # Some recipes have an arch on their own, so we try that first. special_arch = d.getVar("PACKAGE_ARCH_pn-%s" % dep) @@ -336,7 +334,7 @@ def add_package_and_files(d): files = d.getVar('LICENSE_FILES_DIRECTORY') pn = d.getVar('PN') pn_lic = "%s%s" % (pn, d.getVar('LICENSE_PACKAGE_SUFFIX', False)) - if pn_lic in packages: + if pn_lic in packages.split(): bb.warn("%s package already existed in %s." % (pn_lic, pn)) else: # first in PACKAGES to be sure that nothing else gets LICENSE_FILES_DIRECTORY @@ -482,7 +480,9 @@ def find_license_files(d): for url in lic_files.split(): try: - (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) + (method, host, path, user, pswd, parm) = bb.fetch.decodeurl(url) + if method != "file" or not path: + raise bb.fetch.MalformedUrl() except bb.fetch.MalformedUrl: bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), url)) # We want the license filename and path diff --git a/meta/classes/logging.bbclass b/meta/classes/logging.bbclass index 06c7c31c3e..a0c94e98c7 100644 --- a/meta/classes/logging.bbclass +++ b/meta/classes/logging.bbclass @@ -86,7 +86,7 @@ bbdebug() { # Strip off the debug level and ensure it is an integer DBGLVL=$1; shift - NONDIGITS=$(echo "$DBGLVL" | tr -d [:digit:]) + NONDIGITS=$(echo "$DBGLVL" | tr -d "[:digit:]") if [ "$NONDIGITS" ]; then bbfatal "$USAGE" fi diff --git a/meta/classes/mirrors.bbclass b/meta/classes/mirrors.bbclass index 766f1cb6fa..87bba41472 100644 --- a/meta/classes/mirrors.bbclass +++ b/meta/classes/mirrors.bbclass @@ -1,4 +1,5 @@ MIRRORS += "\ +${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian/20180310T215105Z/pool \n \ ${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20120328T092752Z/debian/pool \n \ ${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20110127T084257Z/debian/pool \n \ ${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20090802T004153Z/debian/pool \n \ @@ -67,8 +68,8 @@ ${CPAN_MIRROR} http://search.cpan.org/CPAN/ \n \ # where git native protocol fetches may fail due to local firewall rules, etc. MIRRORS += "\ -git://anonscm.debian.org/.* git://anonscm.debian.org/git/PATH;protocol=https \n \ -git://git.gnome.org/.* git://git.gnome.org/browse/PATH;protocol=https \n \ +git://salsa.debian.org/.* git://salsa.debian.org/PATH;protocol=https \n \ +git://git.gnome.org/.* git://gitlab.gnome.org/GNOME/PATH;protocol=https \n \ git://git.savannah.gnu.org/.* git://git.savannah.gnu.org/git/PATH;protocol=https \n \ git://git.yoctoproject.org/.* git://git.yoctoproject.org/git/PATH;protocol=https \n \ git://.*/.* git://HOST/PATH;protocol=https \n \ diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass index 6fe77c01b7..c1fa3ad1c1 100644 --- a/meta/classes/module-base.bbclass +++ b/meta/classes/module-base.bbclass @@ -12,6 +12,8 @@ export CROSS_COMPILE = "${TARGET_PREFIX}" # we didn't pick the name. export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}" +DEPENDS += "bc-native" + export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}" KERNEL_OBJECT_SUFFIX = ".ko" @@ -23,5 +25,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" do_make_scripts() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \ - -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts + HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" \ + -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts prepare } diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass index 78d1b21dbd..282900dc6d 100644 --- a/meta/classes/module.bbclass +++ b/meta/classes/module.bbclass @@ -2,7 +2,7 @@ inherit module-base kernel-module-split pkgconfig addtask make_scripts after do_prepare_recipe_sysroot before do_configure do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock" -do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" +do_make_scripts[depends] += "virtual/kernel:do_shared_workdir openssl-native:do_populate_sysroot" EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}" diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 2053d46395..2a5d8a5cda 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -901,7 +901,7 @@ python split_and_strip_files () { # 16 - kernel module def isELF(path): type = 0 - ret, result = oe.utils.getstatusoutput("file \"%s\"" % path.replace("\"", "\\\"")) + ret, result = oe.utils.getstatusoutput("file -b '%s'" % path) if ret: msg = "split_and_strip_files: 'file %s' failed" % path diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 1deaf832da..ad5c5e9ef7 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -646,9 +646,13 @@ python do_package_rpm () { rpmbuild = d.getVar('RPMBUILD') targetsys = d.getVar('TARGET_SYS') targetvendor = d.getVar('HOST_VENDOR') + # Too many places in dnf stack assume that arch-independent packages are "noarch". # Let's not fight against this. - package_arch = (d.getVar('PACKAGE_ARCH') or "").replace("-", "_").replace("all", "noarch") + package_arch = (d.getVar('PACKAGE_ARCH') or "").replace("-", "_") + if package_arch == "all": + package_arch = "noarch" + sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX') or "nativesdk").replace("-", "_") d.setVar('PACKAGE_ARCH_EXTEND', package_arch) pkgwritedir = d.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}') @@ -661,7 +665,7 @@ python do_package_rpm () { cmd = rpmbuild cmd = cmd + " --noclean --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'" - cmd = cmd + " --define '_builddir " + d.getVar('S') + "'" + cmd = cmd + " --define '_builddir " + d.getVar('B') + "'" cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'" cmd = cmd + " --define '_use_internal_dependency_generator 0'" cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'" diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass index 424c63cbfc..30fcefca38 100644 --- a/meta/classes/populate_sdk_base.bbclass +++ b/meta/classes/populate_sdk_base.bbclass @@ -20,6 +20,9 @@ def complementary_globs(featurevar, d): SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'doc-pkgs', '', d)}" SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}' +# List of locales to install, or "all" for all of them, or unset for none. +SDKIMAGE_LINGUAS ?= "all" + inherit rootfs_${IMAGE_PKGTYPE} SDK_DIR = "${WORKDIR}/sdk" @@ -39,7 +42,8 @@ TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= "" TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}" SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" -SDK_DEPENDS = "virtual/fakeroot-native pixz-native" +SDK_DEPENDS = "virtual/fakeroot-native pixz-native cross-localedef-native" +SDK_DEPENDS_append_libc-glibc = " nativesdk-glibc-locale" # We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it # could be set to the MACHINE_ARCH diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index 36209954a3..2dd21237e2 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass @@ -276,11 +276,12 @@ python copy_buildsystem () { # Copy uninative tarball # For now this is where uninative.bbclass expects the tarball - uninative_file = d.expand('${SDK_DEPLOY}/${BUILD_ARCH}-nativesdk-libc.tar.bz2') - uninative_checksum = bb.utils.sha256_file(uninative_file) - uninative_outdir = '%s/downloads/uninative/%s' % (baseoutpath, uninative_checksum) - bb.utils.mkdirhier(uninative_outdir) - shutil.copy(uninative_file, uninative_outdir) + if bb.data.inherits_class('uninative', d): + uninative_file = d.expand('${UNINATIVE_DLDIR}/' + d.getVarFlag("UNINATIVE_CHECKSUM", d.getVar("BUILD_ARCH")) + '/${UNINATIVE_TARBALL}') + uninative_checksum = bb.utils.sha256_file(uninative_file) + uninative_outdir = '%s/downloads/uninative/%s' % (baseoutpath, uninative_checksum) + bb.utils.mkdirhier(uninative_outdir) + shutil.copy(uninative_file, uninative_outdir) env_whitelist = (d.getVar('BB_ENV_EXTRAWHITE') or '').split() env_whitelist_values = {} @@ -656,7 +657,8 @@ fakeroot python do_populate_sdk_ext() { d.setVar('SDK_REQUIRED_UTILITIES', get_sdk_required_utilities(buildtools_fn, d)) d.setVar('SDK_BUILDTOOLS_INSTALLER', buildtools_fn) d.setVar('SDKDEPLOYDIR', '${SDKEXTDEPLOYDIR}') - + # ESDKs have a libc from the buildtools so ensure we don't ship linguas twice + d.delVar('SDKIMAGE_LINGUAS') populate_sdk_common(d) } @@ -695,7 +697,7 @@ def get_sdk_ext_rdepends(d): do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}" do_populate_sdk_ext[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends', False)} \ - buildtools-tarball:do_populate_sdk uninative-tarball:do_populate_sdk \ + buildtools-tarball:do_populate_sdk \ ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA') == '1' else ''} \ ${@'meta-extsdk-toolchain:do_locked_sigs' if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1' else ''}" @@ -719,7 +721,7 @@ SDKEXTDEPLOYDIR = "${WORKDIR}/deploy-${PN}-populate-sdk-ext" SSTATETASKS += "do_populate_sdk_ext" SSTATE_SKIP_CREATION_task-populate-sdk-ext = '1' -do_populate_sdk_ext[cleandirs] = "${SDKDEPLOYDIR}" +do_populate_sdk_ext[cleandirs] = "${SDKEXTDEPLOYDIR}" do_populate_sdk_ext[sstate-inputdirs] = "${SDKEXTDEPLOYDIR}" do_populate_sdk_ext[sstate-outputdirs] = "${SDK_DEPLOY}" do_populate_sdk_ext[stamp-extra-info] = "${MACHINE}" diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass index 13a9e75d85..31d99e4554 100644 --- a/meta/classes/rm_work.bbclass +++ b/meta/classes/rm_work.bbclass @@ -166,6 +166,10 @@ python inject_rm_work() { deps = set(bb.build.preceedtask('do_build', True, d)) deps.difference_update(('do_build', 'do_rm_work_all')) + # deps can be empty if do_build doesn't exist, e.g. *-inital recipes + if not deps: + deps = ["do_populate_sysroot", "do_populate_lic"] + if pn in excludes: d.delVarFlag('rm_work_rootfs', 'cleandirs') d.delVarFlag('rm_work_populatesdk', 'cleandirs') diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 5391e7a8e3..a4e627fef8 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -14,6 +14,14 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; " # Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}' +# We also need to do the same for the kernel boot parameters, +# otherwise kernel or initramfs end up mounting the rootfs read/write +# (the default) if supported by the underlying storage. +# +# We do this with _append because the default value might get set later with ?= +# and we don't want to disable such a default that by setting a value here. +APPEND_append = '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", " ro", "", d)}' + # Generates test data file with data store variables expanded in json format ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; " diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass index 12002c49f3..9ee1dfc866 100644 --- a/meta/classes/rootfs_deb.bbclass +++ b/meta/classes/rootfs_deb.bbclass @@ -11,6 +11,7 @@ do_rootfs[vardeps] += "PACKAGE_FEED_URIS" do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock" do_populate_sdk[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock" +do_populate_sdk_ext[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock" python rootfs_deb_bad_recommendations() { if d.getVar("BAD_RECOMMENDATIONS"): diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index a57b1d34f7..52b468d85b 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass @@ -15,6 +15,7 @@ do_rootfs[vardeps] += "PACKAGE_FEED_URIS" do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock" do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock" +do_populate_sdk_ext[lockfiles] += "${WORKDIR}/ipk.lock" OPKG_PREPROCESS_COMMANDS = "" diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass index c4b4bb9b70..1b134322fb 100644 --- a/meta/classes/systemd.bbclass +++ b/meta/classes/systemd.bbclass @@ -154,8 +154,10 @@ python systemd_populate_packages() { # Deal with adding, for example, 'ifplugd@eth0.service' from # 'ifplugd@.service' base = None - if service.find('@') != -1: - base = re.sub('@[^.]+.', '@.', service) + at = service.find('@') + if at != -1: + ext = service.rfind('.') + base = service[:at] + '@' + service[ext:] for path in searchpaths: if os.path.exists(oe.path.join(d.getVar("D"), path, service)): diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index 9bcfe708c7..c9a04dd1d9 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -62,7 +62,8 @@ toolchain_create_tree_env_script () { script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} rm -f $script touch $script - echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script + echo ". ${COREBASE}/oe-init-build-env ${TOPDIR}" >> $script + echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${STAGING_BINDIR_TOOLCHAIN}:$PATH' >> $script echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass index a410647328..de2221a365 100644 --- a/meta/classes/uninative.bbclass +++ b/meta/classes/uninative.bbclass @@ -8,6 +8,9 @@ UNINATIVE_TARBALL ?= "${BUILD_ARCH}-nativesdk-libc.tar.bz2" #UNINATIVE_CHECKSUM[x86_64] = "dead" UNINATIVE_DLDIR ?= "${DL_DIR}/uninative/" +# Enabling uninative will change the following variables so they need to go the parsing white list to prevent multiple recipe parsing +BB_HASHCONFIG_WHITELIST += "NATIVELSBSTRING SSTATEPOSTUNPACKFUNCS BUILD_LDFLAGS" + addhandler uninative_event_fetchloader uninative_event_fetchloader[eventmask] = "bb.event.BuildStarted" @@ -63,7 +66,24 @@ python uninative_event_fetchloader() { fetcher.download() localpath = fetcher.localpath(srcuri) if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath): + # Follow the symlink behavior from the bitbake fetch2. + # This will cover the case where an existing symlink is broken + # as well as if there are two processes trying to create it + # at the same time. + if os.path.islink(tarballpath): + # Broken symbolic link + os.unlink(tarballpath) + + # Deal with two processes trying to make symlink at once + try: os.symlink(localpath, tarballpath) + except FileExistsError: + pass + + # ldd output is "ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23", extract last option from first line + glibcver = subprocess.check_output(["ldd", "--version"]).decode('utf-8').split('\n')[0].split()[-1] + if bb.utils.vercmp_string(d.getVar("UNINATIVE_MAXGLIBCVERSION"), glibcver) < 0: + raise RuntimeError("Your host glibc verson (%s) is newer than that in uninative (%s). Disabling uninative so that sstate is not corrupted." % (glibcver, d.getVar("UNINATIVE_MAXGLIBCVERSION"))) cmd = d.expand("\ mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; \ @@ -82,6 +102,8 @@ ${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py \ enable_uninative(d) + except RuntimeError as e: + bb.warn(str(e)) except bb.fetch2.BBFetchException as exc: bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc)) bb.warn("To build your own uninative loader, please bitbake uninative-tarball and set UNINATIVE_TARBALL appropriately.") @@ -107,6 +129,9 @@ def enable_uninative(d): d.setVar("NATIVELSBSTRING", "universal%s" % oe.utils.host_gcc_version(d)) d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp") d.appendVarFlag("SSTATEPOSTUNPACKFUNCS", "vardepvalueexclude", "| uninative_changeinterp") + d.appendVar("BUILD_LDFLAGS", " -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER}") + d.appendVarFlag("BUILD_LDFLAGS", "vardepvalueexclude", "| -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER}") + d.appendVarFlag("BUILD_LDFLAGS", "vardepsexclude", "UNINATIVE_LOADER") d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:") python uninative_changeinterp () { diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass index 4bba76c3ba..aa01058cf9 100644 --- a/meta/classes/update-alternatives.bbclass +++ b/meta/classes/update-alternatives.bbclass @@ -143,6 +143,10 @@ python perform_packagecopy_append () { if not alt_link: alt_link = "%s/%s" % (d.getVar('bindir'), alt_name) d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link) + if alt_link.startswith(os.path.join(d.getVar('sysconfdir', True), 'init.d')): + # Managing init scripts does not work (bug #10433), foremost + # because of a race with update-rc.d + bb.fatal("Using update-alternatives for managing SysV init scripts is not supported") alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name) alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link @@ -201,8 +205,8 @@ python populate_packages_updatealternatives () { pkgdest = d.getVar('PKGD') for pkg in (d.getVar('PACKAGES') or "").split(): # Create post install/removal scripts - alt_setup_links = "# Begin section update-alternatives\n" - alt_remove_links = "# Begin section update-alternatives\n" + alt_setup_links = "" + alt_remove_links = "" for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split(): alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name) alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name) @@ -225,13 +229,10 @@ python populate_packages_updatealternatives () { # Default to generate shell script.. eventually we may want to change this... alt_target = os.path.normpath(alt_target) - alt_setup_links += 'update-alternatives --install %s %s %s %s\n' % (alt_link, alt_name, alt_target, alt_priority) - alt_remove_links += 'update-alternatives --remove %s %s\n' % (alt_name, alt_target) + alt_setup_links += '\tupdate-alternatives --install %s %s %s %s\n' % (alt_link, alt_name, alt_target, alt_priority) + alt_remove_links += '\tupdate-alternatives --remove %s %s\n' % (alt_name, alt_target) - alt_setup_links += "# End section update-alternatives\n" - alt_remove_links += "# End section update-alternatives\n" - - if len(alt_setup_links.splitlines()) > 2: + if alt_setup_links: # RDEPENDS setup provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives') if provider: @@ -241,24 +242,12 @@ python populate_packages_updatealternatives () { bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg) bb.note('%s' % alt_setup_links) postinst = d.getVar('pkg_postinst_%s' % pkg) or '#!/bin/sh\n' - postinst = postinst.splitlines(True) - try: - index = postinst.index('# Begin section update-rc.d\n') - postinst.insert(index, alt_setup_links) - except ValueError: - postinst.append(alt_setup_links) - postinst = ''.join(postinst) + postinst += alt_setup_links d.setVar('pkg_postinst_%s' % pkg, postinst) bb.note('%s' % alt_remove_links) prerm = d.getVar('pkg_prerm_%s' % pkg) or '#!/bin/sh\n' - prerm = prerm.splitlines(True) - try: - index = prerm.index('# End section update-rc.d\n') - prerm.insert(index + 1, alt_remove_links) - except ValueError: - prerm.append(alt_remove_links) - prerm = ''.join(prerm) + prerm += alt_remove_links d.setVar('pkg_prerm_%s' % pkg, prerm) } diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass index 9ba3daccaf..06e3b21396 100644 --- a/meta/classes/update-rc.d.bbclass +++ b/meta/classes/update-rc.d.bbclass @@ -37,7 +37,6 @@ fi PACKAGE_WRITE_DEPS += "update-rc.d-native" updatercd_postinst() { -# Begin section update-rc.d if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then if [ -n "$D" ]; then OPT="-r $D" @@ -46,15 +45,12 @@ if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then fi update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS} fi -# End section update-rc.d } updatercd_prerm() { -# Begin section update-rc.d if ${@use_updatercd(d)} && [ -z "$D" -a -x "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || : fi -# End section update-rc.d } updatercd_postrm() { @@ -96,7 +92,7 @@ python populate_packages_updatercd () { statement = "grep -q -w '/etc/init.d/functions' %s" % path if subprocess.call(statement, shell=True) == 0: mlprefix = d.getVar('MLPREFIX') or "" - d.appendVar('RDEPENDS_' + pkg, ' %sinitscripts-functions' % (mlprefix)) + d.appendVar('RDEPENDS_' + pkg, ' %sinitd-functions' % (mlprefix)) def update_rcd_package(pkg): bb.debug(1, 'adding update-rc.d calls to preinst/postinst/prerm/postrm for %s' % pkg) @@ -116,25 +112,13 @@ python populate_packages_updatercd () { postinst = d.getVar('pkg_postinst_%s' % pkg) if not postinst: postinst = '#!/bin/sh\n' - postinst = postinst.splitlines(True) - try: - index = postinst.index('# End section update-alternatives\n') - postinst.insert(index + 1, localdata.getVar('updatercd_postinst')) - except ValueError: - postinst.append(localdata.getVar('updatercd_postinst')) - postinst = ''.join(postinst) + postinst += localdata.getVar('updatercd_postinst') d.setVar('pkg_postinst_%s' % pkg, postinst) prerm = d.getVar('pkg_prerm_%s' % pkg) if not prerm: prerm = '#!/bin/sh\n' - prerm = prerm.splitlines(True) - try: - index = prerm.index('# Begin section update-alternatives\n') - prerm.insert(index, localdata.getVar('updatercd_prerm')) - except ValueError: - prerm.append(localdata.getVar('updatercd_prerm')) - prerm = ''.join(prerm) + prerm += localdata.getVar('updatercd_prerm') d.setVar('pkg_prerm_%s' % pkg, prerm) postrm = d.getVar('pkg_postrm_%s' % pkg) |