Fixed
Created: Nov 7, 2016
Updated: Sep 8, 2018
Resolved Date: Nov 13, 2016
Found In Version: 7.0.0.17,7.0.0.18
Fix Version: 7.0.0.22
Severity: Standard
Applicable for: Wind River Linux 7
Component/s: Build & Config
WRLinux (both 7.0.0.17 and 7.0.0.18 at least) on Beaglebone ARM board, the kernel alternative image RPM (kernel-alt-image-3.14.39ltsi-wr7.0.0.18-standard-3.14-r0.1.ti_am335x.rpm) is not properly built. When installed on target, its postinstall scripts will fail with the following error:
====================================================
update-alternatives: --install needs <link> <name> <path> <priority>
Usage: update-alternatives --install <link> <name> <path> <priority>
update-alternatives --remove <name> <path>
update-alternatives --help
<link> is the link pointing to the provided path (ie. /usr/bin/foo).
<name> is the name in /var/lib/opkg/alternatives/alternatives (ie. foo)
<path> is the name referred to (ie. /usr/bin/foo-extra-spiffy)
<priority> is an integer; options with higher numbers are chosen.
======================================================
As we can see from the postinstall scripts in this RPM (posted below), the update-alternatives command in the scripts missed one parameter.
------------------------------------------------------------------------------------
rpm -qp --scripts kernel-alt-image-3.14.39ltsi-wr7.0.0.18-standard-3.14-r0.1.ti_am335x.rpm
warning: kernel-alt-image-3.14.39ltsi-wr7.0.0.18-standard-3.14-r0.1.ti_am335x.rpm: Header V4 DSA/SHA1 Signature, key ID a42d4447: NOKEY
postinstall scriptlet (using /bin/sh):
# kernel-alt-image-3.14.39ltsi-wr7.0.0.18-standard - postinst
update-alternatives --install /boot/ /boot/-3.14.39ltsi-WR7.0.0.18_standard 31414 || true
postuninstall scriptlet (using /bin/sh):
# kernel-alt-image-3.14.39ltsi-wr7.0.0.18-standard - postrm
if [ "$1" = "0" ] ; then
update-alternatives --remove -3.14.39ltsi-WR7.0.0.18_standard || true
fi
------------------------------------------------------------------------------------
This issue is found during testing IoT kernel OTA update. Please refer to NOVA-666 for more details.
The root cause is that somehow KERNEL_ALT_IMAGETYPE is not set (empty) in the build procedure of the kernel alternative image RPM. The update-alternatives' parameters should be something like:
update-alternatives --install /boot/zImage zImage /boot/zImage-3.14.39ltsi-WR7.0.0.18_standard 31414
So a workaround is to set KERNEL_ALT_IMAGETYPE = "${KERNEL_IMAGETYPE}" in any kernel bb append linux-windriver_3.14.bbappend.
- configure and build an image for Beaglebone (ti-am335x as bsp)
- boot the target with the image
- try to install the kernel-alt-image-3.14.39ltsi-wr7.0.0.18-standard-3.14-r0.1.ti_am335x.rpm on the target
(probably rpm -Uv --replacepkgs kernel-alt-image-3.14.39ltsi-wr7.0.0.18-standard-3.14-r0.1.ti_am335x.rpm)
- it will fail with the error message