[OpenWrt-Users] a few questions about whiterussian 0.9

Robert P. J. Day rpjday at crashcourse.ca
Wed Dec 12 19:01:24 CET 2007


  (although i really want to move up to kamikaze ASAP, since i'm
perusing the code for WR 0.9, i might as well get some outstanding
questions out of the way.)

  all questions below reflect what i'm seeing on my linksys WRT54GL.

1) i notice /proc/cmdline contains the option console=ttyS0,115200.
obviously, this has no value unless you have a serial port or have
manually added one, correct?  (i'm not sure i'm ready to pull out the
soldering iron just yet.)

2) in /sbin/mount_root, i notice that the script checks if the first
argument is not equal to "failsafe".  but the only call i see to
mount_root is in /etc/preinit, where there is no argument in the call
to mount_root.  is there another call to mount_root somewhere that
uses the "failsafe" argument?  otherwise, that check seems redundant,
no?  (but i'm going to guess there must be another call somewhere.)

3) i'm examining /bin/firstboot and, if i ignore the special cases,
then the normal behaviour (on actual firstboot) is pretty much
encapsulated in the last few lines of that script, yes?

        mtd erase OpenWrt
        mount /dev/mtdblock/4 /jffs -t jffs2
        fopivot /jffs /rom 1

  that is, erase the JFFS2 filesystem, remount it (and possibly
reformat it if it's never been formatted), and fopivot.  it would seem
to be that simple.  if i have time, i may go back and look at the rest
of that script, but i'm wondering how much more of it i really care
about, at least for now.

4) i'm only now learning about the mini_fo filesystem, but it seems
fairly straightforward -- i can see what it's meant to do.  but in
/bin/firstboot again, in fopivot():

=====
fopivot() { # <rw_root> <ro_root> <dupe?>
        root=$1
        {
                mount -t mini_fo -o base=/,sto=$1 $1 /mnt 2>&- && root=/mnt
        } || {
                [ "$3" = "1" ] && {
                mount | grep "on $1 type" 2>&- 1>&- || mount -o bind $1 $1
                dupe $1 $rom
                }
        }
        pivot $root $2
}
=====

  which of those two conditions above represents the normal flow of
execution?  i don't know enough about mounting type mini_fo FSes to
see clearly which chunk of code will be the one that *typically*
succeeds during a normal firstboot.

(actually, i can see that "fopivot" will be called twice during a
normal firstboot -- once in the middle of firstboot, and again later
on further down in /sbin/mount_root.  so i guess i better read up more
carefully on how mini_fo FSes work in general.)

  and i think that's about it -- from there, i can easily follow the
exec of /sbin/init, thru /etc/inittab and into /etc/init.d/rcS.
thanks for any info.  after this, on to kamikaze.

rday

p.s.  i can see that klogd and syslogd are running, but where are the
log messages going?  on my fedora system, i'm used to looking in
/var/log for kernel messages.  so where are they on my whiterussian
system?  thanks again.




========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================


More information about the openwrt-users mailing list