LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-22-2013, 05:44 AM   #1
ganiz
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Rep: Reputation: Disabled
Question Deleting the source directory and build directory after compiling each package


Hello all,

I just wanna make clear one important thing.

on the lfs book,at chapter 5.1,it is mentioned that we have to delete both the source directory and build directory after installing each package,to avoid mis-configurations.

Here, does the source directory refers to the actual zipped source file (e.g., binutils-2.17.tar.bz2) or the extracted source file (e.g., binutils-2.17)..?

please guide me..

thanks in advance..
Attached Thumbnails
Click image for larger version

Name:	bnr.JPG
Views:	35
Size:	37.4 KB
ID:	14034  
 
Old 11-22-2013, 05:50 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You need to delete the directory/directories.

After untarring, for example binutils-2.17.tar.bz2 you have a binutils-2.17 directory and during the build you create a binutils-build directory.

The book is talking about binutils-2.17 and binutils-build. Not all packages use a build directory, so most often you only have to delete 1 directory.
 
1 members found this post helpful.
Old 11-22-2013, 05:59 AM   #3
ganiz
LQ Newbie
 
Registered: Jul 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by druuna View Post
You need to delete the directory/directories.

After untarring, for example binutils-2.17.tar.bz2 you have a binutils-2.17 directory and during the build you create a binutils-build directory.

The book is talking about binutils-2.17 and binutils-build. Not all packages use a build directory, so most often you only have to delete 1 directory.
Got it,Drunna..

Thanks again..
 
Old 01-10-2018, 11:14 AM   #4
parotta36
Member
 
Registered: Dec 2017
Location: Madurai
Distribution: Linux Mint | Slackware
Posts: 59

Rep: Reputation: Disabled
Then why are e=we extracting and building it if we are deleting it?
I fell like I am missing something here. Why are we building it and deleting it?!
 
Old 01-10-2018, 11:28 AM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
parotta

These are not the final installed packages, they are just where they are built, they will be installed into $LFS/tools Ch5 and Ch6 installed as the final build of system.

You have to untar the tarball cd into dir do what the book sayes. Then return to sources dir, and rm the dir which you have just built, reason for this is so that the next time you build the package it is afresh untarrred package, also if a package is looking for something it dosn't get confused with previous dir.
Also if a package fails to build you should remove it and untar again.

Last edited by spiky0011; 01-10-2018 at 11:32 AM.
 
Old 01-11-2018, 02:02 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,680
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Once you have installed a package (even if it's just a temporary version in the /tools tree), you don't need the source directory any more. Everything useful in it has been copied over, so you can always delete it. If you need it again, you can recreate it by unpacking the original tarball (which you don't delete!).

In LFS, deleting the source directory as soon as you have completed the installation is particularly important because many packages are built more that once (once or even twice for the tools stage and once for the final system). You must not have any stale files from previous builds left over when you do this.

I agree with spiky that you should also do this automatically if a build fails for any reason. Don't mess about with "make clean", it's not reliable. Just delete the whole directory with its contents and unpack the source tarball afresh.
 
1 members found this post helpful.
  


Reply

Tags
directory



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
Shell script for deleting the oldest directory within a directory kauuttt Linux - Newbie 6 07-14-2013 05:11 AM
Deleting certain files in the home directory from another directory {set} Linux - Newbie 9 02-10-2013 01:53 AM
No build directory in source directory FilthMasterFlex Mandriva 5 01-12-2005 03:03 PM
where is linux source build directory/kernel source tree? webazoid Linux - Software 2 07-01-2004 08:37 PM

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

All times are GMT -5. The time now is 07:31 PM.

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