Skip to contentSkip to conversation

Unable to open console /start init

DISCUSSION Brian T. 3 participants 6 messages Mar 11, 2003 – Mar 13, 2003 Memory technology devices (MTD)

lore
Share & tools
lore

Brian T.

author
#0 lore raw

I realize that this probably isn't a JFFS2 problem, but was hoping someone here might be able to point me in the right direction to fix this. I am trying to get JFFS2 with 2.4.20 running on an embedded unit with an Intel chipset. I have modified nettel.c, so the chipset is detected with the right MTD partition sizes. The system seems to be hanging on starting init, but not before it cannot open the console. Console on my 2.2.18 build always came up on /dev/ttyS0. The last messages I get on bootup is:

VFS: Mounted root (jffs2 filesystem) readonly.
Freeing unused kernel memory: 64k freed
Warning: unable to open an initial console.
trying /sbin/init

My console is console,c,5,1 and ttyS0 is ttyS0,c,4,64. I have tried making a sym link from ttyS0 -> console with no luck either.

On boot the kernel sees the serial devices:

ttyS00 at 0x03f8 (irq = 4) is a 16550A (dunno the extra 0 is in there, but
its right)
ttyS03 at 0x02e8 (irq = 3) is a 16550A

Also:

I modified main.c so I can tell how far it is getting with init:

--snip--

        if (execute_command)
        {
                 printk("Execute command passed: %s\n",execute_command);
                execve(execute_command,argv_init,envp_init);
        }
         printk("init: trying /sbin/init\n");
        execve("/sbin/init",argv_init,envp_init);
         printk("init: trying /etc/init\n");
        execve("/etc/init",argv_init,envp_init);
         printk("init: trying /bin/init\n");
        execve("/bin/init",argv_init,envp_init);
         printk("init: trying /bin/sh\n");
        execve("/bin/sh",argv_init,envp_init);
        panic("No init found.  Try passing init= option to kernel.");

--snip--

If I remove /sbin/init then it prints out the other 3 messages as well that I added in, but then it still hangs. the init is part of Busybox, but have tried using a standard /sbin/init also, with the same results.

Has anyone else ever had these problems?

-Brian

author
#1 lore raw

Unable to open console /start init - more info (jffs2)

On bootup, with MTD debugging and JFFS2 debugging on, the 2.2.18 kernel give me this:

SNAPGEAR: Intel flash device size = 16384K
Creating 6 MTD partitions on "SnapGear Intel":
0x00000000-0x00080000 : "JBM kernel"
mtd: Giving out device 0 to JBM kernel
0x000a0000-0x00fe0000 : "JBM filesystem"
mtd: Giving out device 1 to JBM filesystem 0x00080000-0x000a0000 : "JBM config"
mtd: Giving out device 2 to JBM config
0x00000000-0x01000000 : "JBM Intel"
mtd: Giving out device 3 to JBM Intel
0x00fe0000-0x01000000 : "JBM BIOS Config"
mtd: Giving out device 4 to JBM BIOS Config 0x00fe0000-0x01000000 : "JBM BIOS"
mtd: Giving out device 5 to JBM BIOS
JBMgw137 Battery Backed RAM device: 1f000 at 18021000
Creating 1 MTD partitions on "JBMgw137 Battery Backed RAM":
0x00000000-0x0001f000 : "JBM-Battery-Backed RAM"
mtd: Giving out device 6 to JBM-Battery-Backed RAM
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
mtdblock_open
ok
mtdblock: read on "JBM filesystem" at 0x400, size 0x400 jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0051661c:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00516620:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00516624:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00516628:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0051662c:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00516630:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00516634:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00516638:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0051663c:
0x1a1a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00516640:
0x1a1a instead
Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00520000 is not formatted. It will be erased
JFFS2: Erase block at 0x00540000 is not formatted. It will be erased
...snipped out lines in between....
JFFS2: Erase block at 0x00f20000 is not formatted. It will be erased
VFS: Mounted root (jffs2 filesystem) readonly.
Freeing unused kernel memory: 36k freed

But I don't see any JFFS2 output (formatting the blocks...etc...) on the 2.4.20 kernel I'm trying to get running:

SNAPGEAR: Intel flash device size = 16384K Creating 6 MTD partitions on "SnapGear Intel":
0x00000000-0x000e0000 : "JBM kernel"
mtd: Giving out device 0 to JBM kernel 0x00100000-0x00fe0000 : "JBM filesystem"
mtd: Giving out device 1 to JBM filesystem 0x000e0000-0x00100000 : "JBM config"
mtd: Giving out device 2 to JBM config 0x00000000-0x01000000 : "JBM Intel"
mtd: Giving out device 3 to JBM Intel 0x00fe0000-0x01000000 : "JBM BIOS Config"
mtd: Giving out device 4 to JBM BIOS Config 0x00fe0000-0x01000000 : "JBM BIOS"
mtd: Giving out device 5 to JBM BIOS
JBMgw137 Battery Backed RAM device: 1f000 at 18021000
kmod: failed to exec /sbin/modprobe -s -k ram, errno = 2
kmod: failed to exec /sbin/modprobe -s -k rom, errno = 2
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 2048)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. mtdblock_open
ok
mtdblock: read on "JBM filesystem" at 0x400, size 0x400 mtdblock_release
ok
mtdblock_open
ok
VFS: Mounted root (jffs2 filesystem) readonly. Freeing unused kernel memory: 60k freed
Warning: unable to open an initial console.

Is it possible that the JFFS2 MTD partition isn't being mounted, and therefore that is why the console, and INIT aren't starting?

-Brian

#2 lore raw

Unable to open console /start init - more info (jffs2)

Quoted 4 lines · Brian T.

But I don't see any JFFS2 output (formatting the blocks...etc...) on the 2.4.20 kernel I'm trying to get running:
VFS: Mounted root (jffs2 filesystem) readonly.

Your root-fs is mounted with JFFS2-Filesystem

Quoted 2 lines

Freeing unused kernel memory: 60k freed
Warning: unable to open an initial console.

This message appears when your system tries to open /dev/ttyX and it is not there. The possible reasons for this are:
- Wrong root partition
- /dev/ttyX is not there
- The kernel was compiled without support for virtual termainals.

Signature · 5 lines
Thomas
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx at linutronix.de
author
#3 lore raw

Unable to open console /start init - more info (jffs2)

Thanks for the reply.

Quoted 1 line

- The kernel was compiled without support for virtual terminals.

I tried adding in virtual console support, and I just get a bunch of
pc_keyb: controller jammed (0x17) errors, and then it times out and keeps booting, eventually with the same end result.

Quoted 1 line

- /dev/ttyX is not there

/dev/console and /dev/ttyS0 *should* be there. I haven't changed anything
with the that part of the Makefile which creates those files, all though maybe thats
part of the problem; maybe this newer version of JFFS2 doesn't like the way they
are created. All the /dev/ files are created with example: "touch ./somedir/dev/@console,c,5,1"
which worked fine with the older distro I'm using. The jffs2 images is then made
on ./somedir/.

Quoted 1 line

- Wrong root partition

My root partition is MTD partition #1. When the kernel comes up, so I need to specify which partition to use as root? Or does it scan them and use the first one it finds? If I need to specify which one is to be mounted as the root partition, any idea how I do that?

If I removed /sbin/init from the build and put my flash image on the ROMFS, then main.c gets past the first init trial, and attempts the others, and then fails. If I
leave it there, then it stops at /sbin/init, which I believe proves that it is mounting the right MTD partition; but am still unsure.

Kind regards,

-Brian

#5 lore raw

Unable to open console /start init - more info (jffs2)

In reply to Brian T.
Quoted 2 lines · Brian T.

kmod: failed to exec /sbin/modprobe -s -k ram, errno = 2
kmod: failed to exec /sbin/modprobe -s -k rom, errno = 2

What are these? Could it be that there are a kernel modules missing?

As an aside, on a recent 2.4.20 install on an MZ 104 board, /dev/systty is a link to tty0 and support for virtual terminals is compiled into the kernel.

I also pass console=ttyS0,19200n8 to the kernel at boot up.

Bob...

Signature · 1 line
Bob Chiodini <[email protected]>
author
#4 lore raw

Unable to open console /start init - more info (jffs2)

In reply to Brian T.

I got it working. It was the way the devices were not being created with mknod, but with "touch /dev/@console,c,5,1"...etc.....

Don't know why it stopped working with a newer version kernel/jffs2 image maker, but I'm happy now. Thanks for the help!

-Brian

----- Original Message -----
From: "Brian T." <[email protected]>
To: <[email protected]>; <[email protected]>
Sent: Wednesday, March 12, 2003 12:27 PM
Subject: Re: Unable to open console /start init - more info (jffs2)

Quoted 9 lines

Thanks for the reply.

Quoted 1 line

- The kernel was compiled without support for virtual terminals.

I tried adding in virtual console support, and I just get a bunch of
pc_keyb: controller jammed (0x17) errors, and then it times out and keeps booting, eventually with the same end result.

Quoted 1 line

- /dev/ttyX is not there

/dev/console and /dev/ttyS0 *should* be there. I haven't changed

anything

Quoted 3 lines

with the that part of the Makefile which creates those files, all though maybe thats
part of the problem; maybe this newer version of JFFS2 doesn't like the

way

Quoted 4 lines

they
are created. All the /dev/ files are created with example: "touch ./somedir/dev/@console,c,5,1"
which worked fine with the older distro I'm using. The jffs2 images is

then

Quoted 5 lines

made
on ./somedir/.

Quoted 1 line

- Wrong root partition

My root partition is MTD partition #1. When the kernel comes up, so I

need

Quoted 1 line

to specify which partition to use as root? Or does it scan them and use

the

Quoted 1 line

first one it finds? If I need to specify which one is to be mounted as

the

Quoted 3 lines

root partition, any idea how I do that?

If I removed /sbin/init from the build and put my flash image on the

ROMFS,

Quoted 3 lines

then main.c gets past the first init trial, and attempts the others, and then fails. If I
leave it there, then it stops at /sbin/init, which I believe proves that

it

Quoted 17 lines

is mounting the right MTD partition; but am still unsure.

Kind regards,

-Brian

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Quoted 1 line

From Gregg Thu Mar 13 19:50:56 2003

From: Gregg (Gregg)
Date: Thu, 13 Mar 2003 19:50:56 -0500
Subject: DoC image building and Linux, and something else
Message-ID: <000001c2e9c3$c8c8e9e0$f8a6580c@who5>

Hello from Gregg C Levine
I am having a few problems reconciling the ideas behind building the DoC image from Linux tools. I use the Slackware distributions, whereas M-Sys staff chose Red Hat, notably the 6.2 distribution. So, has anyone on this list, used the tools found in the Slackware distributions too build a DoC image?=20

I am surmising that the methods are the same, but I am inviting comments from the group as to the right or wrong of this surmise. Also, the same problems that surfaced regarding M-Sys, and the image, are surfacing for GRUB, and the DoC image. I just follow the instructions contained within the read me file that was created, right?

Now the "something else" issue. The modules directory for 2.4.20, contain one named library, and they contain the zlib library, as constructed during those steps. Are those the ones that the mtd directory is concerning itself with? And how can I get around the crc32 complaints during the building of the utilities? If anyone needs to see evidence of that problem please ask, and I shall produce a script file which indicates it.
-------------------
Gregg C Levine hansolofalcon at worldnet.att.net
------------------------------------------------------------
"The Force will be with you...Always." Obi-Wan Kenobi
"Use the Force, Luke."=A0 Obi-Wan Kenobi
(This company dedicates this E-Mail to General Obi-Wan Kenobi ) (This company dedicates this E-Mail to Master Yoda )