LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   Booting stops after kernel starts (https://www.linuxquestions.org/questions/gentoo-87/booting-stops-after-kernel-starts-883031/)

ToK 05-27-2011 08:20 AM

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

business_kid 05-27-2011 11:36 AM

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.

ToK 05-28-2011 01:13 AM

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 :confused:

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... :confused:

Any Ideas?

business_kid 05-28-2011 03:21 AM

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.

ToK 05-28-2011 12:42 PM

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

business_kid 05-28-2011 02:17 PM

Quote:

Originally Posted by ToK (Post 4369556)
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

kswtch 05-29-2011 04:15 AM

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

ToK 05-29-2011 07:05 AM

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

crak69 05-29-2011 07:08 AM

thank you
 
well done! you saved my weekend :)


All times are GMT -5. The time now is 01:02 PM.