Skip to contentSkip to conversation

kernel: update rpm failed for the vfat

OE-core Xu, Yanfei 2 participants 4 messages Jun 12, 2020 – Jun 15, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Xu, Yanfei

author
#1 lore raw

Ping Bruce.

Quoted 22 lines · Yanfei

Hi Bruce,

I encountered an issue that updating kernel rpm package will fail when the /boot dir was mount with vfat filesystem. The root cause is vfat don't support symlink. --------cut here----------
error: unpacking of archive failed on file /boot/Image;5eda8385: cpio: symlink failed - Resource temporarily unavailable
error: kernel-image-image-5.4.43-yocto-standard-5.4.x+git0+f8c88c4331_9961cc8b79-r0.bcm_2xxx_rpi4: install failed root@bcm-2xxx-rpi4:/boot#

Currently I have two ideas to fix it:
1. we use 'install' cmd instead of 'ln -sf' in kernel_do_install to avoid generating symlink in kernel-image-image*.rpm. And then add an postinstall to this rpm. It will check if the /boot dir is vfat, if not, we remove the copy image* and make a softlink for the image.
2. we specially add an package type which doesn't contain symlink for the vfat filesystem.

For the first idea, I met an problem when I try to add pkg_postinst_packagename function in kernel.bbclass file. Due to there are not package name variables defined for the kernel-image-image.gz kernel-image-image or other type kernel images. So I can not add postinst functions statically why that how many packages and packages' name are not certainly.

Do you have any opinions about these?

Regards,
Yanfei

#2 lore raw
Quoted 2 lines · Yanfei

Ping Bruce.

Hmm, yes. I did miss the original message.

gmail isn't as effective at highlighting messages that are to me (and also to the list) as I would like.

Quoted 15 lines · Yanfei
Quoted 13 lines

Hi Bruce,

I encountered an issue that updating kernel rpm package will fail when
the /boot dir was mount with vfat filesystem. The root cause is vfat
don't support symlink.
--------cut here----------
error: unpacking of archive failed on file /boot/Image;5eda8385: cpio:
symlink failed - Resource temporarily unavailable
error:
kernel-image-image-5.4.43-yocto-standard-5.4.x+git0+f8c88c4331_9961cc8b79-r0.bcm_2xxx_rpi4:
install failed
root@bcm-2xxx-rpi4:/boot#

Quoted 5 lines
Quoted 5 lines

Currently I have two ideas to fix it:
1. we use 'install' cmd instead of 'ln -sf' in kernel_do_install to avoid generating symlink in kernel-image-image*.rpm. And then add an postinstall to this rpm. It will check if the /boot dir is vfat, if not, we remove the copy image* and make a softlink for the image.

Note that for this option, you have to make sure that it really is done in a post install or you end up with overlapping file errors in scenarios where multiple kernel packages are installed (i.e. an upgrade).

Quoted 9 lines
Quoted 9 lines

2. we specially add an package type which doesn't contain symlink for the vfat filesystem.

For the first idea, I met an problem when I try to add pkg_postinst_packagename function in kernel.bbclass file. Due to there are not package name variables defined for the kernel-image-image.gz kernel-image-image or other type kernel images. So I can not add postinst functions statically why that how many packages and packages' name are not certainly.

You can still generate the package names in python, i.e.:

        d.setVar('pkg_postinst_ontarget_%s-image-%s' % (kname,

typelower), 'ln -sf ' + type + '-${KERNEL_VERSION} /${KERNEL_IMAGEDEST}/' + type)

that's from a patch that I've had locally for a while, that deals with kernel upgrade issues.

Any logic that deals with this really does have to be on target, otherwise, information about the image (and partitions) is leaking into the packages, and you'd need to carry specific image package lists for the filesystem layout.

My suggestion for the post install is that it simply try and create the symlink, and if that fails, then do a copy. That way there's no need to detect filesystem types, etc.

You also need to ensure that you test the kernel upgrade path, since with copies, you may end up with more kernel images around boot and not get some of the implicit cleanup that you get by simply redirecting a symlink (but if you are always copying the active kernel to "image", then simply overwriting the target will get you that same cleanup).

Cheers,

Bruce

Quoted 9 lines
Quoted 9 lines

Do you have any opinions about these?

Regards,
Yanfei

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
author
#3 lore raw
Quoted 45 lines · Bruce Ashfield
Quoted 2 lines · Yanfei

Ping Bruce.

Hmm, yes. I did miss the original message.

gmail isn't as effective at highlighting messages that are to me (and also to the list) as I would like.

Quoted 15 lines · Yanfei
Quoted 13 lines

Hi Bruce,

I encountered an issue that updating kernel rpm package will fail when
the /boot dir was mount with vfat filesystem. The root cause is vfat
don't support symlink.
--------cut here----------
error: unpacking of archive failed on file /boot/Image;5eda8385: cpio:
symlink failed - Resource temporarily unavailable
error:
kernel-image-image-5.4.43-yocto-standard-5.4.x+git0+f8c88c4331_9961cc8b79-r0.bcm_2xxx_rpi4:
install failed
root@bcm-2xxx-rpi4:/boot#

Quoted 5 lines
Quoted 5 lines

Currently I have two ideas to fix it:
1. we use 'install' cmd instead of 'ln -sf' in kernel_do_install to avoid generating symlink in kernel-image-image*.rpm. And then add an postinstall to this rpm. It will check if the /boot dir is vfat, if not, we remove the copy image* and make a softlink for the image.

Note that for this option, you have to make sure that it really is done in a post install or you end up with overlapping file errors in scenarios where multiple kernel packages are installed (i.e. an upgrade).

Quoted 9 lines
Quoted 9 lines

2. we specially add an package type which doesn't contain symlink for the vfat filesystem.

For the first idea, I met an problem when I try to add pkg_postinst_packagename function in kernel.bbclass file. Due to there are not package name variables defined for the kernel-image-image.gz kernel-image-image or other type kernel images. So I can not add postinst functions statically why that how many packages and packages' name are not certainly.

Quoted 6 lines

You can still generate the package names in python, i.e.:

         d.setVar('pkg_postinst_ontarget_%s-image-%s' % (kname,

typelower), 'ln -sf ' + type + '-${KERNEL_VERSION} /${KERNEL_IMAGEDEST}/' + type)

This is a piece of very useful code!
Thanks for your detailed suggestions, and I have implemented it basicly. :)

Cheers,
Yanfei

Quoted 35 lines

that's from a patch that I've had locally for a while, that deals with kernel upgrade issues.

Any logic that deals with this really does have to be on target, otherwise, information about the image (and partitions) is leaking into the packages, and you'd need to carry specific image package lists for the filesystem layout.

My suggestion for the post install is that it simply try and create the symlink, and if that fails, then do a copy. That way there's no need to detect filesystem types, etc.

You also need to ensure that you test the kernel upgrade path, since with copies, you may end up with more kernel images around boot and not get some of the implicit cleanup that you get by simply redirecting a symlink (but if you are always copying the active kernel to "image", then simply overwriting the target will get you that same cleanup).

Cheers,

Bruce

Quoted 9 lines
Quoted 9 lines

Do you have any opinions about these?

Regards,
Yanfei

#4 lore raw
Quoted 49 lines · Yanfei
Quoted 45 lines · Bruce Ashfield
Quoted 2 lines · Yanfei

Ping Bruce.

Hmm, yes. I did miss the original message.

gmail isn't as effective at highlighting messages that are to me (and also to the list) as I would like.

Quoted 15 lines · Yanfei
Quoted 13 lines

Hi Bruce,

I encountered an issue that updating kernel rpm package will fail when
the /boot dir was mount with vfat filesystem. The root cause is vfat
don't support symlink.
--------cut here----------
error: unpacking of archive failed on file /boot/Image;5eda8385: cpio:
symlink failed - Resource temporarily unavailable
error:
kernel-image-image-5.4.43-yocto-standard-5.4.x+git0+f8c88c4331_9961cc8b79-r0.bcm_2xxx_rpi4:
install failed
root@bcm-2xxx-rpi4:/boot#

Quoted 5 lines
Quoted 5 lines

Currently I have two ideas to fix it:
1. we use 'install' cmd instead of 'ln -sf' in kernel_do_install to avoid generating symlink in kernel-image-image*.rpm. And then add an postinstall to this rpm. It will check if the /boot dir is vfat, if not, we remove the copy image* and make a softlink for the image.

Note that for this option, you have to make sure that it really is done in a post install or you end up with overlapping file errors in scenarios where multiple kernel packages are installed (i.e. an upgrade).

Quoted 9 lines
Quoted 9 lines

2. we specially add an package type which doesn't contain symlink for the vfat filesystem.

For the first idea, I met an problem when I try to add pkg_postinst_packagename function in kernel.bbclass file. Due to there are not package name variables defined for the kernel-image-image.gz kernel-image-image or other type kernel images. So I can not add postinst functions statically why that how many packages and packages' name are not certainly.

Quoted 8 lines
Quoted 6 lines

You can still generate the package names in python, i.e.:

         d.setVar('pkg_postinst_ontarget_%s-image-%s' % (kname,

typelower), 'ln -sf ' + type + '-${KERNEL_VERSION} /${KERNEL_IMAGEDEST}/' + type)

This is a piece of very useful code!
Thanks for your detailed suggestions, and I have implemented it basicly. :)

Good to hear!

If you run into problems with rpm complaining about packages that don't exist, let us know, I may have a hint or two for that as well :D I just don't know if it is a problem with the latest rpm and package.bbclass.

Bruce

Quoted 40 lines

Cheers,
Yanfei

Quoted 35 lines

that's from a patch that I've had locally for a while, that deals with kernel upgrade issues.

Any logic that deals with this really does have to be on target, otherwise, information about the image (and partitions) is leaking into the packages, and you'd need to carry specific image package lists for the filesystem layout.

My suggestion for the post install is that it simply try and create the symlink, and if that fails, then do a copy. That way there's no need to detect filesystem types, etc.

You also need to ensure that you test the kernel upgrade path, since with copies, you may end up with more kernel images around boot and not get some of the implicit cleanup that you get by simply redirecting a symlink (but if you are always copying the active kernel to "image", then simply overwriting the target will get you that same cleanup).

Cheers,

Bruce

Quoted 9 lines
Quoted 9 lines

Do you have any opinions about these?

Regards,
Yanfei

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II