NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

trying to build a NetBSD PXE installer with pxelinux



Hi,

A while ago, a started to build a PXE server using a NetBSD computer at home. 
My main goal is to use PXE to boot several operating system installers for x86 
and x86_64, including some Linux distributions and of course, NetBSD. 
For my tests, I mainly use virtual machines. To be precise, I use VirtualBox on 
a Linux or OS X host. 

When I started this project, I used NetBSD 5 on the server, and upgraded it 
later. Today, it runs NetBSD 6.1 amd64 with a DOM0 Xen setup (this should be 
irrelevant, right ?).
This is a surprise for nobody, I went with Pxelinux to get my setup working.
The server acts as secondary DHCP and DNS server. It runs an HTTP server 
(bozohttpd included in the base system), a tftp server (also from the base 
system) and an NFS share (read-only, it shares the same directory as the HTTP 
server). My directory structure on the server is the following :
- /srv/www/ is shared by tftp,httpd and NFS, and is the "root-path" in 
dhcpd.conf ;
- /srv/www/pub/ contains the mirror for the distributions, each one has its 
directory ;
- /srv/www/syslinux-6.01/ is the directory containing the syslinux distribution 
;
- /srv/www/syslinux is a symbolic link to syslinux-6.01
- /srv/www/NetBSD/ is a mirror of the NetBSD 5.x and 6.x releases, for i386 and 
amd64 only ;
- /srv/www/pxelinux.cfg/ has pxelinux configuration, with the configuration 
sitting in the "default" file ;
- /srv/www/ also includes a boot.cfg file, a pxeboot_ia32.bin file (with 
modules and boot.cfg enabled).

root@arreat:/srv/www# ls -hl
total 56K
-rwxr-xr-x   1 root  wheel  1,6K Aug 24 22:25 boot.cfg*
lrwxr-xr-x   1 root  wheel   39B Jul 21 13:15 chain.c32@ -> 
pub/syslinux/bios/com32/chain/chain.c32
lrwxr-xr-x   1 root  wheel   34B Jul 21 13:16 gpxelinux.0@ -> 
pub/syslinux/bios/gpxe/gpxelinux.0
lrwxr-xr-x   1 root  wheel   35B Jul 21 13:16 gpxelinuxk.0@ -> 
pub/syslinux/bios/gpxe/gpxelinuxk.0
lrwxr-xr-x   1 root  wheel   51B Jul 21 13:18 ldlinux.c32@ -> 
pub/syslinux/bios/com32/elflink/ldlinux/ldlinux.c32
lrwxr-xr-x   1 root  wheel   40B Jul 21 13:31 libcom32.c32@ -> 
pub/syslinux/bios/com32/lib/libcom32.c32
lrwxr-xr-x   1 root  wheel   43B Jul 21 13:32 libutil.c32@ -> 
pub/syslinux/bios/com32/libutil/libutil.c32
lrwxr-xr-x   1 root  wheel   39B Jul 21 16:04 mboot.c32@ -> 
pub/syslinux/bios/com32/mboot/mboot.c32
lrwxr-xr-x   1 root  wheel   33B Jul 21 13:34 memdisk@ -> 
pub/syslinux/bios/memdisk/memdisk
drwxr-xr-x  27 root  wheel  1,0K Aug 19 13:28 pub/
-rw-r--r--   1 root  wheel   52K Aug  4 21:56 pxeboot_ia32.bin
lrwxr-xr-x   1 root  wheel   33B Jul 21 13:14 pxelinux.0@ -> 
pub/syslinux/bios/core/pxelinux.0
drwxr-xr-x   2 root  wheel  512B Aug 25 12:47 pxelinux.cfg/
lrwxr-xr-x   1 root  wheel   41B Jul 21 13:16 vesamenu.c32@ -> 
pub/syslinux/bios/com32/menu/vesamenu.c32

I may have complicated the setup by wanting to upgrade syslinux without 
efforts...

When using NetBSD 5 (5.0 to 5.2 included), I can configure Pxelinux to load the 
boot.iso file, using this kind of configuration :

LABEL nb52064
        MENU LABEL Install NetBSD 5.2 amd64
        KERNEL memdisk
        APPEND iso 
        INITRD pub/NetBSD/NetBSD-5.2/amd64/installation/cdrom/boot.iso

However, when using this configuration to load a NetBSD 6 boot.iso file, the 
kernel asks for a boot and a root device. Since it's in memory, I did not know 
what to type in to get the installation going. Further more, the behavior 
changes a little bit wether there is a CD-ROM drive on the PXE client

After the installation ISO, I went to the installation image disk. I used this
configuration : 

LABEL nb61064disk
        MENU LABEL Install NetBSD 6.1 amd64 from disk image
        LINUX memdisk
        #APPEND raw
        INITRD pub/NetBSD/iso/6.1/NetBSD-6.1-amd64-install.img.gz

I got the same error, suggesting to use one of wm0, wd0[a-p], ddb, halt or
reboot.

I then tried to load the installation kernel. My Google search got me this kind 
of configuration
(from http://www.syslinux.org/archives/2008-February/009898.html) :

LABEL nb61064mboot
        KERNEL mboot.c32
        APPEND pub/NetBSD/NetBSD-6.1/amd64/binary/kernel/netbsd-INSTALL.gz

But I get the following error : "Invalid Multiboot image: neither ELF header 
nor a.out kludge found".
Trying to directly boot with netbsd-INSTALL.gz did not work (Pxelinux loads it 
but then no message and the PXE menu is still here).

After that, I wanted to chain Pxelinux and the NetBSD PXE bootloader 
(http://wiki.netbsd.org/tutorials/how_to_install__40__boot__41___netbsd_using_pxelinux/).
I first configured a NetBSD-only installer, and wrote a quite complete boot.cfg 
in order to boot each i386 and amd64 installer kernel. I replaced pxelinux.0 
with pxeboot_ia32.bin in dhcpd.conf, and it worked quite well.
However, when I went back to Pxelinux and chained pxeboot_ia32.bin like 
explained in the wiki, it did not work.
The pxeboot_ia32.bin is downloaded, and so is boot.cfg (read requests in
/var/log/messages are successful). I then get a DHCP discover, a DHCP offer, a 
request then ACK and nothing for about 10 seconds. Then it starts again with 
the DHCP discover and offer.

The configuration for the chain is the following :

LABEL nbpxeboot
        MENU LABEL NetBSD PXE installer
        KERNEL pxeboot_ia32.bin

(I tried KERNEL, BOOT and PXE directives since 
http://www.syslinux.org/wiki/index.php/SYSLINUX#KERNEL_file suggests it for 
bootstrap and PXE network bootstrap programs)

What did I miss ? What log file did I forget to check ? What did I misconfigure 
? Where can I add some debug or verbose options ?

Regards,

Nils


Home | Main Index | Thread Index | Old Index