LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices


Reply
  Search this Thread
Old 05-27-2011, 08:20 AM   #1
ToK
Member
 
Registered: Nov 2005
Posts: 108

Rep: Reputation: 17
Booting stops after kernel starts


Hi,

I'm new to gentoo - I simply want to try it. After getting through the installation (Version 20110520) I got the following problem: I restarted the system and everything works find up to the init-process: I could start the kernel (if I enter the kernel option init=/bin/bash - it works) but after that, the system hangs -> It seems like the init script is not started. So I search around and found that gentoo merged to baselayout-2. I checked it: I have baselayout2 and openrc installed.

Does anybody know how I could make gentoo start?

Greetings

ToK
 
Old 05-27-2011, 11:36 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,093

Rep: Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301
Sounds like you have the kernel, modules, and initrd, but not the root filesystem. I presume it's throwing a kernel panic?

It's reliant on the kernel, the root=details on the command line, and /sbin/init & the root tree, and the initrd or kernel to have modules enough to run your box. Post more details or check.
 
Old 05-28-2011, 01:13 AM   #3
ToK
Member
 
Registered: Nov 2005
Posts: 108

Original Poster
Rep: Reputation: 17
OK, here is what I did and have in detail:

I followed the Instruction for gentoo amd64 in german (although they aren't explain the configuration of the baselayout 2 - for example there is mentioned to configure /etc/conf.d/clock not /etc/conf.d/hwclock). I configured my kernel by myself and installed syslog-ng, logrotate and mlocate. Afterwards I installed and configured grub. My grub gentoo entry is the following:

Code:
root (hd0,7)
/boot/kernel-2.6.38-gentoo-r6 root=/dev/sda8
Booting with this entry ends with the following message (I type in the last few lines):

Code:
kjournald starting. commit interval 5 seconds
EXT3-fs (sda8): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) readonly on device 8:8.
Freeing unused kernel memory: 624 k freed
Write protecting the kernel read-only data: 8192k
Freeing unused kernel memory: 600k freed
Freeing unused kernel memory: 112k freed
init-early.sh used greatest stack depth: 3648 bytes left
that's all - the system stops

If I append init=/bin/bash at the boot menu the following additional messages appear:

Code:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
bash: /dev/null: Read-only file system
Then I have a prompt. Since the rootfs is read-only I mounted it read-write, deleted /etc/mtab and mounted the proc filesystem. The file /proc/mounts shows me the following:

Code:
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,noatime,erors=continue,barrier=0,data=writeback 0 0
proc / proc proc rw,relatime
So, the rootfs is mounted. At least I can see the files I created during the installation process (stage3-file and portage-file)

I checked :
baselayout 2.0.2 is installed
openrc-0.8.2-r1 is installed
sysvinit-2.88-r1 is installed

executing dispatch-conf (as mentioned in Baselayout and OpenRC Migration Guide) shows

Code:
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2-COMMAND setting from make.globals is invalid: 'bzip2'
but: bzip2 exists in /bin/bzip2 and the PATH also points to /bin

If I invoke shutdown -h now the following message appears:

Code:
shutdown: /dev/initctl: No such file or directory
init: /dev/initctl: No such file or directory
So I did mkfifo /dev/initctl (taken from http://www.linuxquestions.org/questi...h-file-219080/)

and rebooted somehow - nothing changed: the system stops after the kernel booted...

Any Ideas?
 
Old 05-28-2011, 03:21 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,093

Rep: Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301
Quote:
init-early.sh used greatest stack depth: 3648 bytes left
That's the error. It's certainly novel. A stack is a top down memory for assembler instructions accessed by the PUSH & POP instructions, but there's also many external stacks. The early embedded stuff used to have a stack at the top of 128 bytes of internal ram. So if you had a routine like

check this
push that
return
You overwrote your internal (often the only) ram completely.

Somebody got that exact error in Gentoo booting 64bit on a 32bit kernel. Is everything OK there? If so, there's CONFIG_DEBUG_STACK_USAGE in the kernel hacking menu.
 
Old 05-28-2011, 12:42 PM   #5
ToK
Member
 
Registered: Nov 2005
Posts: 108

Original Poster
Rep: Reputation: 17
Ok
I run a 64bit kernel (Processor Type Core2/New Xeon - or how do I select a 64bit kernel) on a 64bit system. I copied arch/x86_64/boot/bzImage to /boot/kernel-2.6.38-gentoor6.
My kernel is already compiled with CONFIG_DEBUG_STACK_OVERFLOW. How do I access the debugging Information?

ToK
 
Old 05-28-2011, 02:17 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,093

Rep: Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301
Quote:
Originally Posted by ToK View Post
Ok
I run a 64bit kernel (Processor Type Core2/New Xeon - or how do I select a 64bit kernel) on a 64bit system. I copied arch/x86_64/boot/bzImage to /boot/kernel-2.6.38-gentoor6.
My kernel is already compiled with CONFIG_DEBUG_STACK_OVERFLOW. How do I access the debugging Information?ToK
Elementary to check the kernel - point file at it 'file /path/to/your/kernel

On CONFIG_DEBUG_STACK_OVERFLOW, I don't know. It's in kernel hacking, and there's at least one doc in the kernel documentation. You may have to install kernel docs or make xmldocs. It's a reluctant Rusty Writing, so I wouldn't expect loads. I might google '+CONFIG_DEBUG_STACK_OVERFLOW +usage' first on google/linux

With init=/bin/bash, Nothing is run: No $PATH; Nothing started; dmesg is still in ram; Nothing logged. To get going there, laziest thing is
. /etc/profile.d/*.sh
/sbin/init 3

Just wildly guessing, you've just dropped 700k of kernel stuff because it wasn't needed. If cleanup isn't great, and that could be the source of extra processes & stacks. Likewise extra modules in the initrd if you have one. There is an mtrr cleanup setting, and you set how many registers to clean up. There's a thread here making sense of mtrr_cleanup when some guy asked, then figured it and posted. You may be able to get round this with some boot parameter also
 
Old 05-29-2011, 04:15 AM   #7
kswtch
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: Disabled
I have the exact same problem as described in post #3.

As this is not my first gentoo install, I also noticed that the English manual does not yet reflect the baselayout2/OpenRC changes.

/dev isn't populated so booting with grub "init=/sbin/init 3" doesn't do anything. Well, except for printing out the following.
Code:
/dev/initctl: No such file or directory

Here is how to fix the problem described in post #3:
(The problem being missing device nodes in /dev before /dev is mounted)

Boot from a LiveCD and chroot into your system.
Create the needed device nodes with the following commands.
Code:
cd ~
mkdir test
mount --bind / test
cd test/dev
mknod -m 660 console c 5 1
mknod -m 660 null c 1 3
cd ../..
umount test
rmdir test
(taken from http://www.gentoo.org/doc/en/udev-guide.xml)

OpenRC does not start udev by default at system startup. Make sure it is started at boot:
Code:
rc-update add udev sysinit

Last edited by kswtch; 05-29-2011 at 04:39 AM.
 
Old 05-29-2011, 07:05 AM   #8
ToK
Member
 
Registered: Nov 2005
Posts: 108

Original Poster
Rep: Reputation: 17
Thanks! Great! That's it!

It should be mentioned that you should not mount dev before entering the chroot environment. In my case there was already a normal file called null.

Greetings

ToK
 
Old 05-29-2011, 07:08 AM   #9
crak69
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: Disabled
Thumbs up thank you

well done! you saved my weekend
 
  


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
debian new kernel 2.6.22 stops when booting isuck@linux Linux - Kernel 11 08-15-2008 07:29 AM
Stops at: Uncompressing Linux... Ok, booting the kernel destin Slackware 6 02-29-2008 04:45 AM
Fedora FC1, 2.6 kernel, stops booting blaagutt Linux - Newbie 3 05-12-2004 05:57 PM
Stops at Uncompressing Linux... Ok, booting the kernel reward72 Linux - Newbie 4 02-25-2004 11:12 PM
Stops booting after unpressing kernel RH 8.0 Nevyn2 Linux - General 9 04-11-2003 12:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo

All times are GMT -5. The time now is 02:43 AM.

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