Wind River Support Network

HomeDefectsLIN7-3336
Fixed

LIN7-3336 : wrlinux 6 - faulty usermode shutdown

Created: Mar 31, 2015    Updated: Sep 8, 2018
Resolved Date: Aug 23, 2017
Found In Version: 7.0.0.25
Fix Version: 7.0.0.26
Severity: Standard
Applicable for: Wind River Linux 7
Component/s: Userspace

Description

the usermode package provides a wrapper shutdown script which calls the halt binary from an incorrect location:

/usr/bin/halt instead of the real location /sbin/halt

Steps to Reproduce

project1 :
/ASML/WRL_60x_CGP_LATEST/wrlinux-6/wrlinux/configure --enable-reconfig=yes --enable-board=intel-x86-64 --enable-kernel=standard --enable-rootfs=glibc-small+installer-support --enable-bootimage=ext3 --enable-rm-oldimgs=yes --with-sstate-dir=../../intel-x86-64-sstate/ --enable-jobs=8 --enable-parallel-pkgbuilds=8 --with-rcpl-version=0017
make fs

project2
/ASML/WRL_60x_CGP_LATEST/wrlinux-6/wrlinux/configure --enable-reconfig=yes --enable-board=intel-x86-64 --enable-kernel=standard --enable-rootfs=wr-installer --enable-target-installer=yes --enable-bootimage=iso --with-installer-target-build=/ASML/workspace/shutdown_prjs/prj2/../prj1/export/intel-x86-64-glibc-small-standard-dist.ext3 --enable-rm-oldimgs=yes --enable-jobs=8 --enable-parallel-pkgbuilds=8 --with-rcpl-version=0017
-bash-4.1$
make fs

find export/dist -name shutdown
export/dist/var/lib/opkg/alternatives/shutdown
export/dist/sbin/shutdown
export/dist/usr/bin/shutdown

cat export/dist/usr/bin/shutdown
#!/bin/sh
# Try to do the right thing for programs that rely on "/usr/bin/shutdown -r now"
# to shut down the machine.
prog=/sbin/shutdown
now=
for flag in $* ; do
    if test ${flag} = "-h" ; then
        prog=/usr/bin/halt
    elif test ${flag} = "-r" ; then
        prog=/usr/bin/reboot
    elif test ${flag} = "now" ; then
        now=$flag
    else
        args="$args $flag"
done
if [ -z "$args" -a $prog != /sbin/shutdown ] ; then
    exec $prog $args
else
    exec /sbin/shutdown $args $now 

Other Downloads


Live chat
Online