Another LFS Newbie writting bash alfs scripts

adam boz adam_boz at
Wed Oct 16 08:50:55 PDT 2002

Grant Leslie wrote:
> Made a stab at writting some scripts to compile/install lfs posted them here
> If anyone would care to take a look, and let me know if they seem, sane?
> I'd consider them less then alpha quality, especially the final stages after
> compiling chapter 6

It looks interesting to me.  I wonder if you could explain a little bit 
for me.  I'm extremely new to programming, and would like to be able to 
decipher it a little more.

in ch6 script:

1) why do you do "find / >lfs-files/all-files"? won't that include all 
of your /static libraries and binaries?

2)"for package_name in `cat lfs-packages-list`" I see "lfs-package.list, 
is that a typo?

3)what does the "tee" command do?

4)where do you set the $ variable?

5) "exec /usr/src/lfs/lfs-commands/$ || exit 1" this looks really 
nice, I'm guessing this starts a new shell, builds the package, then 
exits?  I am just curious about when you loging to bash in ch.6 again... 
if you exit, aren't you not logged in any more?

Sorry for asking a bunch of questions, I'm just curious... you don't 
have to go into detail if you don't want.  here's a little bit of my 
script, it's very very basic, but it does the job so far.... (I haven't 
worked on it for a while, so i haven't really fixed that login thing yet)

function decompress {

         echo Do you need the files to be decompressed?


select opt in $OPTIONS;
         if [ "$opt" = "Yes" ]; then
         mkdir compressed

         for i in $( ls | grep .tar.bz2 );
                 tar -jxvf $i
                 mv $i compressed/

         for i in $( ls | grep .bz2 );
                 bunzip2 $i
       ..... you get the point here

# Start of compilation.... each package has it's own function
# I'll call the functions later

function bash_install {
for i in $( ls | grep bash )
         cd $i
         ./configure --enable-static-link  --prefix=$LFS/static 
         make install
cd ..
export bash_install

  *********************  then I call them all with an OPTION list:

# here's where i am calling the compiling functions

OPTIONS="EVERYTHING bash binutils bzip2 diffutils fileutils findutils 
gawk gcc grep gzip make patch sed sh-utils tar texinfo textutils 
util-linux Exit "


well, I just wanted to share what i've done with somebody I guess.  I am 
going to try out your scrip when I get some time.  I want to create a 
bootable lfs cd eventually, with all of the packages on it, so that I 
can install lfs on computers w/out having another distro on it.

again, thanks very much if you can answer any of my questions.... your 
script looks very nice


Unsubscribe: send email to listar at
and put 'unsubscribe alfs-discuss' in the subject header of the message

More information about the alfs-discuss mailing list