Yocto do_rootfs: Postinstall scriptlets of ['busybox'] have failed

2.4k views Asked by At

I'm building a Yocto (thud) image but I had an error during do_rootfs:

update-alternatives: Error: not linking xxx/tmp/work/cc-dey-linux/dey-image/1.0-r0/rootfs/usr/sbin/rtcwake to /bin/busybox.nosuid since xxx/tmp/work/cc-dey-linux/dey-image/1.0-r0/rootfs/usr/sbin/rtcwake exists and is not a link

then the detailed error:

ERROR: dey-image-1.0-r0 do_rootfs: Postinstall scriptlets of ['busybox'] have failed. If the intention is to defer them to first boot,
then please place them into pkg_postinst_ontarget_${PN} ().
Deferring to first boot via 'exit 1' is no longer supported.
Details of the failure are in xxx/tmp/work/cc-dey-linux/dey-image/1.0-r0/temp/log.do_rootfs.
ERROR: dey-image-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: xxx/tmp/work/cc-dey-linux/dey-image/1.0-r0/temp/log.do_rootfs.835055

in the file of log.do_rootfs.835055, it has same error log as above.

I think I have 3 options:

  1. update update-alternatives, but really don't know how
  2. do as the error message, use pkg_postinst_ontarget_${PN} ()

but what are them to "place them into pkg_postinst_ontarget_${PN} ()"?

  1. use menuconfig to disable rtcwake from busybox

Some other article says that this error is because of duplication of busybox, any side effect of this option?

Any example to show how to use pkg_postinst_ontarget_${PN} ()?

Thanks.

1

There are 1 answers

0
Oswin On

Most likely you are trying to install two version of rtcwake in your rootfs, the one from Busybox fails as the other one is already there.

Apply option 3 or find the other rtcwake to disable it.

The thing is that Yocto uses the same mechanism to install the packages in the rootfs during build as it does on the target when installing through the package manager. So the options 1 and 2 are possible if this issue occurs on target when you install an additional package (e.g. with opkg).