3

I am attempting to build a Linux distribution with Linux From Scratch (LFS) version 8.1. I am building it with ElementaryOS (which is based on Ubuntu) which I have installed on VirtualBox on my Mac. I have a bit of experience with Linux, so I have an idea of what I’m doing.

Everything was going well until I got to section 5.4 in the book. This section instructs how to compile and install Binutils 2.29 (the book instructed me to use version 2.29 since newer versions have not been tested yet for Linux From Scratch). Once I got to this part of the book, nothing seemed to go right. Here’s what I did:

Following the book, I prepared to compile it with this command:

./configure --prefix=/tools            
         --with-sysroot=$LFS        
         --with-lib-path=/tools/lib 
         --target=$LFS_TGT          
         --disable-nls              
         --disable-werror

After I did that I compiled it with make. Since I’m working on a 64bit machine and system, I executed this, as instructed, after compiling:

case $(uname -m) in
  x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
esac

Then I executed make install and this is where I started having issues. Terminal gave me this:

make[1]: Entering directory '/media/nathanael/f2f5c607-926f-4931-ba6e-4e4fd6f08eee/build'
/bin/bash ./mkinstalldirs /tools /tools
mkdir -p -- /tools /tools
mkdir: cannot create directory ‘/tools’: File exists
mkdir: cannot create directory ‘/tools’: File exists
Makefile:2466: recipe for target 'installdirs' failed
make[1]: *** [installdirs] Error 1
make[1]: Leaving directory '/media/nathanael/f2f5c607-926f-4931-ba6e-4e4fd6f08eee/build
Makefile:2224: recipe for target 'install' failed
make: *** [install] Error 2

I had several issues before getting to this point, thankfully I managed to fix them, but this one baffles me. Any suggestions on what I should do?

I did deviate from the book in one place. The book had me create an unprivileged user called lfs which I was supposed to use when compiling (this way, chances of accidentally ruining the system would be low). But I had problems compiling with lfs. I tried several things to get it to work but found that just compiling as admin worked the best. Hope that doesn't cause problems in the long run.

Any help would be very greatly appreciated.

1 Answers1

-1

It seems that the build directory is cluttered.

Try running make clean.