Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
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.


  Search this Thread
Old 07-05-2009, 10:13 AM   #1
LQ Newbie
Registered: Jul 2009
Posts: 11

Rep: Reputation: 0
Problem making a bare skeleton LFS

Hi, I'm rather new to Linux and this forum in particular (this is my first post).

My goal is to make a new custom-made Linux with just a kernel and a
bootloader, which will run a certain program I have written in the
background and the shell will be busybox.

My first step is trying to just boot it up with grub and a kernel and
have it maybe panic for lack of something to do after the boot process.

So after successfully going through the LFS 6.3 stages, I tried to make
that system. I set up a clean image of an x86 computer using VMWare,
booted it up with the LFS live CD and made a couple of partitions and
ext2 FS, completely empty still of course.

Now I'll throw in another one of my restrictions; this system will be
used as a minimal, embedded operating system, where I will not be able
to access the 'on board' system and compile on it so everything must be
cross-compiled into it. Eventually I'll be making an image of the system
to burn onboard and it will not change, and things like GCC should not be

I compiled and installed grub (0.97) on it - the only exception of a
package compiled in the target system, because when actually moving it to
an embedded board we could burn the MBR with the data we want. (Whereas
manually I don't know how to set up grub on the MBR of the virtual
machine, and its shell setup does so on its own).
I compiled the kernel on the host system and sortof installed it into
the target system. I'm pretty sure I 'cross-compiled' or
'cross-installed' it wrong but getting GCC, binutils, and whatever else
is needed and later getting rid of it is something I don't know how to
do and is time consuming and I'm sure a kernel cross compile is a
feasible thing.

The kernel version is, the one from the LFS 6.3.
After fiddling around, my /boot/grub/menu.lst record for the kernel
looks like this:

root      (hd0,0)
kernel    /boot/vmlinuz- root=/dev/sda1 ro
initrd    /boot/initrd.img-
First, to make sure these definitions were fine, I tried running this
kernel on my host system and it worked fine. But when I try to run this
on the VMWare machine (which is -supposed- to be identical to the host
system) I encounter problems;

It starts the boot process normally but eventually slows down and
repeatedly spams this line in 1 second intervals:

pciehp: HPC vendor_id 15ad device_id 7a0 ss_vid 0 ss_did 0
After about 20 of these (identical) messages, the screen flashes,
it runs down some more assembly-looking lines and ends up with this:

[<c01054f7>] kernel_thread_helper+0x7/0x10
And just stops, not responding to anything.

I'm not sure how to even log any of it so I can post it here, this is
all copied screen to paper to screen. I also don't know how to use GDB
if this is required here so run me down how to do what you want me to
do if this requires using GDB..
keep in mind that I'm booting this from inside the virtual machine.

To sum it up, I have two questions:
1. Does anyone know what's wrong there? Or what other data I need to
post to make this clearer?
2. How can I compile a kernel from the host system into the target
system (I can mount a VMWare image on my filesystem if it helps)?

Old 07-05-2009, 10:30 AM   #2
LQ Guru
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
OK, Welcome to LQ Kesem!
Now, I'm kinda new too so I can't help with the kernel issues etc
But, why LFS for embedded device?
There are a few tools I use including tinycore/microcore and my portable-qemu which runs from usb, etc
using a small-to-med partitioned qemu-img where it's installed too.

Tinycore2.1/microcore2.1 either are great as embedded, for appliaences etc 10mb/7mb

There are LFS people here and they can help with that...your menu.lst looks ok to me.
did you try root=/dev/hda1?
I have to do that for Puppy linux on some of the puplets cause the installer writes the menu.lst
with root=/dev/sda1 and a kernel panic etc, and if I change it to root=/dev/hda1 it works?!

but, I don't know what the other errors are, but somebody here will.
Old 07-05-2009, 11:06 AM   #3
LQ Newbie
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
OK, Welcome to LQ Kesem!

did you try root=/dev/hda1?
The partition is /dev/sda1. I tried /dev/hda1 and other permutations
earlier but the root directory could not be found and the boot process
got stuck much earlier.

But, why LFS for embedded device?
It seemed like the most direct and simplest approach, make an empty file
system, load it up with tools as minimal as possible (kernel, boot
loader, busybox).

Tinycore2.1/microcore2.1 either are great as embedded, for appliaences etc 10mb/7mb
We prefer something custom and modified rather than public and pre-built,
for security reasons. The final image should not even weigh 7mb, more
like 100kb - or as least as possible.
Old 07-05-2009, 11:20 AM   #4
LQ Newbie
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
I realize the problem may be vague, I could hardly find anything about it
on google. If anyone could suggest me a newb-friendly kernel
cross-compilation guide, or how to go about this a different way (building
the absolute minimal system), I'd go with that.
Old 07-06-2009, 09:40 AM   #5
LQ Newbie
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
A followup for those curious:
The problem was with the ACPI. Append this to the bootup line:
noapic nolapic acpi=off
And it will not spam the earlier problematic message 15 times and progress
a little further into the following line:
Cloocksource tsc unstable (delta = ########ns)
Time: pit clocksource has been installed.
The problem with the ACPI had apparently been that VMWare does not
emulate that module properly.
Old 07-06-2009, 10:11 AM   #6
LQ Newbie
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
And after adding
It resumes the boot process, with the unnerving
Cloocksource tsc unstable (delta = ##########ns)
(It's about 1.2s)

But it continues the boot process!
Only to be stuck at the dreaded kernel_thread_helper line again.
It seems it's the same subroutine he's repeating a few times, and
from the commands it looks like it's registering a driver during bootup,
so my guess is it's a missing driver?

God knows.

Who else knows what sins VMWare commits, other than emulating ACPI and
a clock wrong?


crosscompile, install, kernel, lfs, minimal, vmware

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
problem making linux headers. errors recieved during step 5.6 . LFS version 6.4 Dakiloth Linux From Scratch 1 06-24-2009 10:17 AM
Problem with making a new LFS system David2010 Linux From Scratch 10 05-20-2009 02:58 AM
Problem linking GTK skeleton lgi123 Programming 6 10-03-2007 01:14 PM
bare ide and bare acpi kernels denning Slackware 1 03-04-2005 06:50 AM
creating a bare-bare-barebones system for an underpowered laptop orange400 Linux - General 3 06-15-2004 06:53 PM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration