Loading ...
Sorry, an error occurred while loading the content.

Re: Info on bootloader/kernel image storage

Expand Messages
  • dtaub001
    ... accessed ... that ... site I ... Right you are! root@HD-HLANA09:/usr/src/linux-2.4.17_mvl21-sandpoint# arch/ppc/boot/utils/setsum/chkheader /dev/fl1
    Message 1 of 12 , Oct 12, 2004
    • 0 Attachment
      --- In LinkStation_General@yahoogroups.com, "Rick Flower" <rickf@c...>
      wrote:
      > dtaub001 said:
      > >
      > >
      > > --- In LinkStation_General@yahoogroups.com, "dtaub001" <taubert@g...>
      > > wrote:
      > >>
      > >>
      > >> There seems to be an 8MB flash divided up into sections. Once in
      > >> linux, these can be accessed via /dev/fl[0-5]:
      > >>
      > >> root@HD-HLANA09:/tmp# ls -l /dev/fl*
      > >> brw-rw-r-- 1 root root 250, Nov 28 2002 /dev/fl0
      > >> brw-rw-r-- 1 root root 250, 1 Nov 28 2002 /dev/fl1
      > >> brw-rw-r-- 1 root root 250, 2 Nov 28 2002 /dev/fl2
      > >> brw-rw-r-- 1 root root 250, 3 Nov 28 2002 /dev/fl3
      > >> brw-rw-r-- 1 root root 250, 4 Nov 28 2002 /dev/fl4
      > >> brw-rw-r-- 1 root root 250, 5 Nov 28 2002 /dev/fl5
      > >>
      > >> The contents can be extracted with cat:
      > >>
      > >> root@HD-HLANA09:/tmp# ls -l fl*
      > >> -rw-r--r-- 1 root root 524288 Oct 11 17:50 fl0
      > >> -rw-r--r-- 1 root root 3145728 Oct 11 17:50 fl1
      > >> -rw-r--r-- 1 root root 458752 Oct 11 17:50 fl2
      > >> -rw-r--r-- 1 root root 65536 Oct 11 17:50 fl3
      > >> -rw-r--r-- 1 root root 4194304 Oct 11 17:50 fl4
      > >> -rw-r--r-- 1 root root Oct 11 17:50 fl5
      > >>
      > >> /dev/fl0 appears to be for temporary file storage, and can be
      accessed
      > >> with the as_flash command:
      > >>
      > >> root@HD-HLANA09:/tmp# as_flash /dev/fl0 list
      > >> -> /tmp/conf_save.tar.gz
      > >>
      > >> /dev/fl1 and /dev/fl4 both appear to contain vmlinux images, but I
      > >> can't quite work out the format.
      > >
      > > These are gzip-ed kernel images with a 108 byte header of some kind.
      > > Try the following:
      > >
      > > dd ibs=1 count=108 if=fl1 | od -c
      > > dd ibs=1 skip=108 if=fl1 > vmlinux.gz
      > > gunzip -t vmlinux.gz
      >
      > I believe the extra 108 bytes of header is setup by the set_sum tool
      that
      > can be found on one of the japanese sites
      > (ftp://linkstation.yi.org/pub/linkstation/tools), along with the entire
      > kernel with config file, etc. It's in the parent directory of the
      site I
      > mentioned above. It would be great to be able to rebuild the kernel and
      > load it into Flash with more optimizations than it currently has (like
      > removing the kprint() calls in the USB area for starters)

      Right you are!

      root@HD-HLANA09:/usr/src/linux-2.4.17_mvl21-sandpoint#
      arch/ppc/boot/utils/setsum/chkheader /dev/fl1
      info_ver: 0x00000001
      firmid: 0x00000003
      firmname: HD-HLAN(HIDETADA)
      subver: FLASH 1.1
      version: major 0x0001 minor 0x0005
      build: 0x0000
      year/mon/day: 2004/05/21
      hour:min:sec: 13:41:00
      size: 2879996 (0x002bf1fc) bytes
      chksum: 0x2743c310
      kernel_offset: 108 (0x0000006c) bytes
      kernel_size: 838590 (0x000ccbbe) bytes
      initrd_offset: 838698 (0x000ccc2a) bytes
      initrd_size: 2041298 (0x001f25d2) bytes

      # dd ibs=1 skip=108 count=838590 if=fl1 > vmlinux.gz
      # dd ibs=1 skip=838698 count=2041298 if=fl1 > loopfile.gz

      BTW, that loopfile.gz is needed to build a new kernel (cp to
      arch/ppc/boot/images/images/ramdisk.image.gz).

      I downloaded the kernel/config from the linkstation.yi.org website,
      and I've managed to build a firmimg.bin using the kurobox (native)
      tools and a few bins from yellowdog. It should just be a simple
      matter of dd-ing that file to /dev/fl1 and rebooting, but I'm not that
      brave yet...

      I'll post a howto after I clean it up a bit.

      Derek


      > >> According to some of the JP sites (do a google for as_flash and run
      > >> the pages thru altavista's babel fish), /dev/fl2 is the main
      > >> BIOS/bootloader, and /dev/fl3 is for storing boot progress info.
      > >
      > > /dev/fl3 appears to be modified by the following utils:
      > >
      > > /usr/bin/write_ng
      > > /usr/bin/write_ok
      >
      > Interesting..
      >
      > -- Rick
    • nrkkflower
      ... that ... Derek, I ve beat you to the punch.. I ve already re-genned my kernel last night and have somewhat documented it over on the Revogear forums. I
      Message 2 of 12 , Oct 13, 2004
      • 0 Attachment
        --- In LinkStation_General@yahoogroups.com, "dtaub001" <taubert@g...>
        wrote:

        > I downloaded the kernel/config from the linkstation.yi.org website,
        > and I've managed to build a firmimg.bin using the kurobox (native)
        > tools and a few bins from yellowdog. It should just be a simple
        > matter of dd-ing that file to /dev/fl1 and rebooting, but I'm not
        that
        > brave yet...
        >
        > I'll post a howto after I clean it up a bit.

        Derek,

        I've beat you to the punch.. I've already re-genned my kernel last
        night and have somewhat documented it over on the Revogear forums. I
        took a leap of faith that I wouldn't goof up the box and it worked
        fine.. However I'm not 100% sure I'm using the complete updated kernel
        since I modified the uname string from "sandpoint" to
        "sandpoint-osxaddict" and after re-genning the kernel and re-flashing
        it, it still says "sandpoint" as in the following :

        % uname -a
        Linux HD120 2.4.17_mvl21-sandpoint #8 Tue Oct 12 23:23:24 PDT 2004 ppc
        unknown

        It looks like you found the showflash.pl script that was on one of the
        japanese sites.. That really took a lot of the guesswork out of the
        steps.

        Just make sure you update both fl1 and fl2.. I put bootcode.bin in fl2
        and firmimg.bin into fl1.

        -- Rick
      • Derek Taubert
        ... That s cool. I m so dependent on my NAS now that I wasn t really willing to turn it into a doorstop... ... Does your box have anything in /dev/fl4? It is
        Message 3 of 12 , Oct 13, 2004
        • 0 Attachment
          On Wed, Oct 13, 2004 at 08:17:08PM -0000, nrkkflower wrote:
          > --- In LinkStation_General@yahoogroups.com, "dtaub001" <taubert@g...>
          > wrote:
          >
          > > I downloaded the kernel/config from the linkstation.yi.org website,
          > > and I've managed to build a firmimg.bin using the kurobox (native)
          > > tools and a few bins from yellowdog. It should just be a simple
          > > matter of dd-ing that file to /dev/fl1 and rebooting, but I'm not
          > that
          > > brave yet...
          > >
          > > I'll post a howto after I clean it up a bit.
          >
          > Derek,
          >
          > I've beat you to the punch.. I've already re-genned my kernel last
          > night and have somewhat documented it over on the Revogear forums. I

          That's cool. I'm so dependent on my NAS now that I wasn't really willing
          to turn it into a doorstop...


          > took a leap of faith that I wouldn't goof up the box and it worked
          > fine.. However I'm not 100% sure I'm using the complete updated kernel
          > since I modified the uname string from "sandpoint" to
          > "sandpoint-osxaddict" and after re-genning the kernel and re-flashing
          > it, it still says "sandpoint" as in the following :
          >
          > % uname -a
          > Linux HD120 2.4.17_mvl21-sandpoint #8 Tue Oct 12 23:23:24 PDT 2004 ppc
          > unknown

          Does your box have anything in /dev/fl4? It is a bigger flash space on
          mine, but has an identical kernel/initrd stored there.

          The compile date is certainly different, so it looks like you're running
          a new kernel. Have a look at the following:

          *** /proc/asconf_info ***
          PRODUCTNAME=HD-HLAN(HIDETADA)
          VERSION=1.05
          SUBVERSION=FLASH 1.1
          PRODUCTID=0x00000003
          BUILDDATE=2004/5/21 13:41:0
          BOOTFLAG=OK

          *** /proc/devices ***
          Character devices:
          1 mem
          2 pty
          3 ttyp
          4 ttyS
          5 cua
          10 misc
          21 sg
          128 ptm
          136 pts
          162 raw
          180 usb

          Block devices:
          1 ramdisk
          3 ide0
          7 loop
          8 sd
          65 sd
          66 sd
          250 flashd

          *** /proc/filesystems ***
          nodev rootfs
          nodev bdev
          nodev proc
          nodev sockfs
          nodev tmpfs
          nodev shm
          nodev pipefs
          ext3
          ext2
          nodev ramfs
          vfat
          nodev smbfs
          nodev autofs
          nodev devpts
          nodev usbdevfs
          nodev usbfs
          ntfs

          If you install /usr/bin/whoami before the build, that should show up in
          the uname -a as well.


          > It looks like you found the showflash.pl script that was on one of the
          > japanese sites.. That really took a lot of the guesswork out of the
          > steps.

          Actually, I used the chkheader binary from the setsum directory. It
          verifies the checksum in addition to dumping out the header.


          > Just make sure you update both fl1 and fl2.. I put bootcode.bin in fl2
          > and firmimg.bin into fl1.

          Is the update to fl2 really necessary? Any idea how different the code is
          from the Buffalo distribution?

          Do you have any clues about what the write_ng/write_ok bins do to the boot
          process?

          Derek


          > -- Rick
          >
          >
          >
          >
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
        • nrkkflower
          ... on ... Mine is definately different -- completely different sizes.. The stuff in /dev/fl1 is ~1Mb smaller in size. ... running ... Here s the output from
          Message 4 of 12 , Oct 13, 2004
          • 0 Attachment
            --- In LinkStation_General@yahoogroups.com, Derek Taubert <taubert@g..
            .> wrote:

            > Does your box have anything in /dev/fl4? It is a bigger flash space
            on
            > mine, but has an identical kernel/initrd stored there.

            Mine is definately different -- completely different sizes.. The stuff
            in /dev/fl1 is ~1Mb smaller in size.

            > The compile date is certainly different, so it looks like you're
            running
            > a new kernel. Have a look at the following:
            >
            > *** /proc/asconf_info ***
            > PRODUCTNAME=HD-HLAN(HIDETADA)
            > VERSION=1.05
            > SUBVERSION=FLASH 1.1
            > PRODUCTID=0x00000003
            > BUILDDATE=2004/5/21 13:41:0
            > BOOTFLAG=OK

            Here's the output from mine :

            PRODUCTNAME=HD-HLAN(HIDETADA)
            VERSION=1.04
            SUBVERSION=FLASH 1.2
            PRODUCTID=0x00000003
            BUILDDATE=2004/10/12 23:25:48
            BOOTFLAG=OK

            > *** /proc/devices ***
            > Character devices:
            > 1 mem
            > 2 pty
            > 3 ttyp
            > 4 ttyS
            > 5 cua
            > 10 misc
            > 21 sg
            > 128 ptm
            > 136 pts
            > 162 raw
            > 180 usb
            >
            > Block devices:
            > 1 ramdisk
            > 3 ide0
            > 7 loop
            > 8 sd
            > 65 sd
            > 66 sd
            > 250 flashd

            Here's my output :

            Character devices:
            1 mem
            2 pty
            3 ttyp
            4 ttyS
            5 cua
            10 misc
            128 ptm
            136 pts
            162 raw
            180 usb

            Block devices:
            1 ramdisk
            3 ide0
            250 flashd

            > *** /proc/filesystems ***
            > nodev rootfs
            > nodev bdev
            > nodev proc
            > nodev sockfs
            > nodev tmpfs
            > nodev shm
            > nodev pipefs
            > ext3
            > ext2
            > nodev ramfs
            > vfat
            > nodev smbfs
            > nodev autofs
            > nodev devpts
            > nodev usbdevfs
            > nodev usbfs
            > ntfs

            And finally here's my output on this one :

            nodev rootfs
            nodev bdev
            nodev proc
            nodev sockfs
            nodev tmpfs
            nodev shm
            nodev pipefs
            nodev binfmt_misc
            ext3
            ext2
            msdos
            vfat
            nodev smbfs
            ntfs
            nodev devpts
            nodev usbdevfs
            nodev usbfs

            > Is the update to fl2 really necessary? Any idea how different the
            code is
            > from the Buffalo distribution?

            I don't know.. I read something that roughly indicated that on one of
            the translated sites.. I just did it to be sure..

            > Do you have any clues about what the write_ng/write_ok bins do to
            the boot
            > process?

            Nope.. I'm not too sure when they take place in the boot process.
          • tad94564
            ... I ... kernel ... re-flashing ... FYI, kernel names are limited in length, and you probably overran it. thomas
            Message 5 of 12 , Oct 20, 2004
            • 0 Attachment
              --- In LinkStation_General@yahoogroups.com, "nrkkflower" <rickf@c...>
              wrote:
              > I've beat you to the punch.. I've already re-genned my kernel last
              > night and have somewhat documented it over on the Revogear forums.
              I
              > took a leap of faith that I wouldn't goof up the box and it worked
              > fine.. However I'm not 100% sure I'm using the complete updated
              kernel
              > since I modified the uname string from "sandpoint" to
              > "sandpoint-osxaddict" and after re-genning the kernel and
              re-flashing
              > it, it still says "sandpoint" as in the following :
              >

              FYI, kernel names are limited in length, and you probably overran it.

              thomas
            • Rick Flower
              Actually, the problem stemmed from the fact that the Makefile doesn t bother to re-generate those various header files if they already exist.. In my case, the
              Message 6 of 12 , Oct 20, 2004
              • 0 Attachment
                Actually, the problem stemmed from the fact that the Makefile doesn't
                bother to re-generate those
                various header files if they already exist.. In my case, the original
                ones existed first and it just didn't
                bother to re-gen them.. Once I removed the offending header files, the
                Makefile re-gened the offending
                files and now my kernel version looks like the following :

                HD120:~ [401]> uname -a
                Linux HD120 2.4.17_mvl21-sandpoint-osxaddict #16 Thu Oct 14 21:53:09
                PDT 2004 ppc unknown

                -- Rick

                On Oct 20, 2004, at 9:14 PM, tad94564 wrote:

                >
                >
                > --- In LinkStation_General@yahoogroups.com, "nrkkflower" <rickf@c...>
                > wrote:
                >> I've beat you to the punch.. I've already re-genned my kernel last
                >> night and have somewhat documented it over on the Revogear forums.
                > I
                >> took a leap of faith that I wouldn't goof up the box and it worked
                >> fine.. However I'm not 100% sure I'm using the complete updated
                > kernel
                >> since I modified the uname string from "sandpoint" to
                >> "sandpoint-osxaddict" and after re-genning the kernel and
                > re-flashing
                >> it, it still says "sandpoint" as in the following :
                >>
                >
                > FYI, kernel names are limited in length, and you probably overran it.
                >
                > thomas
                >
                >
                >
                >
                >
                >
                >
                > Yahoo! Groups Links
                >
                >
                >
                >
                >
                >
              • tad94564
                ... doesn t ... original ... the ... 21:53:09 ... Then they fixed what used to bite me in the past. :) thanks! thomas
                Message 7 of 12 , Oct 21, 2004
                • 0 Attachment
                  --- In LinkStation_General@yahoogroups.com, Rick Flower <rickf@c...>
                  wrote:
                  > Actually, the problem stemmed from the fact that the Makefile
                  doesn't
                  > bother to re-generate those
                  > various header files if they already exist.. In my case, the
                  original
                  > ones existed first and it just didn't
                  > bother to re-gen them.. Once I removed the offending header files,
                  the
                  > Makefile re-gened the offending
                  > files and now my kernel version looks like the following :
                  >
                  > HD120:~ [401]> uname -a
                  > Linux HD120 2.4.17_mvl21-sandpoint-osxaddict #16 Thu Oct 14
                  21:53:09
                  > PDT 2004 ppc unknown
                  >

                  Then they fixed what used to bite me in the past. :)

                  thanks!
                  thomas
                Your message has been successfully submitted and would be delivered to recipients shortly.