lewashby 40 Junior Poster

http://www.linuxfromscratch.org/lfs/view/stable/chapter06/glibc.html

Above is a list of commands from the LFS project. I'M building a script for this page I want to be sure I'M not fraking this up.

Please pay special attention to the following:

sed & unset - at the top

case & esac

and the threee cat & EOF commands, thanks.

Code is below

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                                                   2>&1 | tee cat-file.log     && exit $PIPESTATUS ) &&
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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.