RS / RSPRO FreeBSD
Warner Losh
imp at bsdimp.com
Tue Feb 1 17:19:06 UTC 2011
On 02/01/2011 03:33, Jayachandran C. wrote:
> On Tue, Feb 1, 2011 at 3:02 PM, Monthadar Al Jaberi<monthadar at 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
More information about the freebsd-mips
mailing list