Skip to contentSkip to conversation

kernel.bbclass: Create symbolic link to add ${KERNEL_IMAGETYPE} to boot package

PATCH In review Franklin S. Cooper Jr 2 participants 3 messages Aug 20, 2013 – Sep 24, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kernel.bbclass: Create symbolic link to add ${KERNEL_IMAGETYPE} to boot package

* By default for some platforms U-boot assumes the kernel image is located in the boot directory of the root filesystem.
* The kernel.bbclass already includes the kernel image in the /boot directory but adds a version number to the file name.
* Create a symbolic link that names the kernel image in the exact way that U-boot expects.

---
Version 2 changes:
Change "ln -s" to "ln -sf" based on Bruce's comment.

 meta/classes/kernel.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
meta/classes/kernel.bbclass +1 -0
index e039dfc..6e7d994 100644
@@ -109,6 +109,7 @@ kernel_do_install() {
 	install -d ${D}/${KERNEL_IMAGEDEST}
 	install -d ${D}/boot
 	install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+	ln      -sf ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}
 	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
 	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
 	install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 6 lines · Franklin S. Cooper Jr

* By default for some platforms U-boot assumes the kernel image is located in the boot directory of the root filesystem.
* The kernel.bbclass already includes the kernel image in the /boot directory but adds a version number to the file name.
* Create a symbolic link that names the kernel image in the exact way that U-boot expects.

This should be done with a package post-install script. It is fairly common for multilib kernel versions to be installed on a machine at the same time, with the Link pointing to the 'last-installed' version. Doing it in the do_install rule will cause a conflict (at least in the RPM case), preventing certain field upgrade activities.

post install script with something like:

ln -sf $D/boot/<kernel_name> <common-name>

Should work.

(The above assumes that the kernel itself is being packaged.. if it's not being packages and just copied to the end image -- then doing the link should be fine.)

--Mark

Quoted 21 lines

---
Version 2 changes:
Change "ln -s" to "ln -sf" based on Bruce's comment.

  meta/classes/kernel.bbclass |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
meta/classes/kernel.bbclass +1 -0
index e039dfc..6e7d994 100644
@@ -109,6 +109,7 @@ kernel_do_install() {
  	install -d ${D}/${KERNEL_IMAGEDEST}
  	install -d ${D}/boot
  	install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+	ln      -sf ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}
  	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
  	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
  	install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
#2 lore raw
Quoted 3 lines · Mark Hatle
Quoted 1 line · Franklin S. Cooper Jr

* By default for some platforms U-boot assumes the kernel image is

located in

Quoted 2 lines
Quoted 2 lines

the boot directory of the root filesystem.
* The kernel.bbclass already includes the kernel image in the /boot

directory

Quoted 5 lines
Quoted 3 lines

but adds a version number to the file name.
* Create a symbolic link that names the kernel image in the exact way that U-boot expects.

This should be done with a package post-install script. It is fairly

common for

Quoted 1 line

multilib kernel versions to be installed on a machine at the same time,

with the

Quoted 1 line

Link pointing to the 'last-installed' version. Doing it in the do_install

rule

Quoted 10 lines

will cause a conflict (at least in the RPM case), preventing certain field upgrade activities.

post install script with something like:

ln -sf $D/boot/≤kernel_name> <common-name>

Should work.

(The above assumes that the kernel itself is being packaged.. if it's not

being

Quoted 1 line

packages and just copied to the end image -- then doing the link should be

fine.)

Quoted 2 lines

--

Looks like the below patch addresses my issue and also handles it in the same way you recommended.

kernel.bbclass: Correct post(inst|rm) package association OE Core Commit: 35f538b117e3387354d2dab1f22c3de28ab1322b

Quoted 9 lines
Quoted 9 lines

---
Version 2 changes:
Change "ln -s" to "ln -sf" based on Bruce's comment.

  meta/classes/kernel.bbclass |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 8 lines

meta/classes/kernel.bbclass kernel_do_install() {

Quoted 8 lines
meta/classes/kernel.bbclass +0 -0
index e039dfc..6e7d994 100644
 <at>  <at>  -109,6 +109,7  <at>  <at>  kernel_do_install() {
  	install -d ${D}/${KERNEL_IMAGEDEST}
  	install -d ${D}/boot
  	install -m 0644 ${KERNEL_OUTPUT}

${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}

Quoted 1 line

meta/classes/kernel.bbclass

Quoted 1 line
meta/classes/kernel.bbclass +1 -0
+	ln      -sf

${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}

Quoted 5 lines
Quoted 4 lines
  	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
  	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
  	install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}