aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-grub.bbclass
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2013-11-11 19:56:54 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-20 14:02:52 +0000
commit53d342db9f9995564573715f28c3e4c9c8c68bf9 (patch)
tree92ccf2ed8772e22fa5a15e90ddec2eca0292a1af /meta/classes/kernel-grub.bbclass
parentf12e1291b51ba6692b6809570d6a9b73c70a7fe9 (diff)
downloadopenembedded-core-contrib-53d342db9f9995564573715f28c3e4c9c8c68bf9.tar.gz
kernel-grub.bbclass: support /boot area within root partition
Previously, it supported the situation that /boot area with separate boot partition: ... menuentry "Update bzImage-3.10.10-WR6.0.0.0_standard-3.10" { set root=(hd0,1) linux /bzImage-3.10.10-WR6.0.0.0_standard root=/dev/sdb1 rw ip=dhcp } ... But didn't consider the situation that /boot within root partition: ... menuentry "Update bzImage-3.10.10-WR6.0.0.0_standard-3.10" { set root=(hd0,1) linux /boot/bzImage-3.10.10-WR6.0.0.0_standard root=/dev/sdb1 rw ip=dhcp } ... This fix supported them both. [YOCTO #5514] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/kernel-grub.bbclass')
-rw-r--r--meta/classes/kernel-grub.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/kernel-grub.bbclass b/meta/classes/kernel-grub.bbclass
index 70564f010a3..85721ffd709 100644
--- a/meta/classes/kernel-grub.bbclass
+++ b/meta/classes/kernel-grub.bbclass
@@ -40,10 +40,11 @@ pkg_preinst_kernel-image_append () {
pkg_postinst_kernel-image_prepend () {
get_new_grub_cfg() {
grubcfg="$1"
+ old_image="$2"
title="Update ${KERNEL_IMAGETYPE}-${KERNEL_VERSION}-${PV}"
if [ "${grubcfg##*/}" = "grub.cfg" ]; then
rootfs=`grep " *linux \+[^ ]\+ \+root=" $grubcfg -m 1 | \
- sed "s# *linux \+[^ ]\+ \+root=# linux /${KERNEL_IMAGETYPE}-${KERNEL_VERSION} root=#"`
+ sed "s#${old_image}#${old_image%/*}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}#"`
echo "menuentry \"$title\" {"
echo " set root=(hd0,1)"
@@ -51,7 +52,7 @@ pkg_postinst_kernel-image_prepend () {
echo "}"
elif [ "${grubcfg##*/}" = "menu.list" ]; then
rootfs=`grep "kernel \+[^ ]\+ \+root=" $grubcfg -m 1 | \
- sed "s#kernel \+[^ ]\+ \+root=#kernel /${KERNEL_IMAGETYPE}-${KERNEL_VERSION} root=#"`
+ sed "s#${old_image}#${old_image%/*}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}#"`
echo "default 0"
echo "timeout 30"
@@ -79,9 +80,9 @@ pkg_postinst_kernel-image_prepend () {
fi
# Don't update grubcfg at first install while old bzImage doesn't exist.
- if [ -f "$D/boot/$old_image" ]; then
+ if [ -f "$D/boot/${old_image##*/}" ]; then
grubcfgtmp="$grubcfg.tmp"
- get_new_grub_cfg "$grubcfg" > $grubcfgtmp
+ get_new_grub_cfg "$grubcfg" "$old_image" > $grubcfgtmp
get_old_grub_cfg "$grubcfg" >> $grubcfgtmp
mv $grubcfgtmp $grubcfg
echo "Caution! Update kernel may affect kernel-module!"