Hi, thanks!

> It seems a bit strange that checkroot gave no output, just failure -
> as if it's execution didn't even started, and, since it's one of the
> first initscripts to start, prehaps there's a problem with bash
> interpreter or access to init.d path.
>
> Since you've mounted filesystem and it looks okay, you can try changing
> last two columns in /etc/fstab for root filesystem to "0 0", so script
> won't try to check it - that way you can see if it's something with
> fsck - prehaps the system will just boot.

I have tried it, but nothing change.


>
> Then, if the rest of the initscripts won't throw some similar errors
> (possibly exposing the real problem), you can probably insert a lot of
> echoes/einfos to that initscript to see at which point everything hangs
> and check what's wrong with the command causing it.

I have inserted some echos,  now the "checkroot" script is:
/*************************************************************/
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
    before *
}

start() {
    local retval=0

    echo 1

    if [[ ! -f /fastboot && -z ${CDBOOT} ]] \
    && ! is_net_fs / && ! is_union_fs / ; then
        echo 2
        if touch -c / >& /dev/null ; then
            ebegin "Remounting root filesystem read-only"
            mount -n -o remount,ro /
            eend $?
        fi

        if [[ -f /forcefsck ]] || get_bootparam "forcefsck" ; then
            ebegin "Checking root filesystem (full fsck forced)"
            fsck -C -a -f /
            # /forcefsck isn't deleted because checkfs needs it.
            # it'll be deleted in that script.
            retval=$?
        else
            # Obey the fs_passno setting for / (see fstab(5))
            # - find the / entry
            # - make sure we have 6 fields
            # - see if fs_passno is something other than 0
            if [[ -n $(awk '($1 ~ /^(\/|UUID|LABEL)/ && $2 == "/" \
                            && NF == 6 && $6 != 0) { print }' /etc/fstab) ]]
            then
                ebegin "Checking root filesystem"
                fsck -C -T -a /
                retval=$?
            else
                ebegin "Skipping root filesystem check (fstab's passno ==
0)"
                retval=0
            fi
        fi

        if [[ ${retval} -eq 0 ]] ; then
            eend 0
        elif [[ ${retval} -eq 1 ]] ; then
            ewend 1 "Filesystem repaired"
        elif [[ ${retval} -eq 2 || ${retval} -eq 3 ]] ; then
            ewend 1 "Filesystem repaired, but reboot needed!"
            if [[ ${RC_FORCE_AUTO} != "yes" ]] ; then
                echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1
                echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1
                ewarn "Rebooting in 10 seconds ..."
                sleep 10
            fi
            einfo "Rebooting"
            /sbin/reboot -f
        else
            if [[ ${RC_FORCE_AUTO} == "yes" ]] ; then
                eend 2 "Rerunning fsck in force mode"
                fsck -y -C -T /
            else
                eend 2 "Filesystem couldn't be fixed :("
                sulogin ${CONSOLE}
            fi
            einfo "Unmounting filesystems"
            /bin/mount -a -o remount,ro &> /dev/null
            einfo "Rebooting"
            /sbin/reboot -f
        fi
    fi

    echo 3

    # Should we mount root rw ?  the touch check is to see if the / is
    # already mounted rw in which case there's nothing for us to do
[...]
/*************************************************************/

Now the booting message is :
/*************************************************************/
mounting devpts at /dev/pts     OK
1
/*************************************************************/
I am not quite understand the script. But I guess somethink must be wrong in
the "if' statement which contain "echo 2".

Any help will be appreciated!

-- 
wcw

Reply via email to