Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This script is a rip off of instructions from the LFS 6.1 book btw, I dare not take credit.
Is this script do-able to install binutils pass-1?
Code:
#!/bin/sh
#
# Check the LFS environment variable.
echo $LFS
# Install Binutils-2.15.94.0.2.2 - Pass 1
cd $LFS/sources
tar xvjf binutils-2.15.94.0.2.2.tar.bz2
cd $LFS/sources/binutils-2.15.94.0.2.2
mkdir ../binutils-build
cd ../binutils-build
../binutils-2.15.94.0.2.2/configure --prefix=/tools --disable-nls
make
make install
make -C ld clean
make -C ld LIB_PATH=/tools/lib
Or will it only work as such
Code:
cd $LFS/sources && tar xvjf binutils-2.15.94.0.2.2.tar.bz2 && cd $LFS/sources/binutils-2.15.94.0.2.2 && mkdir ../binutils-build && cd ../binutils-build && ../binutils-2.15.94.0.2.2/configure --prefix=/tools --disable-nls && make && make install && make -C ld clean && make -C ld LIB_PATH=/tools/lib
it looks OK, at least at first-sight, as my base system is completed, I'm not in the situation of being able to test it, but... it seems to be good, wheter you create the script or you concatenate the commmands with the '&&' operator, althought there's something 'redundant' for me in the 'script' version...
why do you perform 'cd $LFS/sources/binutils-2.15.94.0.2.2' after unpacking the tarball? if the script is OK, after 'cd $LFS/sources' you're efectively in the sources directory, so a simple 'cd binutils-2.15.94.0.2.2' will do the trick
Julio
Last edited by ParticleHunter; 07-18-2005 at 02:09 PM.
but in the first version, you might want to set $LFS rather than just echo it. that way you can be sure it'll be what you need it to be. if $LFS is set to "hahahaiamusingtehintarwebz", it'll just echo that and then proceed installing with that not exactly sane value.
My understanding is that the system is blind to anything behind a #
I really appreciate your help!
Did you guys run into trouble when you created the symlinks in chapter 6.6 for
6.6. Creating Essential Symlinks
Some programs use hard-wired paths to programs which do not exist yet.
In order to satisfy these programs, create a number of symbolic links
which will be replaced by real files throughout the course of this
chapter after the software has been installed.
ln -s /tools/bin/{bash,cat,pwd,stty} /bin
ln -s /tools/bin/perl /usr/bin
ln -s /tools/lib/libgcc_s.so{,.1} /usr/lib
ln -s bash /bin/sh
my [ sh ] couldn't be found when I tried to install
6.10.1. Installation of Man-pages
Install Man-pages by running:
make install
To fix it I had to
rm -r /bin/sh
ln -s /tools/bin/bash /bin/sh
The book wasn't too clear to me when I read it.
Are we supposed have [ sh ] pointing to /tools/bash or /bin/bash in which case /bin/bash is a symlink to /tools/bash
/bin/sh and /bin/bash are the same in the sense that sh is supposed to be a symlink for bash, so as long as the /etc/shells file is present in your host distribution you must not have any problem with that, as the /etc/shells file contains the following (extracted from the BLFS book (SVN):
cat > /etc/shells << "EOF"
# Begin /etc/shells
/bin/sh
/bin/bash
# End /etc/shells
EOF
so if this file is present, it's not relevant wheter you use !/bin/sh or /bin/bash in your script
I didn't had any problem with that part of the book, in fact, as I compiled my system from a terminal window in GNOME having another window with Firefox and the LFS book, I just had to copy-and-paste over the terminal
I think the ln -s /tools/bin/bash /bin/sh command is executed because in that step of the book, you still haven't installed the final bash, but you're using your build-tools' bash to do the trick... as stated before, I didn't had any problem with this
and just to add: the #! is called shebang. in the very first line of a script, you can specify the interpreter of the script. thus, # always represents a comment line (does not get executed). but if on the first line the # is followed by a !, it signifies the interpreter. what really happens is not that each line of the script gets executed by the shell you are in when you call the script, rather the interpreter on the first line is called (a new shell is started) than then executes the script. if you had php installed, say, this would be perfectly good for a script:
#!/usr/bin/php
<?php
phpinfo();
?>
that would start an instance of php that would then execute the rest of the code.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.