busybox-1.18.4 installs /bin/powertop and the powertop recipe installs
/usr/bin/powertop. So, in PATH, if /bin appears before /usr/bin, we would
run the version offered by busybox, which has a very limited function (e.g.,
no parameter is accepted) and this causes trouble to eclipse plugin.
We can use update-alternatives for powertop with higher priority to resolve
the issue.
Fixes [YOCTO #1208]
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
# powertop 1.13 needs lspci
RDEPENDS_${PN} = "pciutils"
-PR = "r0"
+PR = "r1"
SRC_URI = "http://www.lesswatts.org/projects/powertop/download/powertop-${PV}.tar.gz \
file://stub_out_the_ncurses_calls_in_dump_mode.patch"
CFLAGS += "${LDFLAGS}"
EXTRA_OEMAKE = "VERSION=\"${PV}\""
+inherit update-alternatives
+ALTERNATIVE_NAME = "powertop"
+ALTERNATIVE_PATH = "${bindir}/powertop"
+ALTERNATIVE_LINK = "${base_bindir}/powertop"
+ALTERNATIVE_PRIORITY = "100"
+
do_configure() {
# We do not build ncurses with wide char support
sed -i -e "s/lncursesw/lncurses/" ${S}/Makefile