Subject: Re: bootable amd64 installation CD
To: None <port-amd64@netbsd.org>
From: Ray Phillips <r.phillips@jkmrc.com>
List: port-amd64
Date: 07/12/2007 09:56:22
Thanks Manuel and Blair.

>We now have the 'makefs' tool which makes an iso image from a
>directory tree.  What is it exactly that you'd like to change?

I was curious to know how you might put some other files on the boot 
CD, perhaps the NetBSD source, or whatever was convenient. 
Admittedly that's a problem easily solved by putting the source onto 
a second, normal CD.  A better example might be to make a CD from 
which you can boot and install, say, port-alpha, port-sparc and 
port-amd64.

By the way, I suppose it would be possible to make a CD which would 
boot an i386 with an i386 install kernel and also an amd64 machine 
with an amd64 install kernel?  Are the boot loaders the same for both 
ports?  If so, you could make it boot into the i386 install kernel by 
default, but if you stopped it during the five second countdown 
before the kernel had begun to load and told it to boot from an amd64 
install kernel, e.g.:

>  boot cd0a:netbsd.amd64

you could proceed with an amd64 installation. Is that correct?

Of course it would be much easier to use a different boot CD for each 
port, I was just wondering how it worked.


>Read the stuff in distrib/common/Makefile.bootcd :)
>basically you use makefs -t cd9660 and installboot /usr/mdec/bootxx_cd9660
>(don't forget to put a INSTALL kernel with populated ramdisk on the root
>of the CD, and /usr/mdec/boot :)

No doubt the kernel in amd64/installation/cdrom/boot.iso would be suitable?

By the way, is it possible (or easy) to reassemble the single file 
system image contained in 
amd64/installation/floppy/{boot1.fs,boot2.fs,boot3.fs} which could be 
mounted using:

# vnconfig -c vnd0 boot.fs
# mount_ffs /dev/vnd0d /mnt


There are instructions for making a kernel containing a ramdisk here:

http://netbsd.org/docs/guide/en/chap-misc.html#chap-misc-creating-bootfloppies

but they don't work in a source tree after building an amd64 release 
(not in the sources I CVS updated on 21 June anyway):

# pwd
/usr/src/distrib/amd64/ramdisks/ramdisk
# ls -l
total 10
drwxr-xr-x  2 root  wheel   512 Jan 18 13:01 CVS
-rw-r--r--  1 root  wheel   343 Jun  3  2006 Makefile
-rw-r--r--  1 root  wheel  1072 Jun  3  2006 disktab.preinstall
-rw-r--r--  1 root  wheel  1562 Jan 18 13:01 list
-rw-r--r--  1 root  wheel   140 Jun  3  2006 list.inet6
# make
#   compile  ramdisk/getcap.o
/usr/src/obj/tooldir.NetBSD-3.99.20-i386/bin/i386--netbsdelf-gcc -Os 
-fno-asynchronous-unwind-tables  -Werror     -DSMALL  -nostdinc 
-isystem /usr/include -c 
/usr/src/distrib/utils/libhack/../../../lib/libc/gen/getcap.c
make: 
exec(/usr/src/obj/tooldir.NetBSD-3.99.20-i386/bin/i386--netbsdelf-gcc) 
failed (No such file or directory)
*** Error code 1

Stop.
make: stopped in /usr/src/distrib/amd64/ramdisks/ramdisk
#:

Is it possible to tell make to use the amd64 tools instead of i386 
ones?  I built the release using:

# pwd
/usr/src
# sh -c '/usr/bin/time ./build.sh command: ./build.sh -D 
../DistribDir -R ../ReleaseDir -O ../obj -T ../tools -x -m amd64 
release > build.sh.log 2>&1'


Ray