diff options
| -rw-r--r-- | meta/classes/kernel.bbclass | 127 |
1 files changed, 64 insertions, 63 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 74f1b7527f..0907a48fb2 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
| @@ -77,96 +77,97 @@ kernel_do_compile() { | |||
| 77 | fi | 77 | fi |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | kernel_do_stage() { | 80 | kernel_do_install() { |
| 81 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE | ||
| 82 | if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then | ||
| 83 | oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install | ||
| 84 | else | ||
| 85 | oenote "no modules to install" | ||
| 86 | fi | ||
| 87 | |||
| 88 | install -d ${D}/${KERNEL_IMAGEDEST} | ||
| 89 | install -d ${D}/boot | ||
| 90 | install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} | ||
| 91 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} | ||
| 92 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} | ||
| 93 | install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} | ||
| 94 | install -d ${D}/etc/modutils | ||
| 95 | if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then | ||
| 96 | install -d ${D}/etc/modprobe.d | ||
| 97 | fi | ||
| 98 | |||
| 99 | # Check if scripts/genksyms exists and if so, build it | ||
| 100 | if [ -e scripts/genksyms/ ]; then | ||
| 101 | oe_runmake SUBDIRS="scripts/genksyms" | ||
| 102 | fi | ||
| 103 | |||
| 104 | kerneldir=${D}/kernel/ | ||
| 81 | ASMDIR=`readlink include/asm` | 105 | ASMDIR=`readlink include/asm` |
| 82 | 106 | ||
| 83 | mkdir -p ${STAGING_KERNEL_DIR}/include/$ASMDIR | 107 | mkdir -p $kerneldir/include/$ASMDIR |
| 84 | cp -fR include/$ASMDIR/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/ | 108 | cp -fR include/$ASMDIR/* $kerneldir/include/$ASMDIR/ |
| 85 | rm -f $ASMDIR ${STAGING_KERNEL_DIR}/include/asm | 109 | rm -f $ASMDIR $kerneldir/include/asm |
| 86 | ln -sf $ASMDIR ${STAGING_KERNEL_DIR}/include/asm | 110 | ln -sf $ASMDIR $kerneldir/include/asm |
| 87 | 111 | ||
| 88 | mkdir -p ${STAGING_KERNEL_DIR}/include/asm-generic | 112 | mkdir -p $kerneldir/include/asm-generic |
| 89 | cp -fR include/asm-generic/* ${STAGING_KERNEL_DIR}/include/asm-generic/ | 113 | cp -fR include/asm-generic/* $kerneldir/include/asm-generic/ |
| 90 | 114 | ||
| 91 | mkdir -p ${STAGING_KERNEL_DIR}/include/linux | 115 | mkdir -p $kerneldir/include/linux |
| 92 | cp -fR include/linux/* ${STAGING_KERNEL_DIR}/include/linux/ | 116 | cp -fR include/linux/* $kerneldir/include/linux/ |
| 93 | 117 | ||
| 94 | mkdir -p ${STAGING_KERNEL_DIR}/include/net | 118 | mkdir -p $kerneldir/include/net |
| 95 | cp -fR include/net/* ${STAGING_KERNEL_DIR}/include/net/ | 119 | cp -fR include/net/* $kerneldir/include/net/ |
| 96 | 120 | ||
| 97 | mkdir -p ${STAGING_KERNEL_DIR}/include/pcmcia | 121 | mkdir -p $kerneldir/include/pcmcia |
| 98 | cp -fR include/pcmcia/* ${STAGING_KERNEL_DIR}/include/pcmcia/ | 122 | cp -fR include/pcmcia/* $kerneldir/include/pcmcia/ |
| 99 | 123 | ||
| 100 | for entry in drivers/crypto include/media include/acpi include/sound include/video; do | 124 | for entry in drivers/crypto include/media include/acpi include/sound include/video; do |
| 101 | if [ -d $entry ]; then | 125 | if [ -d $entry ]; then |
| 102 | mkdir -p ${STAGING_KERNEL_DIR}/$entry | 126 | mkdir -p $kerneldir/$entry |
| 103 | cp -fR $entry/* ${STAGING_KERNEL_DIR}/$entry/ | 127 | cp -fR $entry/* $kerneldir/$entry/ |
| 104 | fi | 128 | fi |
| 105 | done | 129 | done |
| 106 | 130 | ||
| 107 | if [ -d drivers/sound ]; then | 131 | if [ -d drivers/sound ]; then |
| 108 | # 2.4 alsa needs some headers from this directory | 132 | # 2.4 alsa needs some headers from this directory |
| 109 | mkdir -p ${STAGING_KERNEL_DIR}/include/drivers/sound | 133 | mkdir -p $kerneldir/include/drivers/sound |
| 110 | cp -fR drivers/sound/*.h ${STAGING_KERNEL_DIR}/include/drivers/sound/ | 134 | cp -fR drivers/sound/*.h $kerneldir/include/drivers/sound/ |
| 111 | fi | 135 | fi |
| 112 | 136 | ||
| 113 | install -m 0644 .config ${STAGING_KERNEL_DIR}/config-${KERNEL_VERSION} | 137 | install -m 0644 .config $kerneldir/config-${KERNEL_VERSION} |
| 114 | ln -sf config-${KERNEL_VERSION} ${STAGING_KERNEL_DIR}/.config | 138 | ln -sf config-${KERNEL_VERSION} $kerneldir/.config |
| 115 | ln -sf config-${KERNEL_VERSION} ${STAGING_KERNEL_DIR}/kernel-config | 139 | ln -sf config-${KERNEL_VERSION} $kerneldir/kernel-config |
| 116 | echo "${KERNEL_VERSION}" >${STAGING_KERNEL_DIR}/kernel-abiversion | 140 | echo "${KERNEL_VERSION}" >$kerneldir/kernel-abiversion |
| 117 | echo "${S}" >${STAGING_KERNEL_DIR}/kernel-source | 141 | echo "${S}" >$kerneldir/kernel-source |
| 118 | echo "${KERNEL_CCSUFFIX}" >${STAGING_KERNEL_DIR}/kernel-ccsuffix | 142 | echo "${KERNEL_CCSUFFIX}" >$kerneldir/kernel-ccsuffix |
| 119 | echo "${KERNEL_LDSUFFIX}" >${STAGING_KERNEL_DIR}/kernel-ldsuffix | 143 | echo "${KERNEL_LDSUFFIX}" >$kerneldir/kernel-ldsuffix |
| 120 | [ -e Rules.make ] && install -m 0644 Rules.make ${STAGING_KERNEL_DIR}/ | 144 | [ -e Rules.make ] && install -m 0644 Rules.make $kerneldir/ |
| 121 | [ -e Makefile ] && install -m 0644 Makefile ${STAGING_KERNEL_DIR}/ | 145 | [ -e Makefile ] && install -m 0644 Makefile $kerneldir/ |
| 122 | 146 | ||
| 123 | # Check if arch/${ARCH}/Makefile exists and install it | 147 | # Check if arch/${ARCH}/Makefile exists and install it |
| 124 | if [ -e arch/${ARCH}/Makefile ]; then | 148 | if [ -e arch/${ARCH}/Makefile ]; then |
| 125 | install -d ${STAGING_KERNEL_DIR}/arch/${ARCH} | 149 | install -d $kerneldir/arch/${ARCH} |
| 126 | install -m 0644 arch/${ARCH}/Makefile* ${STAGING_KERNEL_DIR}/arch/${ARCH} | 150 | install -m 0644 arch/${ARCH}/Makefile* $kerneldir/arch/${ARCH} |
| 127 | # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24 | 151 | # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24 |
| 128 | elif [ -e arch/x86/Makefile ]; then | 152 | elif [ -e arch/x86/Makefile ]; then |
| 129 | install -d ${STAGING_KERNEL_DIR}/arch/x86 | 153 | install -d $kerneldir/arch/x86 |
| 130 | install -m 0644 arch/x86/Makefile* ${STAGING_KERNEL_DIR}/arch/x86 | 154 | install -m 0644 arch/x86/Makefile* $kerneldir/arch/x86 |
| 131 | fi | 155 | fi |
| 132 | cp -fR include/config* ${STAGING_KERNEL_DIR}/include/ | 156 | cp -fR include/config* $kerneldir/include/ |
| 133 | # Install kernel images and system.map to staging | 157 | # Install kernel images and system.map to staging |
| 134 | [ -e vmlinux ] && install -m 0644 vmlinux ${STAGING_KERNEL_DIR}/ | 158 | [ -e vmlinux ] && install -m 0644 vmlinux $kerneldir/ |
| 135 | install -m 0644 ${KERNEL_OUTPUT} ${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE} | 159 | install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE} |
| 136 | install -m 0644 System.map ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} | 160 | install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION} |
| 137 | [ -e Module.symvers ] && install -m 0644 Module.symvers ${STAGING_KERNEL_DIR}/ | 161 | [ -e Module.symvers ] && install -m 0644 Module.symvers $kerneldir/ |
| 138 | 162 | ||
| 139 | cp -fR scripts ${STAGING_KERNEL_DIR}/ | 163 | cp -fR scripts $kerneldir/ |
| 140 | } | 164 | } |
| 141 | 165 | ||
| 142 | kernel_do_install() { | 166 | sysroot_stage_all_append() { |
| 143 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE | 167 | sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}${STAGING_KERNEL_DIR} |
| 144 | if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then | ||
| 145 | oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install | ||
| 146 | else | ||
| 147 | oenote "no modules to install" | ||
| 148 | fi | ||
| 149 | |||
| 150 | install -d ${D}/${KERNEL_IMAGEDEST} | ||
| 151 | install -d ${D}/boot | ||
| 152 | install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} | ||
| 153 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} | ||
| 154 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} | ||
| 155 | install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} | ||
| 156 | install -d ${D}/etc/modutils | ||
| 157 | if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then | ||
| 158 | install -d ${D}/etc/modprobe.d | ||
| 159 | fi | ||
| 160 | |||
| 161 | # Check if scripts/genksyms exists and if so, build it | ||
| 162 | if [ -e scripts/genksyms/ ]; then | ||
| 163 | oe_runmake SUBDIRS="scripts/genksyms" | ||
| 164 | fi | ||
| 165 | |||
| 166 | install -d ${STAGING_KERNEL_DIR} | ||
| 167 | cp -fR scripts ${STAGING_KERNEL_DIR}/ | ||
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | |||
| 170 | kernel_do_configure() { | 171 | kernel_do_configure() { |
| 171 | yes '' | oe_runmake oldconfig | 172 | yes '' | oe_runmake oldconfig |
| 172 | } | 173 | } |
| @@ -193,7 +194,7 @@ pkg_postrm_kernel () { | |||
| 193 | 194 | ||
| 194 | inherit cml1 | 195 | inherit cml1 |
| 195 | 196 | ||
| 196 | EXPORT_FUNCTIONS do_compile do_install do_stage do_configure | 197 | EXPORT_FUNCTIONS do_compile do_install do_configure |
| 197 | 198 | ||
| 198 | # kernel-base becomes kernel-${KERNEL_VERSION} | 199 | # kernel-base becomes kernel-${KERNEL_VERSION} |
| 199 | # kernel-image becomes kernel-image-${KERNEL_VERISON} | 200 | # kernel-image becomes kernel-image-${KERNEL_VERISON} |
