Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] kernel-grub.bbclass: fix update bzImage failed while /boot area within root partition
@ 2013-11-11 11:56 Hongxu Jia
  2013-11-11 11:56 ` [PATCH 1/1] kernel-grub.bbclass: support " Hongxu Jia
  0 siblings, 1 reply; 2+ messages in thread
From: Hongxu Jia @ 2013-11-11 11:56 UTC (permalink / raw)
  To: openembedded-core; +Cc: saul.wold

The following changes since commit f3541226b8b1187e79dec0f6f9f3c58cedf9ac9b:

  bitbake: hob: do not display the "Package list may be incomplete!" dialog (2013-11-01 17:59:31 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib hongxu/fix-bzimage
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-bzimage

Hongxu Jia (1):
  kernel-grub.bbclass: support /boot area within root partition

 meta/classes/kernel-grub.bbclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

-- 
1.8.1.2



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] kernel-grub.bbclass: support /boot area within root partition
  2013-11-11 11:56 [PATCH 0/1] kernel-grub.bbclass: fix update bzImage failed while /boot area within root partition Hongxu Jia
@ 2013-11-11 11:56 ` Hongxu Jia
  0 siblings, 0 replies; 2+ messages in thread
From: Hongxu Jia @ 2013-11-11 11:56 UTC (permalink / raw)
  To: openembedded-core; +Cc: saul.wold

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>
---
 meta/classes/kernel-grub.bbclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-grub.bbclass b/meta/classes/kernel-grub.bbclass
index 70564f0..85721ff 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!"
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-11 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11 11:56 [PATCH 0/1] kernel-grub.bbclass: fix update bzImage failed while /boot area within root partition Hongxu Jia
2013-11-11 11:56 ` [PATCH 1/1] kernel-grub.bbclass: support " Hongxu Jia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox