Subject: Re: "How to create bootable NetBSD image on Compact Flash" HowTo
To: Marcin Jessa <>
From: Hubert Feyrer <>
List: tech-embed
Date: 04/01/2005 04:19:52
On Thu, 31 Mar 2005, Marcin Jessa wrote:

  * Please re-format to 75 columns (so it'll display in the usual 80-col
  * ``The image directory is where you have your custom made file
    system.'': Is this 'image' directory the same as the
    /home/yazzy/wifibsd/ directory you mention earlier? May be good to not
    change the name. :)
  * The example you give explains to copy over shared libs (don't forget
    the shared library loader, /libexec/ld.elf_so!). An alternative to that
    is link all programs and libraries statically into a big binary. This
    will save some disk space - it's the same technique known on Linux as
    "busybox" (IIRC). This is what "the NetBSD way" does. On its way,
    it will use crunchgen(1) to read a config file, which contains
    information about which programs should be put into the binary.
    Maybe see the manpage for more details, plus src/distrib/*
  * "gzip -c -9 .../netbsd >netbsd" - I'm not sure what you try to
    do here. The kernel is usually uncompressed, so a simple "cp"
    will do. You can gzip the whole thing after you've inserted the
    ramdisk image with mdsetimage.
  * Maybe add a few section headlines (and numbers) to allow identifying
    sections - esp. the alternative ones - and skipping to them as you
    advise your readers.
  * For the editing of the Makefile, maybe don't post the full Makefile,
    but a patch ("diff -u Makefile.old Makefile >patch"). It's a bit
    clearer on what was changed than pasting the whole file.
  * s/Built/Build/ - i think that should be done before running 'make'.
  * When showing how to build the kernel, include the steps to get the
    kernel config file:

 	cd /usr/src
 	cp sys/arch/i386/conf/GENERIC sys/arch/i386/conf/SOEKRIS
 	(or whatever file you use, I don't know)
 	vi sys/arch/i386/conf/SOEKRIS
 	./ ... [as before]

    Maybe refer to options(4) for some ideas on what to edit in that file.
  * Seeing you use src/distrib/i386/floppies/bootfloppy-big:
    there's an upper limit of that of 2,88MB (2880KB).  As that limit
    is for bootable CDROMs, it's probably safe to bump it for CF cards.
    To do so, change the "FLOPPYSIZE" in the Makefile - the value is in
    sectors of 512 bytes or half kilobytes (5760 / 2 = 2880KB).
  * Will rawrite.exe work as alternative to physdiskwrite on Windows?
    It's what NetBSD recommends and ships, see
    There's a "rawrite.exe" in there for MS-DOS, "" contains
    the Windows binary "rawrite32.exe".
  * ``3. Now, lets build an image you can dd to your CF'': Maybe tell
    the reader that this applies if he used #1 (not #2) above.
  * What does explicit setting of the byte-order to 'le' buy?
    i386's little endian already...
  * ``Compress your image to the mounted memory file system:''
    image -> kernel?

These few nits above, I found your documentation very interesting, putting 
many things into one place that are scattered across a large area - thanks 
for writing this! :)

(Maybe drop us a line if you incorporate any of the changes above)

  - Hubert

NetBSD - Free AND Open!      (And of course secure, portable, yadda yadda)