LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-10-2010, 01:55 PM   #1
old-snake
LQ Newbie
 
Registered: Nov 2010
Distribution: Foxdie
Posts: 2

Rep: Reputation: 0
Red face initramfs problem: "Attempted to kill init"


Hi,

For a special purpose I needed a initramfs - that didn't work. So I reduced the initramfs setup to the simplest.
Mount the root and switch_root into it. But that didn't work either. I really am stuck here!

If I go with the init-script for the initramfs I posted below the system prints out the switch_root usage-text from busybox. But the syntax is right, ain't it??
When I use chroot instead of switch_root then it prints the usage-text of init before the kernel panic.
If I try with "/sbin/init 5" then, after a while the system reports "init: timeout opening/writing control channel /dev/initctl".
In the other cases I get the following error messages before the system hangs: "Kernel Panic", "Attempted to kill init", "init not tainted"

(With the init script below there is a error saying:"sh: can't access tty; job control turned off". I know why it's there - but don't know if it is connected to this problem.)


This information may be important:
- The machine boots from a usb-harddisk
- /sbin/init on the new root is available
- the system on newroot is sane and runs perfect standalone (without initramfs)
- the system on newroot uses baselayout-2 with openrc
- busybox is built as static binary
- busybox version is v1.15.3

Here is the relevant data:

My uname -a on that machine:
Code:
Linux nibbler 2.6.35-zen2 #13 ZEN Fri Nov 5 21:40:41 CET 2010 i586 Geode(TM) Integrated Processor by AMD PCS AuthenticAMD GNU/Linux
Content of the initramfs:
Code:
-rwxr-xr-x 1 root root  348 Nov  7 11:00 init

bin:
total 1.5M
drwxr-xr-x  2 root root 4.0K Nov  7 10:15 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..
-rwxr-xr-x  1 root root 1.5M Nov  6 19:03 busybox

dev:
total 20K
drwxr-xr-x  5 root root 4.0K Nov  7 10:15 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..
crw-------  1 root root 5, 1 Nov  7 10:14 console
drw-------  2 root root 4.0K Nov  7 10:15 fb
crw-------  1 root root 1, 1 Nov  7 10:14 mem
drw-------  2 root root 4.0K Nov  7 10:15 misc
crw-rw-rw-  1 root root 1, 3 Nov  7 10:14 null
crw--w----  1 root root 4, 0 Nov  7 10:14 tty0
crw-------  1 root root 4, 1 Nov  7 10:14 tty1
drw-------  2 root root 4.0K Nov  7 10:15 vc
crw-------  1 root root 1, 5 Nov  7 10:14 zero

etc:
total 8.0K
drwxr-xr-x  2 root root 4.0K Nov  6 12:03 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..

lib:
total 8.0K
drwxr-xr-x  2 root root 4.0K Nov  7 10:15 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..

mnt:
total 8.0K
drwxr-xr-x  2 root root 4.0K Nov  6 12:03 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..

proc:
total 8.0K
drwxr-xr-x  2 root root 4.0K Nov  6 12:03 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..

root:
total 12K
drwxr-xr-x  2 root root 4.0K Nov  7 00:28 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..
-rw-r--r--  1 root root   33 Nov  7 00:28 .ash_history

sbin:
total 624K
drwxr-xr-x  2 root root 4.0K Nov  7 10:16 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..
lrwxrwxrwx  1 root root   12 Nov  7 00:28 mdev -> /bin/busybox
-rwxr-xr-x  1 root root 607K Nov  6 12:06 mount.aufs
-rwxr-xr-x  1 root root  963 Nov  7 10:16 umount.aufs

sys:
total 8.0K
drwxr-xr-x  2 root root 4.0K Nov  6 12:03 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..

usr:
total 16K
drwxr-xr-x  4 root root 4.0K Nov  7 10:12 .
drwxr-xr-x 12 root root 4.0K Nov  7 11:21 ..
drwxr-xr-x  2 root root 4.0K Nov  6 18:43 lib
drwxr-xr-x  2 root root 4.0K Nov  7 10:12 share
This is one of the more sane versions of the init:
Code:
#!/bin/busybox ash
# -*- mode: sh -*-

export CONSOLE="/dev/tty1"

mkdir /mnt/ro

mount -t proc none /proc
mount -t sysfs none /sys
sleep 15
mdev -s
echo mdev > /proc/sys/kernel/hotplug

mount -o ro /dev/sda2 /mnt/ro

echo > /proc/sys/kernel/hotplug
umount /proc
umount /sys
exec switch_root /mnt/ro /sbin/init
# or chroot /mnt/ro /sbin/init
This command is used for creating the archive:
Code:
find . -print0 | cpio --null -ov --format=newc | gzip -9 > /boot/initramfs.cpio.gz
This is the grub.conf:
Code:
# GRUB CONFIG

default 1
timeout 3

# The normal boot - rootdelay is important!
title Gentoo Linux 2.6.35-zen
root (hd0,1)
kernel /boot/bzImage-2.6.35-zen root=/dev/sda2 rootdelay=20

# The initramfs config
# Here I tried also without rootdelay and with ichkpt=6 - no difference
title Aufs Gentoo Linux 2.6.35-zen
root (hd0,1)
kernel /boot/bzImage-2.6.35-zen root=/dev/sda2 rootdelay=20
initrd /boot/initramfs.cpio.gz
Here is the kernel config:
http://pastebin.com/Y0Fz48J7


Any help is highly appreciated!

Last edited by old-snake; 11-10-2010 at 04:15 PM. Reason: Tried to clean out the text for better understanding
 
Old 11-15-2010, 03:36 PM   #2
old-snake
LQ Newbie
 
Registered: Nov 2010
Distribution: Foxdie
Posts: 2

Original Poster
Rep: Reputation: 0
Solved!
See this thread in gentoo-forums:
http://forums.gentoo.org/viewtopic-p-6486685.html
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Explained: "kernel panic - not syncing - attempted to kill init" sundialsvcs Linux - Software 36 04-24-2010 08:58 AM
Puppy 4.2.1 LiveCD Boot stops at "attempted to kill init!" gray53 Linux - Newbie 4 08-13-2009 11:11 PM
PXE Boot Error: "Kernel panic - not syncing: Attempted to kill init!" veeruk101 Linux - Networking 1 07-18-2007 03:30 PM
Fedora Core 2 Install "attempted to kill init" kernel panic STuPiDiCuS Fedora - Installation 1 06-21-2004 03:41 PM
"Attempted to kill idle/init task" during installation of Mandrake 10 e.fabene Mandriva 0 06-08-2004 10:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:19 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