Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Feb 2011 10:14:47 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        freebsd-mips@freebsd.org
Subject:   Re: RS / RSPRO FreeBSD
Message-ID:  <4D483F87.4020801@bsdimp.com>
In-Reply-To: <AANLkTinkdBNmzJgHeBpFyh3eq9=70ksDUpYEaog%2BZYrZ@mail.gmail.com>
References:  <AANLkTi=vcLScFS%2BJxj0HSZc8hE9p4=W=hrnvMpMfm2OG@mail.gmail.com>	<AANLkTinjupTkkesyY%2B65R8vmYKRpanrOy9C=nRJrPEX=@mail.gmail.com>	<AANLkTikE9Fe0P82ADN3%2BV38=eHr3W1bGaYVx9Rg02pEB@mail.gmail.com>	<201101200928.45264.freebsd-mips@dino.sk>	<AANLkTikWhFUtU_38LgbFf%2B3G8iBTQWW115JSQsmm-%2Bpc@mail.gmail.com>	<AANLkTimK7xM5-BQXSAjiAWiY0h_NixpdHD1XFqheFh_D@mail.gmail.com>	<527911.58663.qm@web33203.mail.mud.yahoo.com>	<AANLkTi=DjAs1QLYN90T4eSAPZCQAR3M_ArLTtiS%2B-nDK@mail.gmail.com> <AANLkTinkdBNmzJgHeBpFyh3eq9=70ksDUpYEaog%2BZYrZ@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

On 02/01/2011 03:33, Jayachandran C. wrote:
> On Tue, Feb 1, 2011 at 3:02 PM, Monthadar Al Jaberi<monthadar@gmail.com>  wrote:
>> Sure,
>>
>> I used the standard kernel configuration file and modifed this:
>> options                 MD_ROOT
>> options                 MD_ROOT_SIZE=40960
>> options                 ROOTDEVNAME=\"ufs:md0\"
>>
>> to generate filesystem:
>> makefs -t ffs -B big -s 40m rootfs.img path-to-filesystem/
>>
>> to embedd the filesystem (script code):
>> addr=($(strings -td kernel | grep "MFS Filesystem" | awk '{print
>> $1}')) #calculate start and end address for mdroot
>> rootfs_start=${addr[0]}
>> rootfs_end=$((${addr[1]}+1))
>> echo "Generating kernel image"
>> head -c ${rootfs_start} kernel>  kernel.new
>> cat rootfs.img>>  kernel.new
>> tail -c +${rootfs_end} kernel>>  kernel.new
>> gzip -9 kernel.new
>>
>> Sorry for the extreme delay, hope it helps...
> You can just set the MFS_IMAGE environment variable, and the 'make
> buildkernel' will patch the mfs image during the kernel build process.
> The script it uses is sys/tools/embed_mfs.s

while that is true, I wonder if anybody has tried to create a linker 
script that would allow you to add the MFS image as an ELF section and 
use ldscript magic to get the start/end address.  This would allow you 
to generate MFS images of different sizes and attach them to the same 
kernel.

Warner



help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D483F87.4020801>