diff options
-rw-r--r-- | classes/kernel.bbclass | 21 | ||||
-rw-r--r-- | recipes-core/busybox/busybox_%.bbappend | 58 |
2 files changed, 22 insertions, 57 deletions
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 984f514..1fa1eb6 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -68,9 +68,13 @@ base_do_unpack_append () { if s != kernsrc: bb.utils.mkdirhier(kernsrc) bb.utils.remove(kernsrc, recurse=True) - import subprocess - subprocess.call(d.expand("mv ${S} ${STAGING_KERNEL_DIR}"), shell=True) - os.symlink(kernsrc, s) + if d.getVar("EXTERNALSRC", True): + # With EXTERNALSRC S will not be wiped so we can symlink to it + os.symlink(s, kernsrc) + else: + import shutil + shutil.move(s, kernsrc) + os.symlink(kernsrc, s) } inherit kernel-arch deploy @@ -213,6 +217,14 @@ do_compile_kernelmodules() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then oe_runmake -C ${B} ${PARALLEL_MAKE} modules CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} + + # Module.symvers gets updated during the + # building of the kernel modules. We need to + # update this in the shared workdir since some + # external kernel modules has a dependency on + # other kernel modules and will look at this + # file to do symbol lookups + cp Module.symvers ${STAGING_KERNEL_BUILDDIR}/ else bbnote "no modules to compile" fi @@ -372,6 +384,7 @@ RDEPENDS_kernel = "kernel-base" # not wanted in images as standard RDEPENDS_kernel-base ?= "kernel-image" PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}" +RDEPENDS_kernel-image += "${@base_conditional('KERNEL_IMAGETYPE', 'vmlinux', 'kernel-vmlinux', '', d)}" PKG_kernel-base = "kernel-${@legitimize_package_name('${KERNEL_VERSION}')}" RPROVIDES_kernel-base += "kernel-${KERNEL_VERSION}" ALLOW_EMPTY_kernel = "1" @@ -419,7 +432,7 @@ do_strip() { gawk '{print $1}'` for str in ${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}; do { - if [ "$headers" != *"$str"* ]; then + if ! (echo "$headers" | grep -q "^$str$"); then bbwarn "Section not found: $str"; fi diff --git a/recipes-core/busybox/busybox_%.bbappend b/recipes-core/busybox/busybox_%.bbappend index 1c6ab1c..3c3d7f0 100644 --- a/recipes-core/busybox/busybox_%.bbappend +++ b/recipes-core/busybox/busybox_%.bbappend @@ -128,36 +128,6 @@ do_install () { fi } -python do_package_prepend () { - # We need to load the full set of busybox provides from the /etc/busybox.links - # Use this to see the update-alternatives with the right information - - dvar = d.getVar('D', True) - pn = d.getVar('PN', True) - def set_alternative_vars(links, target): - f = open('%s%s' % (dvar, links), 'r') - for alt_link_name in f: - alt_link_name = alt_link_name.strip() - alt_name = os.path.basename(alt_link_name) - # Match coreutils - if alt_name == '[': - alt_name = 'lbracket' - d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) - d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) - if os.path.exists('%s%s' % (dvar, target)): - d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) - f.close() - return - - base_bindir = d.getVar('base_bindir', True) - - if os.path.exists('%s/etc/busybox.links' % (dvar)): - set_alternative_vars("/etc/busybox.links", base_bindir + "/busybox") - else: - set_alternative_vars("/etc/busybox.links.nosuid", base_bindir + "/busybox.nosuid") - set_alternative_vars("/etc/busybox.links.suid", base_bindir + "/busybox.suid") -} - pkg_postinst_${PN} () { # This part of code is dedicated to the on target upgrade problem. # It's known that if we don't make appropriate symlinks before update-alternatives calls, @@ -175,33 +145,15 @@ pkg_postinst_${PN} () { while read link; do if test ! -e "$link"; then # we can use busybox here because even if we are using splitted busybox - # we've made a symlink from ${base_bindir}/busybox to ${base_bindir}/busybox.nosuid. + # we've made a symlink from /bin/busybox to /bin/busybox.nosuid. + # The sed expression will fail if ${base_bindir}, ${base_sbindir}, ${bindir} or + # ${sbindir} contains . or .., so don't do that! + to="$(echo -n "$link" | busybox sed -r -e 's@^/[^/]+/@@' -e 's@[^/]+@..@g')${base_bindir}/busybox$suffix" busybox rm -f $link - busybox ln -s ${base_bindir}/busybox$suffix $link + busybox ln -s $to $link fi done < /etc/busybox.links$suffix fi done fi } - -pkg_prerm_${PN} () { - # This is so you can make busybox commit suicide - removing busybox with no other packages - # providing its files, this will make update-alternatives work, but the update-rc.d part - # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh - tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX` - ln -s ${base_bindir}/busybox $tmpdir/[ - ln -s ${base_bindir}/busybox $tmpdir/test - ln -s ${base_bindir}/busybox $tmpdir/head - ln -s ${base_bindir}/busybox $tmpdir/sh - ln -s ${base_bindir}/busybox $tmpdir/basename - ln -s ${base_bindir}/busybox $tmpdir/echo - ln -s ${base_bindir}/busybox $tmpdir/mv - ln -s ${base_bindir}/busybox $tmpdir/ln - ln -s ${base_bindir}/busybox $tmpdir/dirname - ln -s ${base_bindir}/busybox $tmpdir/rm - ln -s ${base_bindir}/busybox $tmpdir/sed - ln -s ${base_bindir}/busybox $tmpdir/sort - ln -s ${base_bindir}/busybox $tmpdir/grep - export PATH=$PATH:$tmpdir -} |