On Mon, 2026-09-14 at 20:21 +0200, WXbet wrote:
> From: WXbet <[email protected]>
>
> On the target, the postinst of kernel-image-<type> creates the
> ${KERNEL_IMAGEDEST}/<type> link with a path relative to the current
> directory, and the postrm removes it the same way. opkg runs package
> scripts in the directory of its caller, so an upgrade started from any
> directory other than / makes ln fail. The fallback then copies the image
> with install, which the busybox defconfig does not enable:
>
> sh: install: command not found
>
> and the postrm leaves the link behind.
This describes two issues, we shouldn't just fix one of them. We should
also fix the on-target postinst script relying on a command that is by
default missing if you use busybox.
I think should just enable CONFIG_INSTALL in the busybox defconfig. That
shouldn't use much disk space and trying to handle the potential absense
of `install` on the device in various scripts would be a lot of work.
>
> Anchor the link location at / as the rootfs-time case anchors it at $D.
> The link target stays relative to ${KERNEL_IMAGEDEST}.
>
> Signed-off-by: WXbet <[email protected]>
> ---
>
> Notes:
> The relative path seems to date back to bb946b8cdb ("classes/kernel: Use
> a copy of image for kernel*.rpm if fs doesn't support symlinks"), which
> moved the link from do_install into the postinst. When $D is set at rootfs
> time, the link is still anchored at $D. If the on-target case is meant to
> be relative to the current directory, please let me know how package
> managers are expected to call it.
Looking at KERNEL_IMAGEDEST, it's weakly assigned in two places:
meta/classes-recipe/kernel-fit-image.bbclass:
KERNEL_IMAGEDEST ?= "/boot"
meta/classes-recipe/kernel.bbclass
KERNEL_IMAGEDEST ?= "boot"
I think the solution is to use an absolute path for this variable in
kernel.bbclass. Then the rest of this patch becomes unnecessary, but we
still need a follow up patch to enable CONFIG_INSTALL in the busybox
defconfig.
Are you able to send a v2 series fixing both issues?
Best regards,
--
Paul Barker
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#246639):
https://lists.openembedded.org/g/openembedded-core/message/246639
Mute This Topic: https://lists.openembedded.org/mt/121247994/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-