Another LFS Newbie writting bash alfs scripts

adam boz adam_boz at phreaker.net
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
> http://personal.nbnet.nb.ca/grantl/lfs/
> 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 $1.sh variable?

5) "exec /usr/src/lfs/lfs-commands/$1.sh || 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?

OPTIONS="Yes No"

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

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

         for i in $( ls | grep .bz2 );
         do
                 bunzip2 $i
         done
       ..... 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 )
         do
         cd $i
done
         ./configure --enable-static-link  --prefix=$LFS/static 
--with-curses
         make
         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

-Adam

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



More information about the alfs-discuss mailing list