From owner-freebsd-mips@FreeBSD.ORG Wed Nov 24 10:45:52 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1210E106566B for ; Wed, 24 Nov 2010 10:45:52 +0000 (UTC) (envelope-from freebsd-mips@dino.sk) Received: from loki.netlab.sk (loki.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id C77DF8FC19 for ; Wed, 24 Nov 2010 10:45:51 +0000 (UTC) Received: from door.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: PLAIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by loki.netlab.sk with esmtp; Wed, 24 Nov 2010 11:53:18 +0100 id 00033C19.4CECEE9E.00008DBA From: Milan Obuch To: freebsd-mips@freebsd.org Date: Wed, 24 Nov 2010 11:45:41 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.5.3; i386; ; ) References: <201011181136.47152.milu@dat.pl> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011241145.43480.freebsd-mips@dino.sk> Cc: Subject: [Re: First RSPRO deployed!] flash utility mkfwimage and RSPRO boot question X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2010 10:45:52 -0000 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