Subject: Re: Wrestling with Ram Disks
To: Larry Colen <lrc@recourse.com>
From: Frederick Bruckman <fb@enteract.com>
List: port-i386
Date: 03/08/2001 19:23:33
On Thu, 8 Mar 2001, Larry Colen wrote:

> On Thu, Mar 08, 2001 at 02:56:40PM -0600, Frederick Bruckman wrote:
> >
> > To build the installation ramdisk, you basically need to build a whole
> > release. The kernel alone would have no binaries on the disk (no
> > init!), and so would be unable to boot. For example: "cd /usr/src;
> > make release DESTDIR=/var/tmp/dest RELEASEDIR=/usr/release"
>
> I've found documentation on making a bootable cdrom. It said to make
> your file system under the directory /cdimage and then use mksiofs or
> mkhybrid to create the iso9660 image for a cdrom.  It did not make any
> clear obvious references as to what this would do about a ramdisk.

I've never burned a NetBSD cdrom. Doesn't it use the "floppy" in
boot-floppy-big, which gets it's ramdisk from ramdisk-big? You
wouldn't have to know the details, as the release target takes care of
that, but you would need a full binary release. (Of course! Why else
would you make a cdrom?)

> I tried doing as you said about going to /usr/src and typing make
> release. That failed miserably.

That's _not_ exactly what I said! Was the message "Please set DESTDIR
before doing that", or "Please set RELEASEDIR before doing that"?  If
it's not clear what to do from the message, please look again at what
I wrote!

> I also tried
> grep release `locate Makefile` to grep every Makefile on my system for
> a release target and didn't get any good leads from that either.

There are some notes in the top-level "Makefile", including a
suggestion to view the additional notes in "etc/Makefile", which is
where most of the hooks are, including the release = snapshot target.

> I did install netbsd 1.5 off the cdrom that I got from daemon news.

Well that's good! Welcome to NetBSD!

> I wasn't able to find where to do make release. Trying it at
> /sys/arch/i386/conf was quite unsuccessful. As was
> /sys/arch/i386/compile/TARGETNAME.  Do the ramdisks from the kernel
> have the ability to grow as memory is free?

"make release" (among other things) configures and builds the INSTALL
kernels under /usr/src/sys/arch/i386/compile/INSTALL*, builds the
ramdisks under /usr/src/distrib/i386/floppies/ramdisk*, and inserts
each ramdisk into it's corresponding kernel. If you're just curious,
you can view an outline of the process via

 cd /usr/src/etc; make -n release RELEASEDIR=releasedir DESTDIR=destdir

The "-n" just prints the commands that "make" would run (without the
-n"), which happen to be all recursive "make"'s, if you do it in the
directory suggested.

If you actually want to build your own full release, X sets and
everything, a script to do just that on a freshly cvs'd "src" and
"xsrc" follows. You're expected to set MYDESTDIR and MYRELEASEDIR to
directories on volumes that have adequate free space, naturally.


Frederick


#!/bin/sh

MYDESTDIR=/var/tmp/buildroot
MYRELEASEDIR=/usr/release/NetBSD-`uname -r`/`uname -m`

/bin/date -u >/var/tmp/SOURCE_DATE

rm -rf ${MYDESTDIR} &&
mkdir -p ${MYDESTDIR} ${MYRELEASEDIR}

cd /usr/src &&
  make release \
    DESTDIR=${MYDESTDIR} RELEASEDIR=${MYRELEASEDIR} &&

cd /usr/xsrc &&
  make release \
    DESTDIR=${MYDESTDIR} RELEASEDIR=${MYRELEASEDIR} &&

/bin/mv /var/tmp/SOURCE_DATE ${MYRELEASEDIR}/