Revert "build: Use the original install-sh file from SGI"
PATCH 1/1 Revert "build: Use the original install-sh file from SGI"
From: Vyacheslav Yurkov <[email protected]>
This reverts commit da7916f72206750cce0d0d306d3ba9094a375880.
Old install-sh fails in cross-compilation environments like yocto.
--- Makefile | 1 - include/install-sh | 352 --------------------------------------------- 2 files changed, 353 deletions(-) delete mode 100755 include/install-sh
Makefile +0 -1
@@ -61,7 +61,6 @@ endif configure: configure.ac libtoolize -cfi - cp include/install-sh . aclocal -I m4 autoheader autoconf
include/install-sh deleted +0 -352
352 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 5 lines · Vyacheslav Yurkov
From: Vyacheslav Yurkov <[email protected]>
This reverts commit
da7916f72206750cce0d0d306d3ba9094a375880.Old install-sh fails in cross-compilation environments like yocto.
This install-sh has been used for performance reason, I'd like keep it if possible. Would you please describe the failures you hit in cross-compilation env? It'd be great if we could fix the env issue.
Thanks,
Eryu
Quoted 380 lines
Signed-off-by Vyacheslav Yurkov <[email protected]>--- Makefile | 1 - include/install-sh | 352 --------------------------------------------- 2 files changed, 353 deletions(-) delete mode 100755 include/install-shMakefile +0
-1@@ -61,7 +61,6 @@ endif configure: configure.ac libtoolize -cfi - cp include/install-sh . aclocal -I m4 autoheader autoconfinclude/install-sh deleted +0
-352@@ -1,352 +0,0 @@ -#! /bin/bash -# -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# -# This script emulates bsd install and also recognises -# two environment variables, with the following semantics :- -# -# $DIST_MANIFEST - if set, the name of the file to append manifest -# information in the following format: -# File : f mode owner group src target -# Directory: d mode owner group target -# Symlink : l linkval target -# -# $DIST_ROOT - if set, prepend to target -# -# The sematics of all combinations of these two variables -# are as follows: -# -# $DIST_MANIFEST? $DIST_ROOT? | Copy? Append Manifest? -# -----------------------------+-------------------------- -# not set not set | yes no -# not set set | yes no -# set not set | no yes -# set set | yes yes -# -_usage() { - echo "Usage: $prog [-o owner] [-g group] [-m mode] -d directory" - echo "or $prog [-D] [-o owner] [-g group] [-m mode] file directory/file" - echo "or $prog [-o owner] [-g group] [-m mode] file [file ...] directory" - echo "or $prog -S file target (creates \"target\" symlink)" - echo "or $prog -T lt_arg [-o owner] [-g group] [-m mode] libtool.lai directory" - echo "" - echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variables affect the" - echo "behaviour of this command - see comments in the script." - echo "The -D flag is only available for the second usage, and causes" - echo "the target directory to be created before installing the file." - echo "" - exit 1 -} - -_chown () -{ - _st=255 - if [ $# -eq 3 ] ; then - chown $1:$2 $3 - _st=$? - if [ $_st -ne 0 ] ; then - if [ $REAL_UID != '0' ] ; then - if [ ! -f $DIST_ROOT/.chown.quiet ] ; then - echo '===============================================' - echo Ownership of files under ${DIST_ROOT:-/} - echo cannot be changed - echo '===============================================' - if [ -n "$DIST_ROOT" ] ; then - touch $DIST_ROOT/.chown.quiet - fi - fi - _st=0 - fi - fi - fi - - return $_st -} - - -_manifest () -{ - echo $* | sed -e 's/\/\//\//g' >>${DIST_MANIFEST:-/dev/null} -} - -prog=`basename $0` -HERE=`pwd` -dflag=false -Dflag=false -Sflag=false -Tflag=false -DIRMODE=755 -FILEMODE=644 -OWNER=`id -u` -GROUP=`id -g` -REAL_UID=$OWNER - -# default is to install and don't append manifest -INSTALL=true -MANIFEST=: - -: ${DIST_ROOT:=${DESTDIR}} - -[ -n "$DIST_MANIFEST" -a -z "$DIST_ROOT" ] && INSTALL=false -[ -n "$DIST_MANIFEST" ] && MANIFEST="_manifest" - -[ $# -eq 0 ] && _usage - -if $INSTALL -then - CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod; CHOWN=_chown -else - CP=true; LN=true; MKDIR=true; CHMOD=true; CHOWN=true -fi - -[ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true - -while getopts "Dcm:d:S:o:g:T:" c $* -do - case $c in - c) - ;; - g) - GROUP=$OPTARG - ;; - o) - OWNER=$OPTARG - ;; - m) - DIRMODE=`expr $OPTARG` - FILEMODE=$DIRMODE - ;; - D) - Dflag=true - ;; - S) - symlink=$OPTARG - Sflag=true - ;; - d) - dir=$DIST_ROOT/$OPTARG - dflag=true - ;; - T) - lt_install=$OPTARG - Tflag=true - ;; - *) - _usage - ;; - esac -done - -shift `expr $OPTIND - 1` - -status=0 -if $dflag -then - # - # first usage - # - $MKDIR -p $dir - status=$? - if [ $status -eq 0 ] - then - $CHMOD $DIRMODE $dir - status=$? - fi - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir - status=$? - fi - $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT} -elif $Sflag -then - # - # fourth usage (symlink) - # - if [ $# -ne 1 ] - then - _usage - else - target=$DIST_ROOT/$1 - fi - $LN -s -f $symlink $target - status=$? - $MANIFEST l $symlink ${target#$DIST_ROOT} -elif $Tflag -then - # - # -T (install libs built by libtool) - # - if [ $# -ne 2 ] - then - _usage - else - libtool_lai=$1 - # source the libtool variables - if [ ! -f $libtool_lai ] - then - echo "$prog: Unable to find libtool library file $libtool_lai" - exit 2 - fi - . ./$libtool_lai - target=$DIST_ROOT/$2 - fi - case $lt_install in - so_dot_version) - # Loop until we find libfoo.so.x.y.z, then break out. - for solib in $library_names - do - # does it have enough parts? libfoo.so.x.y.z == 5 - cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` - if [ $cnt -eq 5 ] - then - install_name=$target/$solib - $CP $solib $install_name - status=$? - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib ${install_name#$DIST_ROOT} - break - fi - done - ;; - - so_*) - case $lt_install in - so_dot_current) - # ln -s libfoo.so.x.y.z to libfoo.so.x - from_parts=5 # libfoo.so.x.y.z - to_parts=3 # libfoo.so.x - ;; - so_base) - # ln -s libfoo.so.x to libfoo.so - from_parts=3 # libfoo.so.x - to_parts=2 # libfoo.so - ;; - *) - echo "$prog: -T $lt_install invalid" - exit 2 - ;; - esac - - # Loop until we find the names, then break out. - for solib in $library_names - do - # does it have enough parts? - cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` - if [ $cnt -eq $from_parts ] - then - from_name=$solib - elif [ $cnt -eq $to_parts ] - then - to_name=$solib - fi - - if [ -n "$from_name" ] && [ -n "$to_name" ] - then - install_name=$target/$to_name - $LN -s -f $from_name $install_name - status=$? - $MANIFEST l $from_name ${install_name#$DIST_ROOT} - break - fi - done - ;; - old_lib) - install_name=$target/$old_library - $CP $old_library $install_name - status=$? - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library ${install_name#$DIST_ROOT} - ;; - *) - echo "$prog: -T $lt_install invalid" - exit 2 - ;; - esac - - case $lt_install in - old_lib|so_dot_version) - if [ $status -eq 0 ] - then - $CHMOD $FILEMODE $install_name - $CHOWN $OWNER $GROUP $install_name - fi - ;; - esac - -else - list="" - dir="" - if [ $# -eq 2 ] - then - # - # second usage - # - f=$1 - dir=$DIST_ROOT/$2 - if $Dflag - then - mkdir -p `dirname $dir` - fi - $CP $f $dir - status=$? - if [ $status -eq 0 ] - then - if [ -f $dir/$f ] - then - $CHMOD $FILEMODE $dir/$f - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir/$f - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f - else - $CHMOD $FILEMODE $dir - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT} - fi - fi - else - # - # third usage - # - n=1 - while [ $# -gt 0 ] - do - if [ $# -gt 1 ] - then - list="$list $1" - else - dir=$DIST_ROOT/$1 - fi - shift - done - - # echo DIR=$dir list=\"$list\" - for f in $list - do - $CP $f $dir - status=$? - if [ $status -eq 0 ] - then - $CHMOD $FILEMODE $dir/$f - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir/$f - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f - fi - [ $status -ne 0 ] && break - done - fi -fi - -exit $statusSignature · 1 line
2.25.1
There are several errors I was getting actually. The first one is something like this:
Quoted 1 line
| configure: error: cannot run
/bin/bash./../config.sub
The problem is that yocto/oe build system has distinct stages like fetch/configure/compile/install/etc, and this error occurs during the configure stage when it tries to run automake/autoconf.
When I prepend configure stage with copying of include/install-sh, it passes further, but fails at install stage with the errors like:
Usage: build/tmp/work/corei7-64-oe-linux/xfstests/git-r0/git/x86_64-oe-linux-libtool [OPTION]... [MODE-ARG]... Try 'x86_64-oe-linux-libtool --help' for more information.
x86_64-oe-linux-libtool: error: 'build/tmp/work/corei7-64-oe-linux/xfstests/git-r0/image/usr/xfstests/src' is not a directory
make[1]: *** [Makefile:102: install] Error 1
So I honestly didn't look into what's failing there. Using up-to-date scripts just fixed the issue for me. I could keep the patch in my yocto BSP then if you don't like it.
Thanks,
Vyacheslav
- confidential -
Quoted 413 lines
-----Original Message-----
From: Eryu Guan <[email protected]>
Sent: Sunday, July 4, 2021 11:44
To: Vyacheslav Yurkov <[email protected]>
Cc: [email protected]; Yurkov, Vyacheslav <[email protected]>
Subject: Re: [PATCH] Revert "build: Use the original install-sh file from SGI"**EXTERNAL EMAIL**
Quoted 5 lines · Vyacheslav Yurkov
From: Vyacheslav Yurkov <[email protected]>
This reverts commit
da7916f72206750cce0d0d306d3ba9094a375880.Old install-sh fails in cross-compilation environments like yocto.
This install-sh has been used for performance reason, I'd like keep it if possible. Would you please describe the failures you hit in cross-compilation env? It'd be great if we could fix the env issue.
Thanks,
EryuQuoted 48 lines
Signed-off-by Vyacheslav Yurkov <[email protected]>--- Makefile | 1 - include/install-sh | 352 --------------------------------------------- 2 files changed, 353 deletions(-) delete mode 100755 include/install-shMakefile +0
-1@@ -61,7 +61,6 @@ endif configure: configure.ac libtoolize -cfi - cp include/install-sh . aclocal -I m4 autoheader autoconfinclude/install-sh deleted +0
-22@@ -1,352 +0,0 @@ -#! /bin/bash -# -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# -# This script emulates bsd install and also recognises -# two environment variables, with the following semantics :- -# -# $DIST_MANIFEST - if set, the name of the file to append manifest -# information in the following format: -# File : f mode owner group src target -# Directory: d mode owner group target -# Symlink : l linkval target -# -# $DIST_ROOT - if set, prepend to target -# -# The sematics of all combinations of these two variables -# are as follows: -# -# $DIST_MANIFEST? $DIST_ROOT? | Copy? Append Manifest? -# -----------------------------+-------------------------- -# not set not set | yes noinclude/install-sh line 32
Quoted 10 lines
include/install-sh deleted +0
-10-# not set set | yes no -# set not set | no yes -# set set | yes yes -# -_usage() { - echo "Usage: $prog [-o owner] [-g group] [-m mode] -d directory" - echo "or $prog [-D] [-o owner] [-g group] [-m mode] file directory/file" - echo "or $prog [-o owner] [-g group] [-m mode] file [file ...] directory" - echo "or $prog -S file target (creates \"target\" symlink)" - echo "or $prog -T lt_arg [-o owner] [-g group] [-m mode] libtool.laidirectory"
include/install-sh line 34
Quoted 2 lines
include/install-sh deleted +0
-2- echo "" - echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variablesaffect the"
Quoted 7 lines
include/install-sh deleted +0
-7- echo "behaviour of this command - see comments in the script." - echo "The -D flag is only available for the second usage, and causes" - echo "the target directory to be created before installing the file." - echo "" - exit 1 -} -include/install-sh
Quoted 10 lines
include/install-sh deleted +0
-10-_chown () -{ - _st=255 - if [ $# -eq 3 ] ; then - chown $1:$2 $3 - _st=$? - if [ $_st -ne 0 ] ; then - if [ $REAL_UID != '0' ] ; then - if [ ! -f $DIST_ROOT/.chown.quiet ] ; then - echo'==============================================='
include/install-sh
Quoted 3 lines
include/install-sh deleted +0
-3- echo Ownership of files under ${DIST_ROOT:-/} - echo cannot be changed - echo'==============================================='
Quoted 143 lines
include/install-sh deleted +0
-143- if [ -n "$DIST_ROOT" ] ; then - touch $DIST_ROOT/.chown.quiet - fi - fi - _st=0 - fi - fi - fi - - return $_st -} - - -_manifest () -{ - echo $* | sed -e 's/\/\//\//g' >>${DIST_MANIFEST:-/dev/null} -} - -prog=`basename $0` -HERE=`pwd` -dflag=false -Dflag=false -Sflag=false -Tflag=false -DIRMODE=755 -FILEMODE=644 -OWNER=`id -u` -GROUP=`id -g` -REAL_UID=$OWNER - -# default is to install and don't append manifest -INSTALL=true -MANIFEST=: - -: ${DIST_ROOT:=${DESTDIR}} - -[ -n "$DIST_MANIFEST" -a -z "$DIST_ROOT" ] && INSTALL=false -[ -n "$DIST_MANIFEST" ] && MANIFEST="_manifest" - -[ $# -eq 0 ] && _usage - -if $INSTALL -then - CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod; CHOWN=_chown -else - CP=true; LN=true; MKDIR=true; CHMOD=true; CHOWN=true -fi - -[ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true - -while getopts "Dcm:d:S:o:g:T:" c $* -do - case $c in - c) - ;; - g) - GROUP=$OPTARG - ;; - o) - OWNER=$OPTARG - ;; - m) - DIRMODE=`expr $OPTARG` - FILEMODE=$DIRMODE - ;; - D) - Dflag=true - ;; - S) - symlink=$OPTARG - Sflag=true - ;; - d) - dir=$DIST_ROOT/$OPTARG - dflag=true - ;; - T) - lt_install=$OPTARG - Tflag=true - ;; - *) - _usage - ;; - esac -done - -shift `expr $OPTIND - 1` - -status=0 -if $dflag -then - # - # first usage - # - $MKDIR -p $dir - status=$? - if [ $status -eq 0 ] - then - $CHMOD $DIRMODE $dir - status=$? - fi - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir - status=$? - fi - $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT} -elif $Sflag -then - # - # fourth usage (symlink) - # - if [ $# -ne 1 ] - then - _usage - else - target=$DIST_ROOT/$1 - fi - $LN -s -f $symlink $target - status=$? - $MANIFEST l $symlink ${target#$DIST_ROOT} -elif $Tflag -then - # - # -T (install libs built by libtool) - # - if [ $# -ne 2 ] - then - _usage - else - libtool_lai=$1 - # source the libtool variables - if [ ! -f $libtool_lai ] - then - echo "$prog: Unable to find libtool library file $libtool_lai" - exit 2 - fi - . ./$libtool_lai - target=$DIST_ROOT/$2 - fi - case $lt_install in - so_dot_version) - # Loop until we find libfoo.so.x.y.z, then break out.include/install-sh
Quoted 10 lines
include/install-sh deleted +0
-10- for solib in $library_names - do - # does it have enough parts? libfoo.so.x.y.z == 5 - cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` - if [ $cnt -eq 5 ] - then - install_name=$target/$solib - $CP $solib $install_name - status=$? - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib${install_name#$DIST_ROOT}
Quoted 41 lines
include/install-sh deleted +0
-41- break - fi - done - ;; - - so_*) - case $lt_install in - so_dot_current) - # ln -s libfoo.so.x.y.z to libfoo.so.x - from_parts=5 # libfoo.so.x.y.z - to_parts=3 # libfoo.so.x - ;; - so_base) - # ln -s libfoo.so.x to libfoo.so - from_parts=3 # libfoo.so.x - to_parts=2 # libfoo.so - ;; - *) - echo "$prog: -T $lt_install invalid" - exit 2 - ;; - esac - - # Loop until we find the names, then break out. - for solib in $library_names - do - # does it have enough parts? - cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` - if [ $cnt -eq $from_parts ] - then - from_name=$solib - elif [ $cnt -eq $to_parts ] - then - to_name=$solib - fi - - if [ -n "$from_name" ] && [ -n "$to_name" ] - then - install_name=$target/$to_name - $LN -s -f $from_name $install_name - status=$?include/install-sh
Quoted 10 lines
include/install-sh deleted +0
-10- $MANIFEST l $from_name ${install_name#$DIST_ROOT} - break - fi - done - ;; - old_lib) - install_name=$target/$old_library - $CP $old_library $install_name - status=$? - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library${install_name#$DIST_ROOT}
Quoted 35 lines
include/install-sh deleted +0
-35- ;; - *) - echo "$prog: -T $lt_install invalid" - exit 2 - ;; - esac - - case $lt_install in - old_lib|so_dot_version) - if [ $status -eq 0 ] - then - $CHMOD $FILEMODE $install_name - $CHOWN $OWNER $GROUP $install_name - fi - ;; - esac - -else - list="" - dir="" - if [ $# -eq 2 ] - then - # - # second usage - # - f=$1 - dir=$DIST_ROOT/$2 - if $Dflag - then - mkdir -p `dirname $dir` - fi - $CP $f $dir - status=$? - if [ $status -eq 0 ] - theninclude/install-sh
Quoted 10 lines
include/install-sh deleted +0
-10- if [ -f $dir/$f ] - then - $CHMOD $FILEMODE $dir/$f - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir/$f - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f${dir#$DIST_ROOT}/$f
include/install-sh
Quoted 9 lines
include/install-sh deleted +0
-9- else - $CHMOD $FILEMODE $dir - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir${dir#$DIST_ROOT}
Quoted 23 lines
include/install-sh deleted +0
-23- fi - fi - else - # - # third usage - # - n=1 - while [ $# -gt 0 ] - do - if [ $# -gt 1 ] - then - list="$list $1" - else - dir=$DIST_ROOT/$1 - fi - shift - done - - # echo DIR=$dir list=\"$list\" - for f in $list - do - $CP $f $dir - status=$?include/install-sh
Quoted 10 lines
include/install-sh deleted +0
-10- if [ $status -eq 0 ] - then - $CHMOD $FILEMODE $dir/$f - status=$? - if [ $status -eq 0 ] - then - $CHOWN $OWNER $GROUP $dir/$f - status=$? - fi - $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f${dir#$DIST_ROOT}/$f
Quoted 9 lines
include/install-sh deleted +0
-8- fi - [ $status -ne 0 ] && break - done - fi -fi - -exit $status --2.25.1