From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-yk0-f169.google.com ([209.85.160.169]) by metis.ext.pengutronix.de with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZHUPj-0007Pb-E3 for ptxdist@pengutronix.de; Tue, 21 Jul 2015 12:04:43 +0200 Received: by ykay190 with SMTP id y190so163127590yka.3 for ; Tue, 21 Jul 2015 05:04:02 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 21 Jul 2015 14:04:02 +0200 Message-ID: From: Albert Antony Subject: Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: multipart/mixed; boundary="===============1668419846==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de --===============1668419846== Content-Type: multipart/alternative; boundary=001a114281463a3539051b61736d --001a114281463a3539051b61736d Content-Type: text/plain; charset=UTF-8 Hi Michael, Maybe I am not aware of the auto-detection feature. And from the looks of it I misunderstand the use-case for the strip y|n option altogether. So let me explain. Our requirement here is to install debug versions of certain libraries on the target, some of which are installed via install_lib, and some others like libpthread which are installed via install_copy_toolchain_lib. Since the strip y|n option to these calls seem to be getting ignored, I assumed this might be a missing feature. This is what prompted the patch. If there is a better way (maybe auto-detection?) to achieve the same then I guess there is no need for it. Could you point me to where I can find out more about auto-detection? Cheers, Albert. On 21 July 2015 at 12:26, Michael Olbrich wrote: > On Tue, Jul 21, 2015 at 12:09:38PM +0200, Albert Antony wrote: > > The strip y|n option should now work for install_lib > > and install_copy_toolchain_lib, just like it works > > for install_copy. > > Why? What's the use-case for this? For install_copy it's still there for > kernel modules and legacy stuff, but in general the auto detection should > work. > > Michael > > > Signed-off-by: Albert Antony > > --- > > rules/post/install.make | 3 ++- > > scripts/install_copy_toolchain.sh | 2 +- > > scripts/lib/ptxd_make_xpkg_pkg.sh | 3 ++- > > 3 files changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/rules/post/install.make b/rules/post/install.make > > index 7da3f04..9cde3d4 100644 > > --- a/rules/post/install.make > > +++ b/rules/post/install.make > > @@ -240,8 +240,9 @@ install_lib = \ > > PER="$(strip $(4))"; \ > > LIB=$(strip $(5)); \ > > DST=$(strip $(6)); \ > > + STRIP=$(strip $(7)); \ > > $(call install_check, install_lib); \ > > - echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER'" >> > "$(STATEDIR)/$$XPKG.cmds" > > + echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER' > '$$STRIP'" >> "$(STATEDIR)/$$XPKG.cmds" > > > > # > > # install_replace > > diff --git a/scripts/install_copy_toolchain.sh > b/scripts/install_copy_toolchain.sh > > index 0cf4d31..0b70c12 100755 > > --- a/scripts/install_copy_toolchain.sh > > +++ b/scripts/install_copy_toolchain.sh > > @@ -170,7 +170,7 @@ ptxd_install_toolchain_lib() { > > > > perm="$(stat -c %a "${lib_path}")" > > > > - echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0 > 0 \"${perm}\"" >> "${STATEDIR}/${packet}.cmds" > > + echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0 > 0 \"${perm}\" \"${strip}\"" >> "${STATEDIR}/${packet}.cmds" > > fi > > else > > echo "error: found ${lib_path}, but neither file nor link" 2>&1 > > diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh > b/scripts/lib/ptxd_make_xpkg_pkg.sh > > index ae4c12f..a31e8fe 100644 > > --- a/scripts/lib/ptxd_make_xpkg_pkg.sh > > +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh > > @@ -730,9 +730,10 @@ ptxd_install_shared() { > > local usr="$3" > > local grp="$4" > > local mod="$5" > > + local strip="$6" > > local filename="$(basename "${src}")" > > > > - ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}" > "${mod}" && > > + ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}" > "${mod}" "${strip}" && > > > > find -H "$(dirname "${src}")" -maxdepth 1 -type l | while read > file; do > > if [ "$(basename "$(readlink -f "${file}")")" = "${filename}" ]; > then > > -- > > 2.0.0 > > > > > > -- > > ptxdist mailing list > > ptxdist@pengutronix.de > > -- > Pengutronix e.K. | | > Industrial Linux Solutions | http://www.pengutronix.de/ | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > > -- > ptxdist mailing list > ptxdist@pengutronix.de > --001a114281463a3539051b61736d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Michael,

Maybe I am not aware of the= auto-detection feature. And from the looks of it I misunderstand the use-c= ase for the strip y|n option altogether. So let me explain.

<= /div>
Our requirement here is to install debug versions of certain libr= aries on the target, some of which are installed via install_lib, and some = others like libpthread which are installed via install_copy_toolchain_lib. = Since the strip y|n option to these calls seem to be getting ignored, I ass= umed this might be a missing feature. This is what prompted the patch. If t= here is a better way (maybe auto-detection?) to achieve the same then I gue= ss there is no need for it. Could you point me to where I can find out more= about auto-detection?

Cheers,
Albert.

On 21 July 20= 15 at 12:26, Michael Olbrich <m.olbrich@pengutronix.de> wrote:
On Tue, Jul 21= , 2015 at 12:09:38PM +0200, Albert Antony wrote:
> The strip y|n option should now work for install_lib
> and install_copy_toolchain_lib, just like it works
> for install_copy.

Why? What's the use-case for this? For install_copy it's sti= ll there for
kernel modules and legacy stuff, but in general the auto detection should work.

Michael

> Signed-off-by: Albert Antony <a= lbert@newtec.dk>
> ---
>=C2=A0 rules/post/install.make=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= | 3 ++-
>=C2=A0 scripts/install_copy_toolchain.sh | 2 +-
>=C2=A0 scripts/lib/ptxd_make_xpkg_pkg.sh | 3 ++-
>=C2=A0 3 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/rules/post/install.make b/rules/post/install.make
> index 7da3f04..9cde3d4 100644
> --- a/rules/post/install.make
> +++ b/rules/post/install.make
> @@ -240,8 +240,9 @@ install_lib =3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
>=C2=A0 =C2=A0 =C2=A0 =C2=A0PER=3D"$(strip $(4))";=C2=A0 =C2= =A0 \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0LIB=3D$(strip $(5));=C2=A0 =C2=A0 =C2=A0 \ >=C2=A0 =C2=A0 =C2=A0 =C2=A0DST=3D$(strip $(6)); \
> +=C2=A0 =C2=A0 =C2=A0STRIP=3D$(strip $(7)); \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0$(call install_check, install_lib);=C2=A0 = =C2=A0 =C2=A0\
> -=C2=A0 =C2=A0 =C2=A0echo "ptxd_install_lib '$$LIB' '= $$DST' '$$OWN' '$$GRP' '$$PER'" >> &= quot;$(STATEDIR)/$$XPKG.cmds"
> +=C2=A0 =C2=A0 =C2=A0echo "ptxd_install_lib '$$LIB' '= $$DST' '$$OWN' '$$GRP' '$$PER' '$$STRIP'= ;" >> "$(STATEDIR)/$$XPKG.cmds"
>
>=C2=A0 #
>=C2=A0 # install_replace
> diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_= toolchain.sh
> index 0cf4d31..0b70c12 100755
> --- a/scripts/install_copy_toolchain.sh
> +++ b/scripts/install_copy_toolchain.sh
> @@ -170,7 +170,7 @@ ptxd_install_toolchain_lib() {
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0perm=3D"$(s= tat -c %a "${lib_path}")"
>
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "ptxd_insta= ll_shared \"${lib_path}\" \"${prefix}\" 0 0 \"${pe= rm}\"" >> "${STATEDIR}/${packet}.cmds"
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "ptxd_insta= ll_shared \"${lib_path}\" \"${prefix}\" 0 0 \"${pe= rm}\" \"${strip}\"" >> "${STATEDIR}/${packet= }.cmds"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fi
>=C2=A0 =C2=A0 =C2=A0 =C2=A0else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "error: found ${lib_= path}, but neither file nor link" 2>&1
> diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make= _xpkg_pkg.sh
> index ae4c12f..a31e8fe 100644
> --- a/scripts/lib/ptxd_make_xpkg_pkg.sh
> +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
> @@ -730,9 +730,10 @@ ptxd_install_shared() {
>=C2=A0 =C2=A0 =C2=A0 local usr=3D"$3"
>=C2=A0 =C2=A0 =C2=A0 local grp=3D"$4"
>=C2=A0 =C2=A0 =C2=A0 local mod=3D"$5"
> +=C2=A0 =C2=A0 local strip=3D"$6"
>=C2=A0 =C2=A0 =C2=A0 local filename=3D"$(basename "${src}&quo= t;)"
>
> -=C2=A0 =C2=A0 ptxd_install_file "${src}" "${dst}/${fil= ename}" "${usr}" "${grp}" "${mod}" &= &
> +=C2=A0 =C2=A0 ptxd_install_file "${src}" "${dst}/${fil= ename}" "${usr}" "${grp}" "${mod}" "= ;${strip}" &&
>
>=C2=A0 =C2=A0 =C2=A0 find -H "$(dirname "${src}")" = -maxdepth 1 -type l | while read file; do
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if [ "$(basename "$(readlink -f &q= uot;${file}")")" =3D "${filename}" ]; then
> --
> 2.0.0
>
>
> --
> ptxdist mailing list
> ptxdist@pengutronix.de
--
Pengutronix e.K.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
Industrial Linux Solutions=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| http://www.pengutronix.de/=C2=A0 |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0=C2=A0 =C2=A0 |<= br> Amtsgericht Hildesheim, HRA 2686=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| = Fax:=C2=A0 =C2=A0+49-5121-206917-5555 |

--
ptxdist mailing list
ptxdist@pengutronix.de

--001a114281463a3539051b61736d-- --===============1668419846== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline LS0gCnB0eGRpc3QgbWFpbGluZyBsaXN0CnB0eGRpc3RAcGVuZ3V0cm9uaXguZGUK --===============1668419846==--