[#4883] romfs-inst.sh not work properly when install a shell script

Document created by Aaronwu Employee on Aug 30, 2013
Version 1Show Document
  • View in full screen mode

[#4883] romfs-inst.sh not work properly when install a shell script

Submitted By: Yi Li

Open Date

2009-02-10 06:10:29     Close Date

2009-02-10 21:18:34

Priority:

Medium     Assignee:

Mike Frysinger

Status:

Closed     Fixed In Release:

N/A

Found In Release:

N/A     Release:

Category:

N/A     Board:

N/A

Processor:

ALL     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

trunk

App binary format:

N/A     

Summary: romfs-inst.sh not work properly when install a shell script

Details:

 

problem happens here:

 

if [ -z "$SSTRIPTOOL" ]

then

        SSTRIPTOOL= #sstrip

fi

 

 

file_copy()

{

                if [ $rc -eq 0 -a -n "$strip" ]; then

                        ${STRIPTOOL} ${dstfile} 2>/dev/null

                        ${STRIPTOOL} -R .comment -R .note ${dstfile} 2>/dev/null

                        ${SSTRIPTOOL} ${dstfile} 2>/dev/null

                fi

 

}

 

 

"${SSTRIPTOOL} ${dstfile} 2>/dev/null" will actually become "${dstfile} 2>/dev/null" if "[ -z "$SSTRIPTOOL" ]" is true. So the romfs-inst.sh tries to execute the $(dstfile). If the $(dstfile) happens to be a shell script, it runs on host.

 

A simple but maybe bad fix:

 

Index: romfs-inst.sh

===================================================================

--- romfs-inst.sh    (revision 7698)

+++ romfs-inst.sh    (working copy)

@@ -1,4 +1,4 @@

-#!/bin/sh

+#!/bin/sh -x

#

# A tool to simplify Makefiles that need to put something

# into the ROMFS

@@ -252,7 +252,7 @@

fi   

if [ -z "$SSTRIPTOOL" ]

then

-    SSTRIPTOOL= #sstrip

+    SSTRIPTOOL=#sstrip

fi

 

shift `expr $OPTIND - 1`

 

Follow-ups

 

--- Mike Frysinger                                           2009-02-10 11:27:11

fixed in svn, thanks for pointing this out

 

--- Yi Li                                                    2009-02-10 21:18:34

fixed and close.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes