You are not logged in.

#1 2006-01-02 07:26:15

M6
Member
Registered: 2005-09-18
Posts: 29

Needs a Scripting Expert

Hi,
I am tying to run this script:
#! /bin/sh
cd itree
cp `find bin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` lib/
cp `find sbin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` lib/
cd ..
cp -dpR /lib/ld-* itree/lib/

Description of the script:
======================
./scripts/find-libs : After installing the busybox binaries, you will ofcourse need the libraries i:e; libc, libm, ld-so etc. Well, this does exactly that. It cannibalises them from your host system.
==========================================================================

When I run I get below error:
[root@localhost itree]# cp `find bin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` /home/mdl-0.1/itree/lib/
cp: cannot stat `(0xffffe000)': No such file or directory
[root@localhost itree]# cp `find bin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` /home/mdl-0.1/itree/lib/
cp: cannot stat `(0xffffe000)': No such file or directory
[root@localhost itree]#


I do have itree/lib directory.

Any help is much appreciated

Ben


Arch a Day Keeps Wfie Away

Offline

#2 2006-01-02 11:05:17

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Needs a Scripting Expert

I've only had a quick look, but methinks it needs to be:

#! /bin/sh
cd itree
cp `find /bin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` lib/
cp `find /sbin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` lib/
cd ..
cp -dpR /lib/ld-* itree/lib/

I've put '/' in front of bin and sbin - at the moment it has no proper searchpath, which is why it says 'No such file or directory'  -  it's looking for a folder called bin/sbin in the current directory. Although I've got no idea why it gives you the hex address rather than just saying 'bin' or 'sbin' in the error output.

Anyway, I think that should work now  wink


.oO Komodo Dave Oo.

Offline

#3 2006-01-02 11:38:46

M6
Member
Registered: 2005-09-18
Posts: 29

Re: Needs a Scripting Expert

Komodo wrote:

I've only had a quick look, but methinks it needs to be:

#! /bin/sh
cd itree
cp `find /bin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` lib/
cp `find /sbin -type f -exec ldd {} ; | sort | uniq  | awk -F= '{print $2}' | awk '{print $2}' | uniq` lib/
cd ..
cp -dpR /lib/ld-* itree/lib/

I've put '/' in front of bin and sbin - at the moment it has no proper searchpath, which is why it says 'No such file or directory'  -  it's looking for a folder called bin/sbin in the current directory. Although I've got no idea why it gives you the hex address rather than just saying 'bin' or 'sbin' in the error output.

Anyway, I think that should work now  wink

Thanks Komodo, you are a champion. that fixed it.

Regards
Ben


Arch a Day Keeps Wfie Away

Offline

Board footer

Powered by FluxBB