[SOLVED] Deleting the source directory and build directory after compiling each package
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.
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)..?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.