LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 02-18-2007, 10:40 PM   #16
thloh85
Member
 
Registered: Apr 2006
Location: Earth
Distribution: BLFS customized
Posts: 160

Rep: Reputation: 31

My LFS took me 1 whole week to understand every single concept of why things have to build that way, etc. I suggest you go through the book, then try experiment with different ./configure command, as it will give you better idea of what you are doing.
My LFS(BLFS) is far from business desktop, but I use it as a normal development environment for all my linux project
 
Old 03-02-2007, 05:18 PM   #17
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
I'm currently working on my 5th lfs build, using the latest livecd. [ lfs 6.3 pre3 ]
I'm actually building it on an AMD AM2 3800+ 64bit system.

I'm taking my time and doing it slowly, just an hour or two a week.

I tested the brand new hardware with opensuse 10.2 pre2, fedora 6 and mandriva 2007 for hardware compatablity.
[ note: suse will not complete an install, it fails every time, fedora and mandriva both install and run everything perfectly. ]

I usually copy the book from the livecd to a disk and take it down to staples office depot and pay the $15 to have them print it, so I have a hard copy to read wherever I am as I'm working on the system. This means I can read each part before I work on it, re-read if there are errors when working on it, and don't have to keep switching terminals to do so.
[ the xorg driver for the video card, an nvidia 6800 chipset card from asus, doesn't play nice with the card, I'll have to use the nvidia supplied drivers if I install the xserver ]
 
Old 03-05-2007, 11:36 AM   #18
duncan21
LQ Newbie
 
Registered: Mar 2007
Location: LA
Distribution: LFS
Posts: 4

Rep: Reputation: 0
To me, the only way to do it is through buildscripts.... here's an example of one I use:

file: gawk.build
Code:
#/bin/bash

################################################################################
#  gawk                                                                        #
#------------------------------------------------------------------------------#
#          GNU awk: programs for manipulating text files                       #
################################################################################

# pkg info
P=gawk
V=3.1.5
PV=$P-$V
A=$PV.tar.bz2

# misc dirs
SD=/usr/src			# dir holding src tarballs and patches
TMP=/tmp			# tmp dir, where we build the packages
ST=$TMP/$PV			# src tree of untarred pkg
LDR=/var/log/build/$PV		# dir holding logfiles for the given package

# logfiles
TL=$TMP/tmplog			# tmp file used for logging
PALOG=$LDR/patch.log		# logfile of output from patching
CFLOG=$LDR/configure.log	# logfile of output from running configure
BLOG=$LDR/build.log		# logfile of output from building
CHLOG=$LDR/check.log		# logfile of output from running testsuites
ILOG=$LDR/install.log		# logfile of output from package install
PILOG=$LDR/postinstall.log	# logfile of output from postinstall commands

# patches
PAT1=$SD/$PV-segfault_fix-1.patch

# compilation flags
# march:		athlon-xp
# optimize level:	2 (default)
MARCH="athlon-xp"
OPTIMIZ="O2"
export CFLAGS="-march=$MARCH -$OPTIMIZ"
export CXXFLAGS="$CFLAGS"


set -e				# ensure script stops on errors

# B1. unpack the tarballs ******************************************************
  cd $TMP
  tar xf $SD/$A
  
# B2. create dir to write build logs to ****************************************
  mkdir -p $LDR

# B3. patch src ****************************************************************
  cd $ST

  # Under some circumstances, gawk-3.1.5 attempts to free a chunk of memory
  # that was not allocated.
  # This bug is fixed by the following patch:
  ( patch -Np1 -i $PAT1 2>&1 | tee $PALOG && exit $PIPESTATUS )
  
# B4. configure package ********************************************************
  cd $ST
  ( ./configure --prefix=/usr --libexecdir=/usr/lib 2>&1	\
  				| tee $CFLOG && exit $PIPESTATUS )

  # Due to a bug in the configure script, gawk fails to detect certain aspects
  # of locale support in glibc.
  # This bug leads to, e.g., Gettext testsuite failures.
  # Work around this by appending the missing macro definitions to config.h:
cat >>config.h <<"EOF"
#define HAVE_LANGINFO_CODESET 1
#define HAVE_LC_MESSAGES 1
EOF

# B5. build package ************************************************************
  cd $ST
  ( make 2>&1 | tee $BLOG && exit $PIPESTATUS ) 

# B6. check build **************************************************************
  cd $ST
  ( make check 2>&1 | tee $CHLOG && exit $PIPESTATUS )

# B7. install package **********************************************************
  cd $ST
  ( make install 2>&1 | tee $ILOG && exit $PIPESTATUS )

# B8. postinstall configuration ************************************************
  # empty ---------------------

# B9. Compress build logs ******************************************************
  for logfile in $LDR/*
  do
    bzip2 -9 ${logfile}
  done

# B10. cleanup *****************************************************************
  cd $TMP
  rm -rf $ST		# remove unneeded src tree

# B11. print success message ***************************************************
echo "Package $PV successfully built and installed!"
Constructions such as ( make 2>&1 | tee $BLOG && exit $PIPESTATUS ) are explained in the BLFS book.
Constructions such as cat <$TL $>>ILOG are used to append the results of a single operation to the step's build/install/postinstall/etc. logfile.

It's much more time-consuming to do it this way, but then you have a good base that can easily be updated later as the system grows.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS 6.2: made mistake when going from lfs to root setup oldgeek Linux From Scratch 4 11-12-2006 09:00 PM
LFS question - lack of activity in LFS Forum nykey Slackware 4 06-05-2006 05:54 PM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM
LFS-7.0-cross-lfs-20050902-x86_64-Multilib Basel Linux From Scratch 0 09-03-2005 05:03 AM
cannot login as user 'lfs' [su - lfs] mayasedai Linux From Scratch 2 07-26-2005 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration