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.
After successfully building lfs stable 7.4 using jhalfs I run into problems when rebooting.
I get kernel panic - no init found.
When I try to boot manually using the GRUB command line, I can see the root folder structure and the kernel image is where it is supposed to be. However, /dev only contains console and null. sda1 is not there for some reason.
I have read a lot of threads describing similar problems, but I could not find a solution. It looks as if the kernel was missing a driver. But I did the kernel config using essentially default settings. A large number of drivers is compiled into the kernel (not as a module). In particular, ext4 is there. I really don't know what to look for...
Any ideas?
I did do chapter 8 manually, grub install went through ok...
Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd0,1)
menuentry "GNU/Linux, Linux 3.10.10-lfs-7.4" {
linux /boot/vmlinuz-3.10.10-lfs-7.4 root=/dev/sda1 ro
}
Thanks for your reply.
Hm, I installed mingetty and changed /etc/inittab accordingly (in order to get auto login).
However, now I have overwritten the file with the original from the book and reinstalld the lfs-bootscripts. It still doesn't work (same message).
What do you mean by /sbin/init, exactly? Because the book version does not contain this line: http://www.linuxfromscratch.org/lfs/...r07/usage.html
I tried again, this time I reinstalled Sysvinit-2.88dsf, then the bootscripts. Still the same.
Here is the screenshot: http://postimg.org/image/atxeznalb/
Unfortunately, that's all the console shows.
I'm on a virtual box right now, but the error also appears on an physical machine.
/sbin/init is in place.
So are the contents of /etc/rc.d. I checked the files from appendix D, i.e. the files from the bootscripts, and they are all there.
/etc/inittab is a copy/paste from the book so it should be correct.
I really don't know what to look for.
I'm sure it's something very simple...
So are the contents of /etc/rc.d. I checked the files from appendix D, i.e. the files from the bootscripts, and they are all there.
The scripts might be there, but are the correct script(s) called from /etc/inittab?
Quote:
/etc/inittab is a copy/paste from the book so it should be correct.
I've seen copy/pastes from the book go wrong. Depends on the book, but I do believe that copy/pasting from pdf books can go wrong. Do check the html version (book or on-line) and/or post it here.
The scripts might be there, but are the correct script(s) called from /etc/inittab?
I will look into this.
Quote:
I've seen copy/pastes from the book go wrong. Depends on the book, but I do believe that copy/pasting from pdf books can go wrong. Do check the html version (book or on-line) and/or post it here.
I always use the online html version of the book, see the link in my second post and the following:
I'm on the physical machine now. Shift-Pageup does not work but I can see a little mor due to higher resolution. Right before the EXT4 message two error messages failing to mount ext2 and ext3 appear. Before this there is only a long list of drivers being loaded. No errors or warnings. Looks reasonable to me.
From looking at inittab and /etc/rc.d I can't find anything wrong. But maybe I don't know what to look for exactly.
I think the best thing for me to do is to rebuild the whole system, sticking to the book as closely as possible. Then try to reboot again and see if it works...
Ok, I restarted where jhalfs finished, i.e. at the end of chapter 6. Then I sticked as closely to the book as possible. Now I get a different error message (this time from the virtual box, where shift+page up works):
The errors I do see indicate possible missing or wrong entries in /etc/fstab. It should look something like this (looks different then the one in your first post):
Right! My /etc/fstab is bad.
The test system I created booted perfectly with the corrected file.
The other system still does not boot. The reason is the kernel config. It can't mount the root file system.
I suspect it misses some driver, but I have yet to find which. My system does not have any modules, but a lot of drivers compiled into the kernel. I don't know how I could have missed such an important part. But I will simply compare the config files to find out where the problem lies. The other system does boot with a defconfig kernel...
I will post back when I have the solution.
You've talked about and been using different machines and different configurations.
To stay on the right track can you post the error(s) shown (as much as possible, like post #12) from the machine you are having problems with?
First thing that comes to mind without seeing any errors: This one needs to be selected Device Drivers -> Generic Driver Options -> Maintain a devtmpfs filesystem to mount at /dev
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.