Init problem: unable to open an initial console (busybox, udev and jffs2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi all,

I'm trying to build small linux system on the ARM920T processor (i.MXL 
from Freescale).

All necesary binaries and utilities are compiled and placed in rootfs 
image. I'm using buildroot and busybox.

All works fine when I create rootfs with all device nodes already in 
/dev directory.

Now I'm trying to use UDEV. I make rootfs with empty /dev directory.
Below are listed my inittab, rcS, udev.conf and S10udev init scripts:

-----------------------------------------------------------------
inittab:

# /etc/inittab

::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -t ramfs ramfs /dev
::sysinit:/bin/mount -t tmpfs tmpfs /tmp

::sysinit:/bin/mknod /dev/null c 1 3
::sysinit:/bin/mknod /dev/zero c 1 5
::sysinit:/bin/mknod /dev/systty c 4 0
::sysinit:/bin/mknod /dev/tty c 5 0
::sysinit:/bin/mknod /dev/console c 5 1
::sysinit:/bin/mknod /dev/tty0 c 4 0
::sysinit:/bin/mknod /dev/tty1 c 4 1
::sysinit:/bin/mknod /dev/ttyS0 c 4 64
::sysinit:/bin/mknod /dev/ttyS1 c 4 65

null::sysinit:/etc/init.d/rcS
::respawn:-/bin/sh

-------------------------------------------------------------------

rcS:

#!/bin/sh

for i in /etc/init.d/S??* ;do

      # Ignore dangling symlinks (if any).
      [ ! -f "$i" ] && continue

      case "$i" in
	*.sh)
	    # Source shell script for speed.
	    (
		trap - INT QUIT TSTP
		set start
		. $i
	    )
	    ;;
	*)
	    # No sh extension, so fork subprocess.
	    $i start
	    ;;
     esac
done

---------------------------------------------------------------------

udev.conf:

# udev.conf

udev_root=/dev

---------------------------------------------------------------------

S10udev:

#!/bin/sh

# old kernels don't use udev
case $(uname -r) in
     2.6*|2.7*)	;;
     *)		exit 0;;
esac

# Check for missing binaries
UDEV_BIN=/sbin/udevd
test -x $UDEV_BIN || exit 5
UDEVSTART_BIN=/sbin/udevstart
test -x $UDEVSTART_BIN || exit 5

# Check for config file and read it
UDEV_CONFIG=/etc/udev/udev.conf
test -r $UDEV_CONFIG || exit 6
. $UDEV_CONFIG

# Directory where sysfs is mounted
SYSFS_DIR=/sys

case "$1" in
     start)
         # mount sysfs if it's not yet mounted
         if [ ! -d $SYSFS_DIR ]; then
	    echo "${0}: SYSFS_DIR \"$SYSFS_DIR\" not found"
	    exit 1
         fi
         grep -q "^sysfs $SYSFS_DIR" /proc/mounts ||
	mount -t sysfs /sys /sys ||
	exit 1

         # mount $udev_root as ramfs if it's not yet mounted
         # we know 2.6 kernels always support ramfs
         if [ ! -d $udev_root ]; then
	    echo "${0}: udev_root \"$udev_root\" not found"
	    exit 1
         fi
         grep -q "^udev $udev_root" /proc/mounts ||
	mount -t ramfs udev $udev_root ||
	exit 1

         mkdir $udev_root/pts $udev_root/shm

         # populate /dev (normally)
         echo -n "Populating $udev_root using udev: "
         echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
         $UDEV_BIN -d || (echo "FAIL" && exit 1)
	$UDEVSTART_BIN || (echo "FAIL" && exit 1)
	mount -t devpts /dev/pts /dev/pts || (echo "FAIL" && exit 1)
         echo "done"
         ;;
     stop)
         # Stop execution of events
         udevcontrol stop_exec_queue
         killall udevd
         ;;
     *)
         echo "Usage: $0 {start|stop}"
         exit 1
         ;;
esac

exit 0

---------------------------------------------------------------------------------

I think inittab should mount all required filesystems and creade divice 
nodes in /dev (there is already mounted ramfs). But It does not do so, 
because I see the following kernel boot log:

---------------------------------------------------------------------------------

[    0.000000] Linux version 2.6.24 (Darius@xxxxxxxxxxxxxxxxxxxxx) (gcc 
version 4.0.2) #26 Fri Feb 15 10:06:09 EET 2008
[    0.000000] CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=00003177
[    0.000000] Machine: Motorola MX1ADS
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 16384
[    0.000000]   DMA zone: 128 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 16256 pages, LIFO batch:3
[    0.000000]   Normal zone: 0 pages used for memmap
[    0.000000]   Movable zone: 0 pages used for memmap
[    0.000000] CPU0: D VIVT write-back cache
[    0.000000] CPU0: I cache: 16384 bytes, associativity 64, 32 byte 
lines, 8 sets
[    0.000000] CPU0: D cache: 16384 bytes, associativity 64, 32 byte 
lines, 8 sets
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on. 
Total pages: 16256
[    0.000000] Kernel command line: 
mtdparts=physmap-flash.0:128k(boot),2M(kernel),-(rootfs) 
root=/dev/mtdblock2 rootfstype=jffs2 rw debug
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
[    0.000000] console [ttySMX0] enabled
[    0.010000] Dentry cache hash table entries: 8192 (order: 3, 32768 
bytes)
[    0.010000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.030000] Memory: 64MB = 64MB total
[    0.030000] Memory: 63780KB available (976K code, 64K data, 48K init)
[    0.040000] Calibrating delay loop... 47.92 BogoMIPS (lpj=239616)
[    0.230000] Mount-cache hash table entries: 512
[    0.230000] CPU: Testing write buffer coherency: ok
[    0.270000] Time: imx_timer1 clocksource has been installed.
[    0.270000] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.290000] JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.290000] io scheduler noop registered (default)
[    0.300000] Serial: IMX driver
[    0.300000] imx-uart.0: ttySMX0 at MMIO 0xe0006000 (irq = 30) is a IMX
[    0.310000] imx-uart.1: ttySMX1 at MMIO 0xe0007000 (irq = 24) is a IMX
[    0.320000] physmap platform flash device: 02000000 at 10000000
[    0.330000] physmap-flash.0: Found 2 x16 devices at 0x0 in 32-bit bank
[    0.340000]  Amd/Fujitsu Extended Query Table at 0x0040
[    0.340000] physmap-flash.0: CFI does not contain boot bank location. 
Assuming top.
[    0.350000] number of CFI chips: 1
[    0.360000] cfi_cmdset_0002: Disabling erase-suspend-program due to 
code brokenness.
[    0.360000] 3 cmdlinepart partitions found on MTD device physmap-flash.0
[    0.370000] Creating 3 MTD partitions on "physmap-flash.0":
[    0.380000] 0x00000000-0x00020000 : "boot"
[    0.380000] 0x00020000-0x00220000 : "kernel"
[    0.390000] 0x00220000-0x02000000 : "rootfs"
[    0.390000] i2c /dev entries driver
[    0.400000] i2c-core: driver [dev_driver] registered
[    0.560000] VFS: Mounted root (jffs2 filesystem).
[    0.560000] Freeing init memory: 48K
[    0.570000] Warning: unable to open an initial console.

-----------------------------------------------------------------------------------------------------------

Why kernel can't find initial console? Have I missed something?
Waiting for help!

Darius.


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php


[Linux ARM]     [Linux ARM MSM]     [Linux ARM Kernel]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

Add to Google Follow linuxarm on Twitter