diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-17 04:11:34 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-01-09 02:21:44 +0300 |
commit | 1a4b7ee28bf7413af6513fb45ad0d0736048f866 (patch) | |
tree | 79f6d8ea698cab8f2eaf4f54b793d2ca7a1451ce /poky/meta/classes/kernel.bbclass | |
parent | 5b9ede0403237c7dace972affa65cf64a1aadd0e (diff) | |
download | openbmc-1a4b7ee28bf7413af6513fb45ad0d0736048f866.tar.xz |
reset upstream subtrees to yocto 2.6
Reset the following subtrees on thud HEAD:
poky: 87e3a9739d
meta-openembedded: 6094ae18c8
meta-security: 31dc4e7532
meta-raspberrypi: a48743dc36
meta-xilinx: c42016e2e6
Also re-apply backports that didn't make it into thud:
poky:
17726d0 systemd-systemctl-native: handle Install wildcards
meta-openembedded:
4321a5d libtinyxml2: update to 7.0.1
042f0a3 libcereal: Add native and nativesdk classes
e23284f libcereal: Allow empty package
030e8d4 rsyslog: curl-less build with fmhttp PACKAGECONFIG
179a1b9 gtest: update to 1.8.1
Squashed OpenBMC subtree compatibility updates:
meta-aspeed:
Brad Bishop (1):
aspeed: add yocto 2.6 compatibility
meta-ibm:
Brad Bishop (1):
ibm: prepare for yocto 2.6
meta-ingrasys:
Brad Bishop (1):
ingrasys: set layer compatibility to yocto 2.6
meta-openpower:
Brad Bishop (1):
openpower: set layer compatibility to yocto 2.6
meta-phosphor:
Brad Bishop (3):
phosphor: set layer compatibility to thud
phosphor: libgpg-error: drop patches
phosphor: react to fitimage artifact rename
Ed Tanous (4):
Dropbear: upgrade options for latest upgrade
yocto2.6: update openssl options
busybox: remove upstream watchdog patch
systemd: Rebase CONFIG_CGROUP_BPF patch
Change-Id: I7b1fe71cca880d0372a82d94b5fd785323e3a9e7
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/classes/kernel.bbclass')
-rw-r--r-- | poky/meta/classes/kernel.bbclass | 122 |
1 files changed, 55 insertions, 67 deletions
diff --git a/poky/meta/classes/kernel.bbclass b/poky/meta/classes/kernel.bbclass index 727851401c..e04d2fe004 100644 --- a/poky/meta/classes/kernel.bbclass +++ b/poky/meta/classes/kernel.bbclass @@ -62,31 +62,36 @@ python __anonymous () { type = d.getVar('KERNEL_IMAGETYPE') or "" alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or "" types = d.getVar('KERNEL_IMAGETYPES') or "" - kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel" if type not in types.split(): types = (type + ' ' + types).strip() if alttype not in types.split(): types = (alttype + ' ' + types).strip() d.setVar('KERNEL_IMAGETYPES', types) - # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz - # typeformake lists only valid kernel make targets, and post processing can be done after the kernel - # is built (such as using gzip to compress vmlinux) - typeformake = types.replace('vmlinux.gz', 'vmlinux') - d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) + # KERNEL_IMAGETYPES may contain a mixture of image types supported directly + # by the kernel build system and types which are created by post-processing + # the output of the kernel build system (e.g. compressing vmlinux -> + # vmlinux.gz in kernel_do_compile()). + # KERNEL_IMAGETYPE_FOR_MAKE should contain only image types supported + # directly by the kernel build system. + if not d.getVar('KERNEL_IMAGETYPE_FOR_MAKE'): + typeformake = set() + for type in types.split(): + if type == 'vmlinux.gz': + type = 'vmlinux' + typeformake.add(type) + + d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', ' '.join(sorted(typeformake))) + + kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel" + imagedest = d.getVar('KERNEL_IMAGEDEST') for type in types.split(): typelower = type.lower() - imagedest = d.getVar('KERNEL_IMAGEDEST') - d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower)) - d.setVar('FILES_' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type) - d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' % (kname, typelower)) - d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower)) - d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1') image = d.getVar('INITRAMFS_IMAGE') @@ -159,7 +164,7 @@ KERNEL_RELEASE ?= "${KERNEL_VERSION}" # The directory where built kernel lies in the kernel tree KERNEL_OUTPUT_DIR ?= "arch/${ARCH}/boot" -KERNEL_IMAGEDEST = "boot" +KERNEL_IMAGEDEST ?= "boot" # # configuration @@ -224,39 +229,37 @@ copy_initramfs() { echo "Finished copy of initramfs into ./usr" } -INITRAMFS_BASE_NAME ?= "initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}" -INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME" do_bundle_initramfs () { if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then echo "Creating a kernel image with a bundled initramfs..." copy_initramfs # Backing up kernel image relies on its type(regular file or symbolic link) tmp_path="" - for type in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do - if [ -h ${KERNEL_OUTPUT_DIR}/$type ] ; then - linkpath=`readlink -n ${KERNEL_OUTPUT_DIR}/$type` - realpath=`readlink -fn ${KERNEL_OUTPUT_DIR}/$type` + for imageType in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do + if [ -h ${KERNEL_OUTPUT_DIR}/$imageType ] ; then + linkpath=`readlink -n ${KERNEL_OUTPUT_DIR}/$imageType` + realpath=`readlink -fn ${KERNEL_OUTPUT_DIR}/$imageType` mv -f $realpath $realpath.bak - tmp_path=$tmp_path" "$type"#"$linkpath"#"$realpath - elif [ -f ${KERNEL_OUTPUT_DIR}/$type ]; then - mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.bak - tmp_path=$tmp_path" "$type"##" + tmp_path=$tmp_path" "$imageType"#"$linkpath"#"$realpath + elif [ -f ${KERNEL_OUTPUT_DIR}/$imageType ]; then + mv -f ${KERNEL_OUTPUT_DIR}/$imageType ${KERNEL_OUTPUT_DIR}/$imageType.bak + tmp_path=$tmp_path" "$imageType"##" fi done use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio kernel_do_compile # Restoring kernel image for tp in $tmp_path ; do - type=`echo $tp|cut -d "#" -f 1` + imageType=`echo $tp|cut -d "#" -f 1` linkpath=`echo $tp|cut -d "#" -f 2` realpath=`echo $tp|cut -d "#" -f 3` if [ -n "$realpath" ]; then mv -f $realpath $realpath.initramfs mv -f $realpath.bak $realpath - ln -sf $linkpath.initramfs ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs + ln -sf $linkpath.initramfs ${B}/${KERNEL_OUTPUT_DIR}/$imageType.initramfs else - mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.initramfs - mv -f ${KERNEL_OUTPUT_DIR}/$type.bak ${KERNEL_OUTPUT_DIR}/$type + mv -f ${KERNEL_OUTPUT_DIR}/$imageType ${KERNEL_OUTPUT_DIR}/$imageType.initramfs + mv -f ${KERNEL_OUTPUT_DIR}/$imageType.bak ${KERNEL_OUTPUT_DIR}/$imageType fi done fi @@ -283,7 +286,7 @@ kernel_do_compile() { if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not # be set.... - if [ "$SOURCE_DATE_EPOCH" = "0" ]; then + if [ "${SOURCE_DATE_EPOCH}" = "" -o "${SOURCE_DATE_EPOCH}" = "0" ]; then olddir=`pwd` cd ${S} SOURCE_DATE_EPOCH=`git log -1 --pretty=%ct` @@ -362,10 +365,10 @@ kernel_do_install() { # install -d ${D}/${KERNEL_IMAGEDEST} install -d ${D}/boot - for type in ${KERNEL_IMAGETYPES} ; do - install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${D}/${KERNEL_IMAGEDEST}/${type}-${KERNEL_VERSION} + for imageType in ${KERNEL_IMAGETYPES} ; do + install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType} ${D}/${KERNEL_IMAGEDEST}/${imageType}-${KERNEL_VERSION} if [ "${KERNEL_PACKAGE_NAME}" = "kernel" ]; then - ln -sf ${type}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${type} + ln -sf ${imageType}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${imageType} fi done install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} @@ -637,10 +640,10 @@ do_sizecheck() { 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}'` + for imageType in ${KERNEL_IMAGETYPES} ; do + size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$imageType | awk '{print $1}'` if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then - bbwarn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device." + bbwarn "This kernel $imageType (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device." else at_least_one_fits=y fi @@ -654,16 +657,7 @@ do_sizecheck[dirs] = "${B}" addtask sizecheck before do_install after do_strip -KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" -# Don't include the DATETIME variable in the sstate package signatures -KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" -KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}" -MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" -MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" -MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz" -# Don't include the DATETIME variable in the sstate package signatures -MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz" -MODULE_TARBALL_DEPLOY ?= "1" +inherit kernel-artifact-names kernel_do_deploy() { deployDir="${DEPLOYDIR}" @@ -672,34 +666,28 @@ kernel_do_deploy() { mkdir "$deployDir" fi - for type in ${KERNEL_IMAGETYPES} ; do - base_name=${type}-${KERNEL_IMAGE_BASE_NAME} - install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} $deployDir/${base_name}.bin + for imageType in ${KERNEL_IMAGETYPES} ; do + base_name=${imageType}-${KERNEL_IMAGE_NAME} + install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType} $deployDir/${base_name}.bin + symlink_name=${imageType}-${KERNEL_IMAGE_LINK_NAME} + ln -sf ${base_name}.bin $deployDir/${symlink_name}.bin + ln -sf ${base_name}.bin $deployDir/${imageType} done + if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then - mkdir -p ${D}/lib - tar -cvzf $deployDir/${MODULE_TARBALL_BASE_NAME} -C ${D} lib - ln -sf ${MODULE_TARBALL_BASE_NAME} $deployDir/${MODULE_TARBALL_SYMLINK_NAME} + mkdir -p ${D}${root_prefix}/lib + tar -cvzf $deployDir/modules-${MODULE_TARBALL_NAME}.tgz -C ${D}${root_prefix} lib + ln -sf modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz fi - for type in ${KERNEL_IMAGETYPES} ; do - base_name=${type}-${KERNEL_IMAGE_BASE_NAME} - symlink_name=${type}-${KERNEL_IMAGE_SYMLINK_NAME} - ln -sf ${base_name}.bin $deployDir/${symlink_name}.bin - ln -sf ${base_name}.bin $deployDir/${type} - done - - cd ${B} - # Update deploy directory - for type in ${KERNEL_IMAGETYPES} ; do - if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then - echo "Copying deploy ${type} kernel-initramfs image and setting up links..." - initramfs_base_name=${type}-${INITRAMFS_BASE_NAME} - initramfs_symlink_name=${type}-initramfs-${MACHINE} - install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs $deployDir/${initramfs_base_name}.bin + if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then + for imageType in ${KERNEL_IMAGETYPES} ; do + initramfs_base_name=${imageType}-${INITRAMFS_NAME} + initramfs_symlink_name=${imageType}-${INITRAMFS_LINK_NAME} + install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType}.initramfs $deployDir/${initramfs_base_name}.bin ln -sf ${initramfs_base_name}.bin $deployDir/${initramfs_symlink_name}.bin - fi - done + done + fi } do_deploy[cleandirs] = "${DEPLOYDIR}" do_deploy[dirs] = "${DEPLOYDIR} ${B}" |