2003-08-13 06:16:04

by Norbert Preining

[permalink] [raw]
Subject: SOLUTION Re: 2.6.0-test3 cannot mount root fs

On Die, 12 Aug 2003, Christian Mautner wrote:
> Hast du auch einen kompletten Kernel tarball versucht? Wahrscheinlich

The solution is:
Get a COMPLETE linux-2.6.0-test3.tar.bz2
and
DO NOT USE patch

I patched up the kernel from 2.5.20 or something and there seemed to be
an error somewhere on the way up. Getting a *clean* kernel tar file,
compile with the same .config, running.

This is the use of patches!

Best wishes

Norbert

-------------------------------------------------------------------------------
Norbert Preining <preining AT logic DOT at> Technische Universit?t Wien
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
AINDERBY STEEPLE (n.)
One who asks you a question with the apparent motive of wanting to
hear your answer, but who cuts short your opening sentence by leaning
forward and saying 'and I'll tell you why I ask...' and then talking
solidly for the next hour.
--- Douglas Adams, The Meaning of Liff


2003-08-13 06:27:18

by Andrey Borzenkov

[permalink] [raw]
Subject: Re: SOLUTION Re: 2.6.0-test3 cannot mount root fs


congratulations :)

-----Original Message-----

>
> On Die, 12 Aug 2003, Christian Mautner wrote:
> > Hast du auch einen kompletten Kernel tarball versucht? Wahrscheinlich
>
> The solution is:
> Get a COMPLETE linux-2.6.0-test3.tar.bz2
> and
> DO NOT USE patch
>
> I patched up the kernel from 2.5.20 or something and there seemed to be
> an error somewhere on the way up. Getting a *clean* kernel tar file,
> compile with the same .config, running.
>
> This is the use of patches!
>

well, I always do make distclean after patch ... I cannot afford
loading 30MB every week.


2003-08-13 06:30:07

by Norbert Preining

[permalink] [raw]
Subject: Re: SOLUTION Re: 2.6.0-test3 cannot mount root fs

On Mit, 13 Aug 2003, "Andrey Borzenkov" wrote:
> congratulations :)

:-)))

> well, I always do make distclean after patch ... I cannot afford
> loading 30MB every week.

I *ALWAYS* do
make distclean
and
make mrproper
and all other incantations of cleaning, too! This was NOT the problem,
but a wrongly diff file obviously messed up the kernel.

Best wishes

Norbert

-------------------------------------------------------------------------------
Norbert Preining <preining AT logic DOT at> Technische Universit?t Wien
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
Zaphod grinned two manic grins, sauntered over to the bar
and bought most of it.
--- Zaphod in paradise.
--- Douglas Adams, The Hitchhikers Guide to the Galaxy

2003-08-13 12:07:24

by jeff millar

[permalink] [raw]
Subject: Re: SOLUTION Re: 2.6.0-test3 cannot mount root fs

Nope... For the reported problem I had with grub and root=/dev/hda3, it was
with a fresh tar file.

As someone said, this "can't happen". And as someone else said, "It comes
and goes with random changes in .config file"

jeff

----- Original Message -----
From: "Norbert Preining" <[email protected]>
To: "gaxt" <[email protected]>; "Henrik R?der Clausen" <[email protected]>;
"Francois Romieu" <[email protected]>; <[email protected]>;
"Felipe Alfaro Solana" <[email protected]>; "Mr. James W.
Laferriere" <[email protected]>; "Brown, Len" <[email protected]>;
"Andrew Morton" <[email protected]>; "Mark W. Alexander"
<[email protected]>; "jeff millar" <[email protected]>; "Thomas
Molina" <[email protected]>; "Christian Mautner" <[email protected]>;
"Andrey Borzenkov" <[email protected]>; "Herbert P?tzl"
<[email protected]>
Sent: Wednesday, August 13, 2003 2:15 AM
Subject: SOLUTION Re: 2.6.0-test3 cannot mount root fs


> On Die, 12 Aug 2003, Christian Mautner wrote:
> > Hast du auch einen kompletten Kernel tarball versucht? Wahrscheinlich
>
> The solution is:
> Get a COMPLETE linux-2.6.0-test3.tar.bz2
> and
> DO NOT USE patch
>
> I patched up the kernel from 2.5.20 or something and there seemed to be
> an error somewhere on the way up. Getting a *clean* kernel tar file,
> compile with the same .config, running.
>
> This is the use of patches!
>
> Best wishes
>
> Norbert
>
> --------------------------------------------------------------------------
-----
> Norbert Preining <preining AT logic DOT at> Technische Universit?t
Wien
> gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5
B094
> --------------------------------------------------------------------------
-----
> AINDERBY STEEPLE (n.)
> One who asks you a question with the apparent motive of wanting to
> hear your answer, but who cuts short your opening sentence by leaning
> forward and saying 'and I'll tell you why I ask...' and then talking
> solidly for the next hour.
> --- Douglas Adams, The Meaning of Liff
>

2003-08-13 12:30:15

by Herbert Poetzl

[permalink] [raw]
Subject: Re: SOLUTION Re: 2.6.0-test3 cannot mount root fs

On Wed, Aug 13, 2003 at 08:07:20AM -0400, jeff millar wrote:
> Nope... For the reported problem I had with grub and root=/dev/hda3, it was
> with a fresh tar file.
>
> As someone said, this "can't happen". And as someone else said, "It comes
> and goes with random changes in .config file"

so is there still somebody who is not able to boot,
despite of 16 different versions of root=wossname?

if so, I'm willing to make a small patch, which does
_a_lot_of_ status output and checks around this
code ... so it might be possible to track down any
issues/bugs ...

pleas let me know,
Herbert

> jeff
>
> ----- Original Message -----
> From: "Norbert Preining" <[email protected]>
> To: "gaxt" <[email protected]>; "Henrik R?der Clausen" <[email protected]>;
> "Francois Romieu" <[email protected]>; <[email protected]>;
> "Felipe Alfaro Solana" <[email protected]>; "Mr. James W.
> Laferriere" <[email protected]>; "Brown, Len" <[email protected]>;
> "Andrew Morton" <[email protected]>; "Mark W. Alexander"
> <[email protected]>; "jeff millar" <[email protected]>; "Thomas
> Molina" <[email protected]>; "Christian Mautner" <[email protected]>;
> "Andrey Borzenkov" <[email protected]>; "Herbert P?tzl"
> <[email protected]>
> Sent: Wednesday, August 13, 2003 2:15 AM
> Subject: SOLUTION Re: 2.6.0-test3 cannot mount root fs
>
>
> > On Die, 12 Aug 2003, Christian Mautner wrote:
> > > Hast du auch einen kompletten Kernel tarball versucht? Wahrscheinlich
> >
> > The solution is:
> > Get a COMPLETE linux-2.6.0-test3.tar.bz2
> > and
> > DO NOT USE patch
> >
> > I patched up the kernel from 2.5.20 or something and there seemed to be
> > an error somewhere on the way up. Getting a *clean* kernel tar file,
> > compile with the same .config, running.
> >
> > This is the use of patches!
> >
> > Best wishes
> >
> > Norbert
> >
> > --------------------------------------------------------------------------
> -----
> > Norbert Preining <preining AT logic DOT at> Technische Universit?t
> Wien
> > gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5
> B094
> > --------------------------------------------------------------------------
> -----
> > AINDERBY STEEPLE (n.)
> > One who asks you a question with the apparent motive of wanting to
> > hear your answer, but who cuts short your opening sentence by leaning
> > forward and saying 'and I'll tell you why I ask...' and then talking
> > solidly for the next hour.
> > --- Douglas Adams, The Meaning of Liff
> >

2003-08-13 13:24:23

by Herbert Poetzl

[permalink] [raw]
Subject: Re: SOLUTION Re: 2.6.0-test3 cannot mount root fs

On Wed, Aug 13, 2003 at 08:42:12AM -0400, jeff millar wrote:
> I didn't try 16 versions but did try at least
>
> /dev/hda3, 0303, 03:03, hda3
>
> All with grub.conf similar to below
>
> Please let me know if I need to try something else with grub.. If you have a
> patch, I'll try it tonite and email the results to you and the list.

here is the patch, please try to capture/copy
all lines starting with $$ (and the ones immediately
following) ...

boot okay ...

$$ name_to_dev_t() >/dev/hda1<
$$ check >hda1<
$$ check >hda1< (<31)
$$ try_name() I
$$ try_name() >hda1<,0
$$ open >/sys/block/hda1/dev< = -1
$$ fail
$$ strtoul >1< -> 1
$$ try_name() II
$$ try_name() >hda<,1
$$ open >/sys/block/hda/dev< = 0
$$ read 0[32] = >3:0
< (4)
$$ buf: >3:0<
$$ mkdev (3,0) -> 768
$$ open2 >/sys/block/hda/range< = 0
$$ read2 0[32] = >64
< (3)
$$ buf: >64<
$$ strtoul >64< -> 64
$$ 1 < 64 ?
$$ name_to_dev_t() done
VFS: Mounted root (ext2 filesystem) readonly.


device not present ...

$$ name_to_dev_t() >/dev/hdc1<
$$ check >hdc1<
$$ check >hdc1< (<31)
$$ try_name() I
$$ try_name() >hdc1<,0
$$ open >/sys/block/hdc1/dev< = -1
$$ fail
$$ strtoul >1< -> 1
$$ try_name() II
$$ try_name() >hdc<,1
$$ open >/sys/block/hdc/dev< = -1
$$ fail
$$ name_to_dev_t() failed
$$ name_to_dev_t() done
VFS: Cannot open root device "hdc1" or unknown-block(0,0)


patch below ...
-----------------

diff -NurP --minimal linux-2.6.0-test3/init/do_mounts.c linux-2.6.0-test3-debug/init/do_mounts.c
--- linux-2.6.0-test3/init/do_mounts.c 2003-08-09 16:31:35.000000000 +0200
+++ linux-2.6.0-test3-debug/init/do_mounts.c 2003-08-13 15:15:23.000000000 +0200
@@ -62,11 +62,14 @@

/* read device number from .../dev */

+ printk("$$ try_name() >%s<,%d\n", name, part);
sprintf(path, "/sys/block/%s/dev", name);
fd = open(path, 0, 0);
+ printk("$$ open >%s< = %d\n", path, fd);
if (fd < 0)
goto fail;
len = read(fd, buf, 32);
+ printk("$$ read %d[32] = >%*s< (%d)\n", fd, len, buf, len);
close(fd);
if (len <= 0 || len == 32 || buf[len - 1] != '\n')
goto fail;
@@ -74,9 +77,11 @@
/*
* The format of dev is now %u:%u -- see print_dev_t()
*/
- if (sscanf(buf, "%u:%u", &maj, &min) == 2)
+ printk("$$ buf: >%s<\n", buf);
+ if (sscanf(buf, "%u:%u", &maj, &min) == 2) {
res = MKDEV(maj, min);
- else
+ printk("$$ mkdev (%d,%d) -> %d\n", maj, min, res);
+ } else
goto fail;

/* if it's there and we are not looking for a partition - that's it */
@@ -86,21 +91,27 @@
/* otherwise read range from .../range */
sprintf(path, "/sys/block/%s/range", name);
fd = open(path, 0, 0);
+ printk("$$ open2 >%s< = %d\n", path, fd);
if (fd < 0)
goto fail;
len = read(fd, buf, 32);
+ printk("$$ read2 %d[32] = >%*s< (%d)\n", fd, len, buf, len);
close(fd);
if (len <= 0 || len == 32 || buf[len - 1] != '\n')
goto fail;
buf[len - 1] = '\0';
+ printk("$$ buf: >%s<\n", buf);
range = simple_strtoul(buf, &s, 10);
+ printk("$$ strtoul >%s< -> %d\n", buf, range);
if (*s)
goto fail;

/* if partition is within range - we got it */
+ printk("$$ %d < %d ?\n", part, range);
if (part < range)
return res + part;
fail:
+ printk("$$ fail\n");
return (dev_t) 0;
}

@@ -130,27 +141,32 @@
dev_t res = 0;
int part;

+ printk("$$ name_to_dev_t() >%s<\n", name);
sys_mkdir("/sys", 0700);
if (sys_mount("sysfs", "/sys", "sysfs", 0, NULL) < 0)
goto out;

if (strncmp(name, "/dev/", 5) != 0) {
res = (dev_t) simple_strtoul(name, &p, 16);
+ printk("$$ strtoul >%s< -> %d\n", name, res);
if (*p)
goto fail;
goto done;
}
name += 5;
res = Root_NFS;
+ printk("$$ check >%s<\n", name);
if (strcmp(name, "nfs") == 0)
goto done;

+ printk("$$ check >%s< (<31)\n", name);
if (strlen(name) > 31)
goto fail;
strcpy(s, name);
for (p = s; *p; p++)
if (*p == '/')
*p = '.';
+ printk("$$ try_name() I\n");
res = try_name(s, 0);
if (res)
goto done;
@@ -160,7 +176,9 @@
if (p == s || !*p || *p == '0')
goto fail;
part = simple_strtoul(p, NULL, 10);
+ printk("$$ strtoul >%s< -> %d\n", p, part);
*p = '\0';
+ printk("$$ try_name() II\n");
res = try_name(s, part);
if (res)
goto done;
@@ -168,19 +186,23 @@
if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p')
goto fail;
p[-1] = '\0';
+ printk("$$ try_name() III\n");
res = try_name(s, part);
done:
+ printk("$$ name_to_dev_t() done\n");
sys_umount("/sys", 0);
out:
sys_rmdir("/sys");
return res;
fail:
+ printk("$$ name_to_dev_t() failed\n");
res = (dev_t) 0;
goto done;
}

static int __init root_dev_setup(char *line)
{
+ printk("$$ root_dev_setup() >%s<\n", line);
strlcpy(saved_root_name, line, sizeof(saved_root_name));
return 1;
}

2003-08-13 13:24:48

by Christian Mautner

[permalink] [raw]
Subject: Re: SOLUTION Re: 2.6.0-test3 cannot mount root fs

On Wed, Aug 13, 2003 at 08:15:46AM +0200, Norbert Preining wrote:
> On Die, 12 Aug 2003, Christian Mautner wrote:
> > Hast du auch einen kompletten Kernel tarball versucht? Wahrscheinlich
>
> The solution is:
> Get a COMPLETE linux-2.6.0-test3.tar.bz2
> and
> DO NOT USE patch

I'm pretty sure the problem is related to the file
usr/initramfs_data.S. This file is automatically created by the
usr/Makefile, but not deleted by mrproper or distclean (in -test1).

See l-k thread "remove initramfs temp files" of Aug 8.

The patch to -test2 contained the file usr/initramfs_data.S, and the
patch process fails since it's trying to create it. I ended up
accidently with garbage in usr/initramfs_data.S, to the effect that
the symbol .init.ramfs was empty (could be told from System.map),
which in turn had the effect that in init/initramfs.c the function
unpack_to_rootfs() was called with a length of 0 (&__initramfs_end ==
&__initramfs_start), which in turn prevented this very initial root
file system which is needed to mount root.

A warning message in unpack_to_rootfs() if it is called with a length
of 0 would have been very helpful.

Having make distclean remove initramfs_data.S would be very good
practice as well.

chm.

--
christian mautner -- chm bei istop punkt com -- ottawa, canada