LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-15-2012, 01:34 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 87

Rep: Reputation: 0
a short shell script


I'M trying to build an LFS system from the linux from scratch project. I'M stuck on the following page:
http://www.linuxfromscratch.org/lfs/...r06/glibc.html

I've got the commands placed into a script so I can check to see what went wrong and where fore I get to far ahead and figure out I massed up 30 steps back. Each script is set to create a file by date > ../FLAG then echo GOOD so I know everything went okay. But I've hit a dead end because I'M not getting the FLAG file or seeing GOOD upon completion of the script running and I can't find the problem.


DL=$(readelf -l /bin/sh | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p') &&
sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \
scripts/test-installation.pl &&
unset DL &&
sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl &&
sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in &&
( patch -Np1 -i ../../../glibc-2.14.1-fixes-1.patch 2>&1 | tee patch-one.log && exit $PIPESTATUS ) &&
( patch -Np1 -i ../../../glibc-2.14.1-sort-1.patch 2>&1 | tee patch-two.log && exit $PIPESTATUS ) &&
( patch -Np1 -i ../../../glibc-2.14.1-gcc_fix-1.patch 2>&1 | tee patch-tree.log && exit $PIPESTATUS ) &&
sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timed{rd,wr}lock.S &&
mkdir -v ../glibc-build &&
cd ../glibc-build &&
case `uname -m` in
i?86) echo "CFLAGS += -march=i486 -mtune=native -O3 -pipe" > configparms ;;
esac &&
( ../glibc-2.14.1/configure --prefix=/usr \
--disable-profile --enable-add-ons \
--enable-kernel=2.6.25 --libexecdir=/usr/lib/glibc 2>&1 | tee configure-glibc.log && exit $PIPESTATUS ) &&
( make 2>&1 | tee make-glibc.log && exit $PIPESTATUS ) &&
cp -v ../glibc-2.14.1/iconvdata/gconv-modules iconvdata &&
make -k check 2>&1 | tee glibc-check-log &&
grep Error glibc-check-log &&
touch /etc/ld.so.conf &&
( make install 2>&1 | tee make-install.log && exit $PIPESTATUS ) &&
cp -v ../glibc-2.14.1/sunrpc/rpc/*.h /usr/include/rpc &&
cp -v ../glibc-2.14.1/sunrpc/rpcsvc/*.h /usr/include/rpcsvc &&
cp -v ../glibc-2.14.1/nis/rpcsvc/*.h /usr/include/rpcsvc &&
mkdir -pv /usr/lib/locale &&
localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8 &&
localedef -i de_DE -f ISO-8859-1 de_DE &&
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro &&
localedef -i de_DE -f UTF-8 de_DE.UTF-8 &&
localedef -i en_HK -f ISO-8859-1 en_HK &&
localedef -i en_PH -f ISO-8859-1 en_PH &&
localedef -i en_US -f ISO-8859-1 en_US &&
localedef -i en_US -f UTF-8 en_US.UTF-8 &&
localedef -i es_MX -f ISO-8859-1 es_MX &&
localedef -i fa_IR -f UTF-8 fa_IR &&
localedef -i fr_FR -f ISO-8859-1 fr_FR &&
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro &&
localedef -i fr_FR -f UTF-8 fr_FR.UTF-8 &&
localedef -i it_IT -f ISO-8859-1 it_IT &&
localedef -i ja_JP -f EUC-JP ja_JP &&
localedef -i tr_TR -f UTF-8 tr_TR.UTF-8 &&
localedef -i zh_CN -f GB18030 zh_CN.GB18030 &&
( make localedata/install-locales 2>&1 | tee make-localdata.log && exit $PIPESTATUS ) &&
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
EOF &&
tzselect &&
cp -v --remove-destination /usr/share/zoneinfo/Eastern \
/etc/localtime &&
cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
EOF &&
cat >> /etc/ld.so.conf << "EOF"
# Add an include directory
include /etc/ld.so.conf.d/*.conf
EOF &&
mkdir /etc/ld.so.conf.d &&
date > ../FLAG &&
echo GOOD
 
Old 08-15-2012, 05:01 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Well ... first: can we please get you to use the CODE tags in the future?


And then ... what is the last file generated by the script? Since they're
all tied together with && it could have failed at the first step.

If all else fails insert meaningful echo statements after each && , e.g.,
Code:
DL=$(readelf -l /bin/sh | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p') &&
sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \
scripts/test-installation.pl &&
echo  "After test-installation.pl"
unset DL &&
to find out where it fails ...
 
Old 08-16-2012, 07:10 AM   #3
Garrett85
Member
 
Registered: Jan 2011
Posts: 87

Original Poster
Rep: Reputation: 0
I don't understand a lot of what I'M doing here, I'M just following the steps at linuxfromscratch.org, so I couldn't really comment it anyway. But I did give the link to where I got the instructions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass command line arguments from one shell script to another shell script VijayaRaghavanLakshman Linux - Newbie 5 01-20-2012 09:12 PM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
[SOLVED] a short shell script related to PIDs gujedan Programming 3 11-22-2010 04:54 AM
shell short question(stdout, stderr) blackzone Programming 4 11-11-2004 09:01 AM


All times are GMT -5. The time now is 01:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration