A few LFS questions


Recommended Posts

I'd finally gotten fed up with the test box I was using for several years, which was an old Dell OptiPlex with a P2/400, Radeon 9250, 640MB of RAM, Creative Audigy 1, and NEC DVDRW (and 120GB disk space spread over 3 disks).

I ordered an Athlon64 X2, 2 gigs of memory, an Nvidia (always NV for Linux, I know that rule) Geforce something-or-other video card, and a card reader for various memory card formats.

I want to do an LFS build on it.

I had a few questions, though: First, as I know jack about the kernel despite being able to use Linux practically, is there anything special I need to do to maximize the performance I get out of a dual-core proc or does the latest kernel do that by itself?

Also, having tried an LFS build on the old system and failed due to supposedly "No space left on device" (BULLSH*T! on a blank 15-gig partition), is it better to do a build when booted into an already-functioning *nix environment like Slackware, Ubuntu, or Fedora as opposed to using the LFS LiveCD? I suspected maybe the "no space" was due to using a ramdisk or something since the CD is obviously nonwritable.

If so, which distro would be particularly well-suited to building LFS? I'm leaning toward Slackware as it comes with all the dev tools, but I know GCC et al are only a "sudo apt-get install build-essential" away on Ubuntu.

Thanks for any input you can give. Specifics are always appreciated, but general advice is great too.

Link to comment
Share on other sites

A full Gentoo build, perhaps? Seems to be well-documented, though I am a "just install it and use it" kind of guy, myself.

I think the Gentoo group has sort of 'depreciated' the full Stage 1 in favor of starting at later stages.

Slack is one of the oldest Linux distros out there. It has a few idiosyncrasies, such as runlevel numbering and such. But I have an old acquaintance that was a Slack guy, and really liked Slack a lot.

Link to comment
Share on other sites

A full Gentoo build, perhaps? Seems to be well-documented, though I am a "just install it and use it" kind of guy, myself.

Yeah, me too. My laptop, which is what I use for my classwork and as my main mobile system, runs Ubuntu and it's great. The LFS project is more a side effort on my part to get really good with Linux and to fulfill that "rite of passage" as it were. Custom-built PC with a custom-built OS. I think it's the geek-quivalent of Jedi building their own lightsabers.

I think the Gentoo group has sort of 'depreciated' the full Stage 1 in favor of starting at later stages.

I'd heard the same thing. I'm not sure what the current status is, though if I were to do a Stage 1 build I'd consider it as good as doing LFS and probably call it a day.

Slack is one of the oldest Linux distros out there. It has a few idiosyncrasies, such as runlevel numbering and such. But I have an old acquaintance that was a Slack guy, and really liked Slack a lot.

Same here. I worked with a fellow who swore by Slack. I used it for a while and it was definitely good. The only dealbreaker was that it couldn't identify my wireless card and so I had to go back to XP. Not really Slack's fault as Ubuntu, at that time, couldn't identify it either. I blame Broadcom in all honesty. They're the ones who didn't release the spec for their card.

Anyway, I was initially thinking Slackware as I know GCC and the other build tools are options right there in the clear at install time, and because it's considered one of the "standards" of Linux, along with Debian.

If I don't get any recommendations against Slackware in the next couple days I think I'm going to go ahead and use it. The only thing that would convince me otherwise is if someone has experience building LFS from Ubuntu and can tell me what I need to apt-get in order to make it work. I'm assuming it would just be build-essential, but I don't know. Only thing is that if I'm going to be doing LFS I don't necessarily need Ubuntu's extras running and eating up CPU time while I'm compiling.

Link to comment
Share on other sites

It's been a while since I've used LFS (I used it for 2 years), but I'll try to answer your questions.

I had a few questions, though: First, as I know jack about the kernel despite being able to use Linux practically, is there anything special I need to do to maximize the performance I get out of a dual-core proc or does the latest kernel do that by itself?

The kernel should do it, but make sure you enable SMP support and choose what type of processor you have (so it can optimally generate code).

Also, having tried an LFS build on the old system and failed due to supposedly "No space left on device" (BULLSH*T! on a blank 15-gig partition), is it better to do a build when booted into an already-functioning *nix environment like Slackware, Ubuntu, or Fedora as opposed to using the LFS LiveCD? I suspected maybe the "no space" was due to using a ramdisk or something since the CD is obviously nonwritable.

I've done both and I haven't found a difference. But I like to start off with a LiveCD so I can wipe the drives and partition them the way I want. I don't think I've come across a "no space" error except when I actually have no space left on the drive. When do you get the error? If is after you chroot into the hard drive's mount point?

If so, which distro would be particularly well-suited to building LFS? I'm leaning toward Slackware as it comes with all the dev tools, but I know GCC et al are only a "sudo apt-get install build-essential" away on Ubuntu.

Thanks for any input you can give. Specifics are always appreciated, but general advice is great too.

I've uses the Gentoo LiveCD. It have everything you need.

Link to comment
Share on other sites

MrA: I get the error when I'm trying to unpack the GCC source tarball. I get binutils compiled and installed fine, I delete the binutils source files, I copy over GCC and when I run tar -xvf gccblahblah.tar.bz2, it gets maybe 1/4 of the way through and starts spitting out "no space left on device."

Link to comment
Share on other sites

I thought I did, but I can only surmise I missed a step somewhere. I did the mke2fs -jv command, the mkeswap command, and the swapon commands for partitioning and formatting.

I exported LFS as /mnt/lfs and I do seem to remember doing mkdir -pv $LFS and then mounting the drive as fstype ext3. In all honesty...I can't figure out where I went wrong, though I'm perfectly willing to admit that I did.

I got nothing against admitting I made mistakes, but it sure would help to know where I made them, you know? At least you and mark are offering me real advice as opposed to "just google it you idiot newbie and stop wasting our time that's invariably worth more than your time." Can't tell you how much I appreciate it, both of you.

Link to comment
Share on other sites

No problem. I've done LFS before and so my linux knowledge is something I can, and am willing to contribute.

So, can you do this. At the location you're extracting your files, can you give me the output of the following commands:

pwd

mount

df -h

df -i

This will give me the current directory, the mounted drives (and mount options), disk space on the drives and inodes on the drives. It should help narrow down your disk space problem.

LFS is frustrating, I know from experience. But I think it's great that you're willing to admit and learn from your mistakes (which you'll make plenty off while using LFS). I'll help you as much as I can.

Link to comment
Share on other sites

Well, I'm actually compiling binutils right now on my VirtualBox system and it seems to be going okay. I have to get home in about 10 minutes so if it's not done I'll have to post the output from those tomorrow, but otherwise I can give them to you soon.

Link to comment
Share on other sites

Got it!

Hmmm... I don't see the problem. I assume your /dev/mapper/lfs-cd is the live-cd. It's a bit strange that it's mounted read-write. You have lots of disk space and inodes (and while using LFS, you run the risk of being out of inodes). I would think it's a permissions problem, except you can extract half-way which suggests it isn't.

There might be some filesystem magic going on (unionfs, chroots, etc) but I don't know.

You know what, I don't know what's up. I'd have to be at a system to be able to figure it out, I just one of those people. What I suggest is to install a regular distro or Windows on your new box and use VMware (or virtualbox) to install LFS. That way, you have a fully functional system and you can hack away at LFS at your leisure. And goto the LFS IRC channel. I'm sure they'll be more than happy to help you.

Link to comment
Share on other sites

Okay. I'll see what happens when I continue the install tomorrow. For all we know I might have done something right on this one that I screwed up on my initial attempt. Thanks for all your help so far.

Link to comment
Share on other sites

Well, I just finished doing the bootstrap compile of GCC, so whatever the problem was on the old system it doesn't appear to be appearing again on VirtualBox.

I'll let you know what happens when the hardware arrives and it's time to do it for real, but I'm thinking it was probably just a stupid mistake on my part the first time around.

Thanks for all the help, guys.

Link to comment
Share on other sites

Okay, next problem:

I'm on chapter 5.11.1, "Re-installation of GCC."

I run

expect -c 'spawn ls'

and the output is "spawn ls."

However, when I go to replace the makefile to prevent fixincludes from running, I enter

cp -v gcc/Makefile.in{,.orig}

and it returns an error stating

cp: cannot stat 'gcc/Makefile.in': No such file or directory

I've tried this from the dejagnu-1.4.4 directory as well as the /mnt/lfs/sources directory, and both yield the same results.

Was I not supposed to delete the gcc and gcc-build directories? If not, will I be able to recopy, re-unpack, and rebuild them to the point where they're usable?

Or is it something totally different that's happening? The book doesn't draw a very clean distinction of where the end of the PTYs section is, so for all I know the fixincludes thing could be related to that and I don't even need to worry since expect returned normal results.

*sigh*

All in all, though, I've made some decent progress today. Certainly come a long way from the weird disk-space error I had last time.

Edited by CelticWhisper
Link to comment
Share on other sites

Deleting the source and build directories is fine. I remember having to keep them when installing Tk (well, I think it was Tk), but that's in the BLFS book.

Just unpack the gcc tarball and run the cp command from within the gcc source directory.

EDIT: The pty's section is unrelated to fixincludes.

EDIT2: You're making me feel like doing an LFS build, for old-time's sake. Must... resist... urge...

Link to comment
Share on other sites

Okay, got to chapter 6.9, rebuilding of glibc. Did the make check step and grepped the Error log. For the most part everything looks okay, but there were two errors that I couldn't find anything about in the book or on LinuxQuestions.org (one of the few sites I can access from the machine on which I'm doing my VM build of LFS). The errors in question are

make[2]: *** [/glibc-build/nptl/tst-cond20.out] Error 1

and

make[2]: *** [/glibc-build/nptl/tst-cond21.out] Error 1

The usual annexc and cancel1 errors are there too but I read that they're not anything to concern myself over.

Someone on LQ did mention errors can happen if certain things time out, which might be happening since I'm building in a VM. Not sure though.

EDIT2: You're making me feel like doing an LFS build, for old-time's sake. Must... resist... urge...

<TEENAGE_TWIT_ANAKIN>C'mon, master, you know you want to. Every Jedi should have a spare lightsaber on hand. Heh, hand, that's so funny in a SW reference. I just slay me somet-AAAAHH, MY HAND!</T_T_A>

Here's what the output looks like:

post-194958-1204236037_thumb.png

Link to comment
Share on other sites

Don't worry about those failures. Glibc (and gcc) has an enormous test suite that almost never passes. At least, it never has for me. I see the test are for threading and so time out's are probably the reason.

Link to comment
Share on other sites

Okay, will do. I figured I'd ask as glibc is one of those things that, if hosed, hoses everything else that's ever built with it, and everything depending on that, and so on in a spectacular proton-torpedoes-down-the-reactor-shaft chain-reaction that can explode the entire install, complete with cheesy 1997-special-edition shockwave ring.

...Why the hell am I channeling George Lucas all of a sudden?

Link to comment
Share on other sites

Next problem (and I was doing so well, too).

Chapter 6.55, installing Udev-1.1.3

The command

mknod -m0666 /lib/udev/devices/null c 1 3

fails with an error

mknod: '/lib/udev/devices/null': No such file or directory

HALP. HAO U FIX? T____T

Link to comment
Share on other sites

How are you so awesome. Is this real. Why can't I use proper punctuation.

It worked.

Back on track, thanks a million.

Link to comment
Share on other sites

  • 2 weeks later...

Finished...at...LAST!

...aaaaaaaaaaaaaaand it kernel-panics.

God...dammit. *headdesk*

First is:

VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Insert root floppy and press ENTER.
scsi 0:0:0:0: Direct-Access   Generic USB SD Reader   1.00 PQ:  0 ANSI:  0
sd: 0:0:0:0: [sda] Attached SCSI removable disk
scsi 0:0:0:1: Direct-Access   Generic USB CF Reader   1.01 PQ:  0 ANSI:  0
sd: 0:0:0:1: [sda] Attached SCSI removable disk
scsi 0:0:0:2: Direct-Access   Generic USB SM Reader   1.02 PQ:  0 ANSI:  0
sd: 0:0:0:2: [sda] Attached SCSI removable disk
scsi 0:0:0:3: Direct-Access   Generic USB MS Reader   1.03 PQ:  0 ANSI:  0
sd: 0:0:0:3: [sda] Attached SCSI removable disk

Sits there for about a minute or so after I hit <Enter>, then:

end_request: I/O error, dev fd0, sector 0
attempt to access beyond end of device
fd0: rw=2, want=24, limit=8
ReiserFS: fd0: warning: sh-2006: read_super_block: bread failed (dev fd0, block 2, size 4096)
attempt to access beyond end of device
fd0: rw=0, want=136, limit=8
ReiserFS: fd0: warning: sh-2006: read_super_block: bread failed (dev fd0, block 16, size 4096)
end_request: I/O error, dev fd0, sector 0
end_request: I/O error, dev fd0, sector 2
EXT3-fs: unable to read superblock
end_request: I/O error, dev fd0, sector 0
end_request: I/O error, dev fd0, sector 2
EXT2-fs: unable to read superblock
end_request: I/O error, dev fd0, sector 0
end_request: I/O error, dev fd0, sector 0
FAT: unable to read boot sector
VFS: Cannot open root device "sda1" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
0200				  4  fd0 (driver?)
0340	  4194302 hdb  driver: ide-cdrom
Kernel panic - not syncing: VFS: Unable to mount root fs on unkown-block(2,0)

Sounds to me like it's a problem with either /etc/fstab or /boot/grub/menu.lst, but I have no idea which or if I'm even close.

Link to comment
Share on other sites

What filesystem did you format your root partition in, and did you compile the driver into the kernel or as a loadable module? It looks like it's not seeing your root partition.

Link to comment
Share on other sites

I used ext3 and I'm pretty sure I compiled it in, though I may well have missed it.

How would I go about reconfiguring and recompiling a new kernel if I screwed it up?

Link to comment
Share on other sites

Well, it seems as though you already have ext3 (and ext2 and reiserfs) compiled in, so that's not your problem. You might not have the ide/scsi you need compiled in. I don't know shift+page up works with the kernel, but if it does, can you post more of the boot log.

And to re-compile your kernel, you'll need to boot from a livecd, then mount your hard drive. You won't be able to do a make modules_install without chrooting into your root partition. To make things simple, make a static kernel with no modules (everything compiled in).

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.