diff options
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r-- | meta/classes/kernel.bbclass | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 91c260a1b9..b7f5fce360 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -16,6 +16,7 @@ INHIBIT_DEFAULT_DEPS = "1" | |||
16 | 16 | ||
17 | KERNEL_IMAGETYPE ?= "zImage" | 17 | KERNEL_IMAGETYPE ?= "zImage" |
18 | INITRAMFS_IMAGE ?= "" | 18 | INITRAMFS_IMAGE ?= "" |
19 | INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}" | ||
19 | INITRAMFS_TASK ?= "" | 20 | INITRAMFS_TASK ?= "" |
20 | INITRAMFS_IMAGE_BUNDLE ?= "" | 21 | INITRAMFS_IMAGE_BUNDLE ?= "" |
21 | 22 | ||
@@ -167,34 +168,34 @@ copy_initramfs() { | |||
167 | # In case the directory is not created yet from the first pass compile: | 168 | # In case the directory is not created yet from the first pass compile: |
168 | mkdir -p ${B}/usr | 169 | mkdir -p ${B}/usr |
169 | # Find and use the first initramfs image archive type we find | 170 | # Find and use the first initramfs image archive type we find |
170 | rm -f ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio | 171 | rm -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio |
171 | for img in cpio cpio.gz cpio.lz4 cpio.lzo cpio.lzma cpio.xz; do | 172 | for img in cpio cpio.gz cpio.lz4 cpio.lzo cpio.lzma cpio.xz; do |
172 | if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then | 173 | if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img" ]; then |
173 | cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img ${B}/usr/. | 174 | cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img ${B}/usr/. |
174 | case $img in | 175 | case $img in |
175 | *gz) | 176 | *gz) |
176 | echo "gzip decompressing image" | 177 | echo "gzip decompressing image" |
177 | gunzip -f ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img | 178 | gunzip -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img |
178 | break | 179 | break |
179 | ;; | 180 | ;; |
180 | *lz4) | 181 | *lz4) |
181 | echo "lz4 decompressing image" | 182 | echo "lz4 decompressing image" |
182 | lz4 -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img | 183 | lz4 -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img |
183 | break | 184 | break |
184 | ;; | 185 | ;; |
185 | *lzo) | 186 | *lzo) |
186 | echo "lzo decompressing image" | 187 | echo "lzo decompressing image" |
187 | lzop -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img | 188 | lzop -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img |
188 | break | 189 | break |
189 | ;; | 190 | ;; |
190 | *lzma) | 191 | *lzma) |
191 | echo "lzma decompressing image" | 192 | echo "lzma decompressing image" |
192 | lzma -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img | 193 | lzma -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img |
193 | break | 194 | break |
194 | ;; | 195 | ;; |
195 | *xz) | 196 | *xz) |
196 | echo "xz decompressing image" | 197 | echo "xz decompressing image" |
197 | xz -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img | 198 | xz -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img |
198 | break | 199 | break |
199 | ;; | 200 | ;; |
200 | esac | 201 | esac |
@@ -222,7 +223,7 @@ do_bundle_initramfs () { | |||
222 | tmp_path=$tmp_path" "$type"##" | 223 | tmp_path=$tmp_path" "$type"##" |
223 | fi | 224 | fi |
224 | done | 225 | done |
225 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio | 226 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio |
226 | kernel_do_compile | 227 | kernel_do_compile |
227 | # Restoring kernel image | 228 | # Restoring kernel image |
228 | for tp in $tmp_path ; do | 229 | for tp in $tmp_path ; do |
@@ -261,7 +262,7 @@ kernel_do_compile() { | |||
261 | # The old style way of copying an prebuilt image and building it | 262 | # The old style way of copying an prebuilt image and building it |
262 | # is turned on via INTIRAMFS_TASK != "" | 263 | # is turned on via INTIRAMFS_TASK != "" |
263 | copy_initramfs | 264 | copy_initramfs |
264 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio | 265 | use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio |
265 | fi | 266 | fi |
266 | for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do | 267 | for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do |
267 | oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd | 268 | oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd |