summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <peter.x.liu@external.atlascopco.com>2017-03-30 09:59:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-01 08:14:58 +0100
commitc09a0631b5b9d9d2a271771918fb003f5a9700f6 (patch)
tree1fb8f598ad2556ca53406593e1f8de9087cb667d
parent63c605b8413a8cd1f29926d3e604b14a9c275ca2 (diff)
downloadpoky-c09a0631b5b9d9d2a271771918fb003f5a9700f6.tar.gz
kernel.bbclass: introduce INITRAMFS_IMAGE_NAME
It defaults to ${INITRAMFS_IMAGE}-${MACHINE} if INITRAMFS_IMAGE is not empty. This allows the end users to be able to override the initramfs image name with a customized value. (From OE-Core rev: e788fb2b894852f71b1c545abde71b45b9f230dc) Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-fitimage.bbclass10
-rw-r--r--meta/classes/kernel.bbclass21
2 files changed, 16 insertions, 15 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 8ae2eb6df5..2630b47316 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -370,7 +370,7 @@ fitimage_assemble() {
370 if [ "x${ramdiskcount}" = "x1" ] ; then 370 if [ "x${ramdiskcount}" = "x1" ] ; then
371 # Find and use the first initramfs image archive type we find 371 # Find and use the first initramfs image archive type we find
372 for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do 372 for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
373 initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${img}" 373 initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
374 echo "Using $initramfs_path" 374 echo "Using $initramfs_path"
375 if [ -e "${initramfs_path}" ]; then 375 if [ -e "${initramfs_path}" ]; then
376 fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}" 376 fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}"
@@ -459,11 +459,11 @@ kernel_do_deploy_append() {
459 459
460 if [ -n "${INITRAMFS_IMAGE}" ]; then 460 if [ -n "${INITRAMFS_IMAGE}" ]; then
461 echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." 461 echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
462 its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}" 462 its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
463 its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE}-${MACHINE} 463 its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE_NAME}
464 install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its 464 install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its
465 fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}" 465 fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
466 fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE}-${MACHINE} 466 fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE_NAME}
467 install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin 467 install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin
468 fi 468 fi
469 469
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
17KERNEL_IMAGETYPE ?= "zImage" 17KERNEL_IMAGETYPE ?= "zImage"
18INITRAMFS_IMAGE ?= "" 18INITRAMFS_IMAGE ?= ""
19INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}"
19INITRAMFS_TASK ?= "" 20INITRAMFS_TASK ?= ""
20INITRAMFS_IMAGE_BUNDLE ?= "" 21INITRAMFS_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