LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 05-12-2013, 12:09 AM   #1
fmillion
Member
 
Registered: Nov 2006
Posts: 93

Rep: Reputation: 27
Init isn't running - no output - how to debug?


I created LFS on one system and then transported the entire filesystem over to another system. On the target system, I booted from a LiveCD and used it to install grub and edit fstab, the grub.cfg file, and so on.

Upon booting, the kernel loads fine, but init never responds. The last messages on the console are from the kernel, representing devices attached and detected by the kernel. Typing on the kernel does not produce anything, however the system is not frozen or panicked - I can shift-pageup to view the message history. The system basically hangs here and nothing happens.

When I booted with init=/bin/bash as a parameter bash ran fine and I was able to remount the root filesystem rw and so on, and poke around. However, I can't seem to actually get init to do anything.

Are there any options I can setup so that init will verbosely print out what it's trying to do? I can't really debug this further until I can see why init won't proceed...

Thanks

F
 
Old 05-12-2013, 08:10 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Sounds like init can't find the initab file, is it there in /etc? can you post it?
 
Old 05-12-2013, 01:03 PM   #3
fmillion
Member
 
Registered: Nov 2006
Posts: 93

Original Poster
Rep: Reputation: 27
Yes, inittab is there. I can view it just fine when forcing it to run a bash with init=/bin/bash

It's the stock inittab, as follows:

Code:
# Begin /etc/inittab

id:3:initdefault:

si::sysinit:/etc/rc.d/init.d/rc sysinit

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin

1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600

# End /etc/inittab
My kernel boot parameters are simply:

Code:
linux /vmlinux root=/dev/sda5 ro
/dev/sda5 is the root filesystem, while /boot is on /dev/sda1. Again, the kernel does boot successfully (as I'm able to force a shell with init=/bin/bash). The problem seems to be init.

Another point worth making is that if I run /bin/bash via init= then try to do "exec /sbin/init", the system accesses the hard drive for a while without any console output from either the kernel or init, then powers off.

f
 
Old 05-12-2013, 01:20 PM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
This line is wrong:
si::sysinit:/etc/rc.d/init.d/rc sysinit

Mine hangs the same as yours if I use this line

Try using:
si::sysinit:/etc/rc.d/init.d/rc S

See this:
http://www.linuxfromscratch.org/lfs/...r07/usage.html

Last edited by Keith Hedger; 05-12-2013 at 01:26 PM. Reason: forgot a link
 
Old 05-12-2013, 02:39 PM   #5
fmillion
Member
 
Registered: Nov 2006
Posts: 93

Original Poster
Rep: Reputation: 27
Did some further investigating and I think I figured it out.

First I fixed the init line as you suggested, but no dice...

But, somehow, my kernel didn't get compiled with devtmpfs. Therefore my /dev directory is completely empty - I'm guessing init doesn't like this. ;-)

Recompiling my kernel now, will post again (And mark as solved) if this fixes it.

Thanks!

F
 
Old 05-12-2013, 05:20 PM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
/dev needs null zero and console
 
Old 05-12-2013, 05:41 PM   #7
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by fmillion

But, somehow, my kernel didn't get compiled with devtmpfs. Therefore my /dev directory is completely empty...
Quote:
Originally Posted by linosaurusroot

/dev needs null zero and console
As linosaurusroot said. And an LFS system never has an empty /dev folder, even when it's not running. Section 6.2.1 (Creating Initial Device Nodes) of the 7.3 book has us create /dev/null and /dev/console on the hard drive.

Maybe their absence has something to do with your method of cloning the system to the new partition.

P.S.: CONFIG_DEVTMPFS=y is also required for LFS nowadays, as you said. So I wonder if the original system was ever booted before it was cloned. I sort of assumed that it was a working system, but you never really said that either. And it never would have booted without devtmpfs filesystem support built in.

Last edited by stoat; 05-12-2013 at 05:52 PM.
 
Old 05-14-2013, 04:02 PM   #8
fmillion
Member
 
Registered: Nov 2006
Posts: 93

Original Poster
Rep: Reputation: 27
Recompiled kernel, populated /dev, used a rescue disc to install the kernel and rebooted...and everything works great now.

Thanks!
 
  


Reply

Tags
init



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
Debug init(userspace) on Qemu using gdb ! samurai37 Linux - Virtualization and Cloud 0 05-03-2013 08:44 AM
[SOLVED] Set up app as an init.d daemon, but it isn't running in background and stdout isn't blocked Abscissa256 Debian 1 02-14-2013 12:48 AM
Gnome 3 - debug output of Internet connection Sacha_D Linux - Newbie 1 07-01-2012 04:48 PM
wpasupplicant + prism54 - can anyone debug this output? 66gdub Linux - Wireless Networking 1 11-30-2005 12:08 PM
How to Debug Init Scripts MQMan Slackware 11 03-09-2004 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration