LinuxQuestions.org
Review your favorite Linux distribution.
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 04-08-2006, 02:52 AM   #1
Chereb
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu, LFS
Posts: 11

Rep: Reputation: 0
Question LFS live CD question


I was wondering, does the LFS live CD truly offer everything that you need to be able to build a LFS system on a blank computer? (This is all taking place on the live CD)One of the first things I ran into was trying to partition using cfdisk(LFS book part 2.2), it tells me that I only have read access to the hard drive, and on another occasion I attempted using mkswap(LFS book part 2.3), and it told me that the command did not exist?

I know the things I mentioned can be done with seperate bootable programs. But, the reason I was wondering, is because the LFS site claims that the bootable disc has everything you need to work with in building the LFS environment. I apologize if I sound like I'm nitpicking, I'm just wondering if I should be expecting to use seperate programs than the one that the LFS live disc is offering, any answers are appreciated, thank you.
 
Old 04-08-2006, 11:02 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Both cfdisk and mkswap are on the live cd (checked on a version 6.1-3 liveCD). Both commands also work.

Could you be a bit more elaborate on what (and how) you tried to do.

Hope this helps.
 
Old 04-08-2006, 12:19 PM   #3
Chereb
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu, LFS
Posts: 11

Original Poster
Rep: Reputation: 0
I have to go to work so I'll post this quick. When I opened cfdisk, it said "read only mode" and it didn't accurately show what I had on the partition table, not quite sure why that happened but I will explain more later, thanks for your reply.
 
Old 04-09-2006, 03:42 AM   #4
Chereb
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu, LFS
Posts: 11

Original Poster
Rep: Reputation: 0
Hmm...mkswap is working this time, for some reason or another, I have no idea what happened.

I am running into other issues though. During the "make" command of the first binutils compilation, it goes for a little while then it gets stuck at "checking if gcc static flag -static works..." and does not go any further...not exactly sure why it is doing that.

Some of the things I did different were that I built my environment under root rather than a user, and I did that because when I was under the user LFS that I had created, I was unable to create folders(lol im a newb), and I tried using su but it asked for a password(this is the LFS live cd), and I did not know what the password was, couldnt get in. Also, I skipped the part where it talks about patching binutils, I didn't think I needed it because it wasn't on the LFS live CD(it is supposed to have everything needed). I don't believe anything else is missing.

Thanks a ton, hope to find a solution soon.
 
Old 04-09-2006, 06:13 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi again,

You need to follow the LFS book, especially if you are a newby at this.

If patches are present and mentioned you do need to do this (patch the appropriate packet[s]). The liveCD has all the original packets and patches, but it did not patch all the packets before putting them on the CD.

Hope this helps.
 
Old 04-09-2006, 10:50 AM   #6
Chereb
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu, LFS
Posts: 11

Original Poster
Rep: Reputation: 0
Hmm, when I get back from work today I will check what version of GCC the LFS live CD is using so I can find out if the binutils patch needs to be installed or not.

One other problem I do know of off hand when I go precisely by the book is when it asks me to make folders under the "lfs" user that I have created, it says I do not have permission to do that, what should I do then?

Thanks for your help Druuna.
 
Old 04-09-2006, 11:08 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Only thing I can come up with without any extra info: You did part of the install as root, maybe the basedir was made as root and you don't have the permissions to create files/dirs as LFS user.

I've installed LFS many times before and never seen this problem before or heard others mention this. I still believe it is caused by not following the instructions.

Hope this helps.
 
Old 04-10-2006, 04:38 AM   #8
Chereb
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu, LFS
Posts: 11

Original Poster
Rep: Reputation: 0
Alright, after a couple of hours I have a more detailed process, hope this gives important information.


Specs: 128MB RAM, 1.3 Ghz Duron, 4.3 GB Quantum Bigfoot HD

1.Loading UBCD(Ultimate Boot CD) and used Autoclave to COMPLETELY wipe hard drive.

2.Loaded LFS live cd.

3.Typed in cat/proc/version (as specified in preface.4 in the LFS 6.1.1 book) and it says “Linux version 2.6.11.12 (root@sycamore.knierim.org) (gcc version 3.4.3) #1 SMP S at Oct 1 11:36:18 GMT 2005.

4.Typed in “cfdisk /dev/hdc”(I specify /dev/hdc because it considers my CDROM drive to be my primary drive by default, so if I just typed in cfdisk, it would go into my cdrom drive and not allow me to do anything) to begin to make partitions. I make two separate partitions, one for the main partition that I will load LFS onto(hdc1: 4000 MB Primary, Boot, Type: Linux) and the second one for swap(hdc2: 335.31 MB Primary, Type: Linux swap/Solaris). Clicked write, it finishes and now I'm back to the prompt.

5.Typed in “mke2fs -v /dev/hdc1” to change the native linux partition into an ext2 partition, success.

6.Typed “debugfs -R feature /dev/hdc1” to see if host file system has custom enhancements. It has none.

7.Typed “mkswap -v /dev/hdc2” to initialize swap partition, I get “mkswap: warning: truncating swap area to 133890kB Setting up swapspace version 0, size = 133885KB” as a result.

8.I typed “export LFS=/mnt/lfs” to set up mount point to an environment variable, typed “mkdir -pv $LFS” and it gave me “mkdir: created directory '/mnt/lfs'”, typed in “mount -v /dev/hdc1 $LFS” and it said “mount: you didn't specify a filesystem type for /dev/hdc1 I will try type ext2 /dev/hdc1 on /mnt/lfs type ext2 (rw).

9.I run the “mount” command to see if my partition has restrictive permissions on it, but it does not, it has (rw) on it.

10.Typed “mkdir -v $LFS/sources” to create a directory to hold the tarballs and patches and to use as a working directory. Typed “chmod -v a+wt $LFS/sources” to enable write and sticky mode, it says “mode of '/mnt/lfs/sources' changed to 1777 (rwxrwxrwt)”.

11.Copied entire “sources” directory from CD to the “/mnt/lfs/sources” folder to place all of the files in there that I would need. Typed in “cp -r /sources /mnt/lfs/sources” in order to complete the job, ended up with another unneccessary “/sources” to add to the directory to make it “/mnt/lfs/sources/sources” where my tarballs and patches are located, oh well, no biggy I guess.

12.Checked to make sure the $LFS variable is still set up right by typing “echo $LFS”, it prints “/mnt/lfs” to the screen.

13.Typed in “mkdir -v $LFS/tools” to create temporary tools directory, success. Created a tools symlink on the host system by typing “ln -sv $LFS/tools /”, after I typed that, it printed “create symbolic link “//tools' to '/mnt/lfs/tools” to the screen.

14.Typed in several commands to add a new user as specified in (4.3): “groupadd lfs”, “useradd -s /bin/bash -g lfs -m -k /dev/null lfs”.

15.I typed in “passwd lfs” to give user lfs a password, “pleasework” being the pass.

16.Gave ownership of directories to user lfs by typing in “chown -v lfs $LFS/tools”, and “chown -v lfs $LFS/sources”.

17.Typed in “su – lfs” to log into user lfs.

18.Typed in startup file 1:“cat > ~/.bash_profile << “EOF””, “exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash”, “EOF”. Typed in the next startup file “cat > ~/.bashrc << “EOF””, “set +h”, “umask 022”, “LFS=/mnt/lfs”, “LC_ALL=POSIX”, “PATH=/tools/bin/:/bin:/usr/bin”, “export LFS LC_ALL PATH”, “EOF”. These are the same ones mentioned in 4.4.

19.I type in “source ~/.bash_profile” to have my environment completely ready.

20.Typed in “echo $LFS” to make sure again that the environment variable is set up correctly.

21.In 5.31 it mentions that I need a patch if my gcc version is 4 or later, but since it is not(as shown in part 3 of this list), I need not do anything with it.

22.Now, here it asks me to type “mkdir -v ../binutils-build” in section 5.3.1. This is where I hit a brick wall. It says “mkdir: cannot create directory '../binutils-build': Permission denied”.

I am logged on as user “lfs” in my environment when I type the last step, as it never indicates me to leave. Hopefully someone will be able to help, thanks everyone for even reading this. I am absolutely determined to get this working.

Thanks, Shane
 
Old 04-10-2006, 06:23 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Quote:
11.Copied entire “sources” directory from CD to the “/mnt/lfs/sources” folder to place all of the files in there that I would need. Typed in “cp -r /sources /mnt/lfs/sources” in order to complete the job, ended up with another unneccessary “/sources” to add to the directory to make it “/mnt/lfs/sources/sources” where my tarballs and patches are located, oh well, no biggy I guess.
What did go wrong here? How can you end up with 'another unneccessay /sources', this is the directory (on cd) that holds all the sources. Hardly unneccessay. Bu maybe I misundestand something.

Quote:
22.Now, here it asks me to type “mkdir -v ../binutils-build” in section 5.3.1. This is where I hit a brick wall. It says “mkdir: cannot create directory '../binutils-build': Permission denied”.
From which directory do you execute this step? It should be done from within the binutils directory. I.e.:

bunzip2 binutils-<version>.tar.bz2
tar xf binutils-<version>.tar
cd binutils-<version>


then

mkdir -v ../binutils-build
cd ../binutils-build


Maybe you did all this, but it's not clear from your example.

Other things you can check if the above doesn't help: Are the permissions for the $LFS/sources and it content correct? (should be, if step 16 was done correctly).

Hope this gets you going again.
 
Old 04-10-2006, 07:11 PM   #10
Chereb
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu, LFS
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks Druuna! I have made some progress. I did not know that I had to be in the binutils directory, I never saw that instruction specified(or maybe it was implied, I donno).

But I have advanced to part 5.7 and hit another problem, I type out the specfile thing and enter it into the command line.
Quote:
SPECFILE=`gcc --print-file specs` &&
sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
$SPECFILE > tempspecfile &&
mv -f tempspecfile $SPECFILE &&
unset SPECFILE
But it always outputs some sort of man page. This is the exact output from top to bottom that is shown on the screen(it scrolls down really fast and I'm not sure how to scroll up to see the rest of it).

Quote:
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if extension supplied)
-l N, --line-length=N
specify the desired line-wrap length for the 'l' command
--posix
disable all GNU extensions.
-r, --regexp-extended
consider files as separate rather than as a single continuous long stream.

-u, --unbuffered
load minimal amounts of data from the input files and flush the output buffers more often

--help display this help and exit
--version output version information and exit

if no -e, --expression, -f, or --file option is given, then the first non-option argument is taken as the sed script to interpret. All remaining arguments are names of input files; if no input files are specified, then the standard input is read.

E-mail bug reports to: bonzini@gnu.org .
Be sure to include the word ''sed'' somewhere in the ''Subject:'' field.
And I wasn't sure what that meant, so I went a little further and did the test to see if the toolchain was working, with using cc and gcc, none of them worked, so I figured what I posted above was a problem and that I wasn't doing it right, what do you think? Thanks for your time.

Note: All of this was done under "lfs:/mnt/lfs/sources/gcc-3.4.3/gcc-build/gcc", not sure if I am in right directory or not...

Last edited by Chereb; 04-10-2006 at 07:13 PM.
 
Old 04-11-2006, 04:07 AM   #11
midiox
Member
 
Registered: Oct 2005
Location: Rezekne, Latvia
Distribution: LFS
Posts: 31

Rep: Reputation: 15
Yes, I just finished my LFS and I was a newbie too when I started this all. I found out that it is really great that I can
Code:
startx
so I can do everything from XFCE File Manager and terminal windows. Do not know why, XFCE was a bit unstable - some windows sometimes suddenly closed themselves. But still as a Windows user I found it really convenient to compile in the terminal and at the same time untaring sources for next packages.
As far as I know, LFS live CD has all I needed.
So briefly what I did was:
downloaded LFS Live CD Hint from here:
http://www.linuxfromscratch.org/hint...rom-livecd.txt
it was really useful, it has some scripts that ease chrooting.

Made lfs partition.
Mounted it.
Ran startx.
Made a folder /mnt/lfs/sources
Made a lot of folders for all the source packages:
Code:
mkdir binutils gcc glibc
and so on.
Extracted all the packages in appropriate folders and copied needed patches there.
Created /mnt/lfs/setenv.sh script with gvim (XFCE has it!)
and copied the code from LFS CD Hint to this script.
Ran the script and voila! I was chrooted in the new environment. And then lengthy building process. I can also warn that when building final system there will be many failed tests but you can neglect many of them - thy are not fatal in the most cases.
Good luck!
 
Old 04-11-2006, 10:03 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Quote:
Originally Posted by Chereb
But I have advanced to part 5.7 and hit another problem, I type out the specfile thing and enter it into the command line.
The SPECFILE= line you included is correct, I hope you did not make a typo when you typed out the command (if at all possible: copy->paste).

A typo is probably what happened, it's so easy to make a small mistake.

Quote:
But it always outputs some sort of man page. This is the exact output from top to bottom that is shown on the screen(it scrolls down really fast and I'm not sure how to scroll up to see the rest of it).
The text given looks like an (sed) error report, this strenghtens my idea about the typo.

You need to fix this, before continuing.

Quote:
Note: All of this was done under "lfs:/mnt/lfs/sources/gcc-3.4.3/gcc-build/gcc", not sure if I am in right directory or not...
I don't think this is correct:
/mnt/lfs/sources/gcc-3.4.3 => the dir that gcc was placed after untarring.
/mnt/lfs/sources/glibc-build => dir to work from (NOT mnt/lfs/sources/gcc-3.4.3/gcc-build).

Hope this helps.

Last edited by druuna; 04-11-2006 at 10:32 AM.
 
Old 04-11-2006, 09:25 PM   #13
Chereb
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu, LFS
Posts: 11

Original Poster
Rep: Reputation: 0
I have tried 1000 times to get this to work, I keep getting that exact same error report. I have no idea why I can't get it to work.. It mentions in the same part that you can edit the file manually, I have tried and tried to open the specs file (which I am assuming is the one under the GCC folder), with "vi" and "cat", is there any other way I can open it and edit it? Neither of those seem to work, plus....one other thing, my computer has been on for days, am I going to lose all of this if I restart it? Thanks in advance.
 
Old 04-12-2006, 10:17 AM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi again,

It's not clear what you did and did not do.

- Did you create the correct glibc-build directory and re-start gcc install from there?
- Did you try copy/paste the SPECFILE=....... part?

About shutting down your machine and starting again: You do need to do some things, depending on where you ended.

For all of chapter 5:
(most of) Chapter 4 need to be re-done. You will get some 'errors' about certain dirs that already exist, ignore these errors.

For chapter 6:
Let's get there first

Hope this gets you going again.
 
Old 04-24-2006, 08:30 PM   #15
Nemau
LQ Newbie
 
Registered: Sep 2005
Posts: 3

Rep: Reputation: 0
Chereb, i can help you, i just saw your message, it is simple, it's very about syntaxe. The first line, "SPECFILE=`..." there is your problem, the ` it is not a ' it is `, in french is a accent like č ŕ and not 'a 'e, it's a little difference but this what's bug you.
 
  


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.0 Live refuses to load Tadaen Linux From Scratch 1 12-20-2005 09:33 AM
new to LFS live CD abhishekgedam Linux From Scratch 5 12-09-2005 02:46 PM
BLFS using LFS Live CD? AxXium Linux From Scratch 6 07-25-2005 08:15 PM
Lfs Live Cd?? win32sux Linux From Scratch 7 02-13-2005 12:12 PM
Newbie question: Is it possible to install LFS 5.1.1 using Live CD? sburge3406 Linux From Scratch 2 09-02-2004 07:14 PM


All times are GMT -5. The time now is 11:45 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration