Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 187628 - sys-apps/baselayout-2.0.0_rc1 does not boot with read-only root filesystem
Summary: sys-apps/baselayout-2.0.0_rc1 does not boot with read-only root filesystem
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-03 17:10 UTC by Markus Rothe (RETIRED)
Modified: 2007-08-05 07:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
startup with "rw attached to kernel" (linux_rw.txt,2.91 KB, text/plain)
2007-08-04 16:09 UTC, Markus Rothe (RETIRED)
Details
Only setfont if we have a console (console.patch,464 bytes, patch)
2007-08-04 18:30 UTC, Roy Marples (RETIRED)
Details | Diff
Only setfont if we have a conslole and ensure exit 0 (console.patch,904 bytes, patch)
2007-08-04 19:05 UTC, Roy Marples (RETIRED)
Details | Diff
Only setfont if we have a conslole and ensure exit 0 (console.patch,896 bytes, patch)
2007-08-04 19:34 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Rothe (RETIRED) gentoo-dev 2007-08-03 17:10:43 UTC
I've two problems with baseyout-2*:

First problem is that sys-apps/baselayout-2.0.0_rc1 does not boot with read-only root filesystem. I have to append "root=/dev/sda3 rw" to the kernel options, else I'm getting this:

(this is powerpc64 and it *did* boot without rw appended the first time I booted with baselayout-2*. I've seen this after first reboot. I've upgraded from baselayout 1* straight to 2*)


Welcome to yaboot version 1.3.13
Enter "help" to get some basic usage information
boot: linux
Please wait, loading kernel...
   Elf64 kernel loaded...
Loading System.map ...
System.map loaded at 01a00000, size: 1024 Kbytes
OF stdout device is: /pci@fef00000/isa@b/serial@i3f8
command line: root=/dev/sda3 
memory layout at init:
  alloc_bottom : 000000000186f000
  alloc_top    : 0000000020000000
  alloc_top_hi : 0000000020000000
  rmo_top      : 0000000020000000
  ram_top      : 0000000020000000
Looking for displays
found display   : /pci@fee00000/display@b, opening ... done
[...]
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
tunl0: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
sit0: Disabled Privacy Extensions
NET: Registered protocol family 17
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 176k freed
INIT: version 2.86 booting
INIT: Entering runlevel: 3
 * failed to open `/lib64/rcscripts/init.d/softlevel': Read-only file system


This is (none) (Linux ppc64 2.6.21.6) 17:56:21

(none) login:



The second problem is, that /proc does not get mounted if I append "root=/dev/sda3 rw". /proc is empty.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-08-04 15:20:44 UTC
Could you check the dates of /etc/profile.env and /lib/rcscripts/init.d/deptree?

Also, see if moving those files to /tmp and regenerating them helps
/sbin/env-update
/etc/init.d/urandom restart

If it does help, then please attach those files here so  I can see what is causing rc to crash out.
Comment 2 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 15:45:35 UTC
This are the dates (before regenerating the two files):

power3 ~ # ls -lh /etc/profile.env 
-rw-r--r-- 1 root root 845 Aug  4 16:39 /etc/profile.env
power3 ~ # ls /lib64/rcscripts/init.d/deptree -lh
-rw-r--r-- 1 root root 5.9K Aug  3 17:29 /lib64/rcscripts/init.d/deptree
power3 ~ # date
Sat Aug  4 16:40:47 CEST 2007


I've regenerated the files now, but that didn't help. I'm getting the same error.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-08-04 15:59:00 UTC
Interesting that rc doesn't appear to be running at all.

Try this
RUNLEVEL="1" /sbin/rc sysinit

If that fails, could I get a strace of it please?
Or backtrace if it dumps core.
Comment 4 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 16:07:47 UTC
power3 ~ # RUNLEVEL="1" /sbin/rc sysinit
GCouldnt open /dev/console
power3 ~ # ls /dev/console -l
crw------- 1 root tty 5, 1 Aug  4 16:58 /dev/console
power3 ~ # chmod g+rw /dev/console 
power3 ~ # RUNLEVEL="1" /sbin/rc sysinit
GCouldnt open /dev/console
power3 ~ # chmod o+rw /dev/console 
power3 ~ # RUNLEVEL="1" /sbin/rc sysinit
GCouldnt open /dev/console

doh?
Comment 5 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 16:09:33 UTC
Created attachment 126861 [details]
startup with "rw attached to kernel"

if I start the kernel with "rw", then /proc does not get mounted. This is how I start the system currently.
Comment 6 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 16:38:48 UTC
I just did the following:

1. removing baselayout 2.0.0_rc1 (including all cruft; i.e. files modified by me, so portage didn't unmerge them)
2. install baselayout 1.12.9-r2
3. reboot was successful (proc get's mounted and I can start without "rw")
4. update to baselayout 2.0.0_rc1 again
5. etc-update (let everything overwrite)
6. reboot and I'm getting the error

I'm not sure, why it booted the first time after the first upgrade, but I'm pretty sure it did.
Comment 7 Roy Marples (RETIRED) gentoo-dev 2007-08-04 16:48:23 UTC
Could you add set-x near the top of /lib/rcscripts/sh/init.sh and /lib/rcscripts/sh/init-early.sh so we can see where they're going wrong as I think the error is there somewhere.
Comment 8 SpanKY gentoo-dev 2007-08-04 17:14:29 UTC
we should add a gentoo=debug or something that gets parsed at the start of boot so people dont need to add 'set -x' and such ...
Comment 9 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 18:00:28 UTC
Placing "set -x" here and there I found this: if I place it exactly here

--- /lib64/rcscripts/sh/init-early.sh.orig      2007-08-04 18:27:43.000000000 +0200
+++ /lib64/rcscripts/sh/init-early.sh   2007-08-04 18:51:29.000000000 +0200
@@ -11,5 +11,6 @@
                CONSOLE="${CONSOLE:-/dev/console}"
                [ -c "${CONSOLE}" ] && cons="-C ${CONSOLE}"
                setfont ${cons} "${RC_LIBDIR}"/console/"${font}"
+               set -x
        fi
 fi


then the machine starts fine:


[...]
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 176k freed
INIT: version 2.86 booting
GCouldnt open /dev/console

   Gentoo/Linux; http://www.gentoo.org/
   Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2

Press I to enter interactive boot mode

 * Mounting proc at /proc ...
 [ ok ]
[following output as usual]



If I place it one line above the "setfont" line, then it fails. Dunno what this means.

I should note, that all output comes from serial console. There is no monitor/keyboard attached to the machine, but the kernel seems to open the open firmware device. ("found display   : /pci@fee00000/display@b, opening ... done" at the very first lines of the kernel)
Comment 10 Roy Marples (RETIRED) gentoo-dev 2007-08-04 18:30:24 UTC
Created attachment 126868 [details, diff]
Only setfont if we have a console

This should fix things
Comment 11 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 18:58:57 UTC
no, it does not... same error.
Comment 12 Roy Marples (RETIRED) gentoo-dev 2007-08-04 19:05:51 UTC
Created attachment 126870 [details, diff]
Only setfont if we have a conslole and ensure exit 0

OK, I see what's happening here.
This patch should deffo fix it.
Comment 13 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 19:21:30 UTC
yes! that fixed it! thanks a lot! even the "Couldnt open /dev/console" message is gone now.

Only one tiny little thing is missing ;-)

[...]
Freeing unused kernel memory: 176k freed
INIT: version 2.86 booting
G
   Gentoo/Linux; http://www.gentoo.org/
   Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
[...]

You see it? There is a "G". Where does that one come from?
Comment 14 Roy Marples (RETIRED) gentoo-dev 2007-08-04 19:34:13 UTC
Created attachment 126875 [details, diff]
Only setfont if we have a conslole and ensure exit 0

Last one broke the early font, try this instead
Comment 15 Roy Marples (RETIRED) gentoo-dev 2007-08-04 19:36:01 UTC
(In reply to comment #13)
> [...]
> Freeing unused kernel memory: 176k freed
> INIT: version 2.86 booting
> G
>    Gentoo/Linux; http://www.gentoo.org/
>    Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
> [...]
> 
> You see it? There is a "G". Where does that one come from?

It's an ASCII escape code to put the console into unicode mode.
If you don't want to see it, then remove consolefont from the boot runlevel.
Comment 16 Markus Rothe (RETIRED) gentoo-dev 2007-08-04 20:00:25 UTC
that last patch works fine, too.

(In reply to comment #15)
> It's an ASCII escape code to put the console into unicode mode.
> If you don't want to see it, then remove consolefont from the boot runlevel.

thanks for clarification. Unfortunately "rc-update" does not work as expected:

power3 ~ # rc-update del consolefont default
 * rc-update: unknown applet
power3 ~ # rc-update -s
 * rc-update: unknown applet
power3 ~ # rc-update -h
 * rc-update: unknown applet


another bug?
Comment 17 Roy Marples (RETIRED) gentoo-dev 2007-08-04 20:33:42 UTC
rc-update is already fixed in rc2, I'll push out an -r1 with this patch
Comment 18 Roy Marples (RETIRED) gentoo-dev 2007-08-04 20:39:27 UTC
Fixed in rc2-r1 - thanks.
Comment 19 Roy Marples (RETIRED) gentoo-dev 2007-08-04 20:40:16 UTC
(In reply to comment #8)
> we should add a gentoo=debug or something that gets parsed at the start of boot
> so people dont need to add 'set -x' and such ...

It's a good idea, but that only works if /proc is already mounted so we can read the cmdline. So it wouldn't have helped in this case.
Comment 20 Markus Rothe (RETIRED) gentoo-dev 2007-08-05 07:07:38 UTC
yes, perfect. :-)