Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 2010 11:45:41 +0100
From:      Milan Obuch <freebsd-mips@dino.sk>
To:        freebsd-mips@freebsd.org
Subject:   [Re: First RSPRO deployed!] flash utility mkfwimage and RSPRO boot question
Message-ID:  <201011241145.43480.freebsd-mips@dino.sk>
In-Reply-To: <CBBB7D88-210F-4706-A8FD-83FDA7EBA914@gmail.com>
References:  <D74327E9-0A8A-4B46-B4DD-16D0FAF8E3BB@gmail.com> <201011181136.47152.milu@dat.pl> <CBBB7D88-210F-4706-A8FD-83FDA7EBA914@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 18 November 2010 12:07:34 Luiz Otavio O Souza wrote:
> On Nov 18, 2010, at 8:36 AM, Maciej Milewski wrote:
> >>> Do you have proper name of this fw image? I've read somewhere that it's
> >>> required.
> >>> My working name is RSPRO.ar7100pro.FreeBSD.Test and you can change the
> >>> last two words for sure.
> >> 
> >> You mean the name of the file that mkfwimage generates?
> >> I just called it something like firmware-image...
> >> 
> >> I changed the name, but still got:
> >> TFTPD: Incoming connection from 192.168.1.102:25789
> >> Received:  6881688 bytes
> >> Invalid image format (error: -2)
> > 
> > Actually not the filename but if you run mkfwimage with parameters then
> > you have the version string which in my case is as above.
> > 
> > For building image I run:
> > mkfwimage -v RSPRO.ar7100pro.FreeBSD.Test -B RSPRO -o image.bin -k
> > kernel.gz\ -r rootfs
> 
> Yes, that is correct, i've used the following two version strings with
> success:
> 
> RS.ar7100.FreeBSD - for routerstation
> 
> RSPRO.ar7100pro.FreeBSD - for rspro
> 
> Just pick the correct one for your board.
> 
> I've my scripts here (together with mkfwimage files):
> /loos.no-ip.org:280/rspro/rs-mkfwimage.tar.gz
> 
> Hope it helps.
> 

Hi,

I can succesfully build world and kernel and using mkflash create an image 
usable to be loaded by redboot and this is used on regular boot after power 
on. Fine. I am using currently kernel in on board flash (spiflash) and 
filesystem on USB flash key. This way I am able to try native buildworld on 
RSPRO (not too quick, much slower than cross build, but this is expected), 
test ports etc.

I observed one thing - original flash is partitioned into five parts, 
executing 'geom redboot list' tells names

1. Name: redboot/RedBoot
2. Name: redboot/RedBoot config
3. Name: redboot/FIS directory
4. Name: redboot/kernel
5. Name: redboot/rootfs

and sizes

   Mediasize: 196608 (192K)
   Mediasize: 4096 (4.0K)
   Mediasize: 61440 (60K)
   Mediasize: 917504 (896K)
   Mediasize: 15466496 (15M)

(total is 128 k, i. e. 2 * 64k blocksize, less than full flash, 16 M). After 
flashing my kernel, sizes are

   Mediasize: 196608 (192K)
   Mediasize: 4096 (4.0K)
   Mediasize: 61440 (60K)
   Mediasize: 1638400 (1.6M)
   Mediasize: 9895936 (9.4M)

(total is 4864 k, i. e. 76 * 64k blocksize, less full flash, 16 M). My 
original impression was that rest after kernel is left for rootfs, and while 
it's not a problem in my scenario, if I would like to put a real filesystem 
there, would it be limited in size this way or can I use all available flash 
left after kernel? Could it be a bug in mkfwimage or some layout table needs 
to be modified?

Also, is it possible to have new, 'non-standard' partition created, used e. g. 
to store some user config/data? And, one more, could a redboot partition be 
assigned filesystem label?

On a related problem - there is no boot loader for mips (as /boot/loader is 
for i386/amd64 and some variants). I would like to try it in place of kernel 
and have real kernel with some kernel modules (if built and placed in 
/boot/kernel, they work just fine - I did it with nullfs module, having 
if_vlan loaded gives me possibility to create arge1.1 etc) and some loader 
config, which could be used to set some FDT object properties if we decide to 
move later in this direction. All this would mean greater flexibility in my 
eyes.

Naturally, flash aware filesystem would be the most elegant solution, but we 
are not here, yet, unfortunatelly...

Regards,
Milan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011241145.43480.freebsd-mips>