Skip to contentSkip to conversation

unwanted linux kernel image added to /boot directory

OE-core Scott Branden 4 participants 5 messages Mar 16, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

It appears that inherit of the kernel_do_install routine is called which causes the linux image to be installed in /boot. I added a quick and dirty hack to inhibit this behaviour. Could someone please comment on a proper solution:

meta/classes/kernel.bbclass +3 -1
index ddff2ddcd2..527f6ca85d 100644
@@ -428,7 +428,9 @@ kernel_do_install() {
 
        for imageType in ${KERNEL_IMAGETYPES} ; do
                if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
-                       install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       if [ "${INHIBIT_IMAGE_IN_BOOT}" != "1" ] ; then
+                               install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       fi
                fi
        done
 
Quoted 19 lines · Scott Branden via lists.openembedded.org

Hello,

There seems to be a problem when a kernel module is added to an initramfs image.

As soon as I add a recipe which installs an external kernel module into an initramfs image it automatically installs the linux kernel image in a /boot directory.

This is really bad as it increases the size of the initramfs image.

/boot/Image should not be installed in the image when an external kernel module is added to an image.

Can someone suggest a fix to this issue?

Thanks,
Scott

#2 lore raw

Hi

Am Montag, den 15.03.2021, 20:13 -0700 schrieb Scott Branden via lists.openembedded.org:

Quoted 22 lines

It appears that inherit of the kernel_do_install routine is called which causes the linux image to be installed in /boot. I added a quick and dirty hack to inhibit this behaviour. Could someone please comment on a proper solution:

meta/classes/kernel.bbclass +3 -1
index ddff2ddcd2..527f6ca85d 100644
@@ -428,7 +428,9 @@ kernel_do_install() {
 
        for imageType in ${KERNEL_IMAGETYPES} ; do
                if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
-                       install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType
 ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       if [ "${INHIBIT_IMAGE_IN_BOOT}" != "1" ] ; then
+                               install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType
 ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       fi
                fi

done

Quoted 15 lines
Quoted 14 lines · Scott Branden via lists.openembedded.org

Hello,

There seems to be a problem when a kernel module is added to an initramfs image.

As soon as I add a recipe which installs an external kernel module into an initramfs image it automatically installs the linux kernel image in a /boot directory.

This is really bad as it increases the size of the initramfs image.

/boot/Image should not be installed in the image when an external kernel module is added to an image.

Can someone suggest a fix to this issue?

One usually does in the machine configuration:

RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""

Max

#3 lore raw
Quoted 39 lines · Max Krummenacher

Hi

Am Montag, den 15.03.2021, 20:13 -0700 schrieb Scott Branden via lists.openembedded.org:

Quoted 35 lines

It appears that inherit of the kernel_do_install routine is called which causes the linux image to be installed in /boot. I added a quick and dirty hack to inhibit this behaviour. Could someone please comment on a proper solution:

meta/classes/kernel.bbclass +3 -1
index ddff2ddcd2..527f6ca85d 100644
@@ -428,7 +428,9 @@ kernel_do_install() {
 
        for imageType in ${KERNEL_IMAGETYPES} ; do
                if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
-                       install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType
 ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       if [ "${INHIBIT_IMAGE_IN_BOOT}" != "1" ] ; then
+                               install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType
 ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       fi
                fi

done

Quoted 12 lines · Scott Branden via lists.openembedded.org

Hello,

There seems to be a problem when a kernel module is added to an initramfs image.

As soon as I add a recipe which installs an external kernel module into an initramfs image it automatically installs the linux kernel image in a /boot directory.

This is really bad as it increases the size of the initramfs image.

/boot/Image should not be installed in the image when an external kernel module is added to an image.

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

Can someone suggest a fix to this issue?

One usually does in the machine configuration:

RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""

this should work too.

Quoted 6 lines

Max

#4 lore raw
Quoted 40 lines · Khem Raj
Quoted 39 lines · Max Krummenacher

Hi

Am Montag, den 15.03.2021, 20:13 -0700 schrieb Scott Branden via lists.openembedded.org:

Quoted 35 lines

It appears that inherit of the kernel_do_install routine is called which causes the linux image to be installed in /boot. I added a quick and dirty hack to inhibit this behaviour. Could someone please comment on a proper solution:

meta/classes/kernel.bbclass +3 -1
index ddff2ddcd2..527f6ca85d 100644
@@ -428,7 +428,9 @@ kernel_do_install() {
 
        for imageType in ${KERNEL_IMAGETYPES} ; do
                if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
-                       install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType
 ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       if [ "${INHIBIT_IMAGE_IN_BOOT}" != "1" ] ; then
+                               install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType
 ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       fi
                fi

done

Quoted 12 lines · Scott Branden via lists.openembedded.org

Hello,

There seems to be a problem when a kernel module is added to an initramfs image.

As soon as I add a recipe which installs an external kernel module into an initramfs image it automatically installs the linux kernel image in a /boot directory.

This is really bad as it increases the size of the initramfs image.

/boot/Image should not be installed in the image when an external kernel module is added to an image.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

Can someone suggest a fix to this issue?

One usually does in the machine configuration:

RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""

this should work too.

That will affect all the images, not just the specific initramfs:
https://lists.openembedded.org/g/openembedded-core/message/149546

Signature · 1 line
Denys
#5 lore raw
In reply to Scott Branden
Quoted 3 lines · Scott Branden via lists.openembedded.org

It appears that inherit of the kernel_do_install routine is called which causes the linux image to be installed in /boot. I added a quick and dirty hack to inhibit this behaviour. Could someone please comment on a proper solution:

Your change is incorrect - the code below installs the kernel image to be packaged into corresponding binary package (rpm/ipk/deb) and has nothing to do with installing it into your rootfs/initramfs. So, you are basically "neutering" kernel image package, making it empty for any rootfs that tries to use it.

Quoted 35 lines
meta/classes/kernel.bbclass +3 -1
index ddff2ddcd2..527f6ca85d 100644
@@ -428,7 +428,9 @@ kernel_do_install() {
 
        for imageType in ${KERNEL_IMAGETYPES} ; do
                if [ $imageType != "fitImage" ] || [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ] ; then
-                       install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       if [ "${INHIBIT_IMAGE_IN_BOOT}" != "1" ] ; then
+                               install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
+                       fi
                fi
        done
 
Quoted 18 lines · Scott Branden via lists.openembedded.org

Hello,

There seems to be a problem when a kernel module is added to an initramfs image.

As soon as I add a recipe which installs an external kernel module into an initramfs image it automatically installs the linux kernel image in a /boot directory.

This is really bad as it increases the size of the initramfs image.

/boot/Image should not be installed in the image when an external kernel module is added to an image.

Can someone suggest a fix to this issue?

Thanks,
Scott

Signature · 4 lines
Regards,
Denys Dmytriyenko <[email protected]>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964