20101105

Booting Unix systems from Windows Deployment Server: OpenBSD

This approach, similar to the one described below in FreeBSD article, also uses modified pxeboot images for both x86 and x64 architectures.

1. Modify sys/stand/boot/boot.c


--- sys/stand/boot/boot.c.orig  Fri Nov  5 19:57:56 2010
+++ sys/stand/boot/boot.c       Wed Nov  3 03:28:04 2010
@@ -67,7 +67,7 @@
        devboot(bootdev, cmd.bootdev);
        strlcpy(cmd.image, kernelfile, sizeof(cmd.image));
        cmd.boothowto = 0;
-       cmd.conf = "/etc/boot.conf";
+       cmd.conf = "boot\\x86\\pxelinux\\OpenBSD\\boot.conf";
        cmd.addr = (void *)DEFAULT_KERNEL_ADDRESS;
        cmd.timeout = 5;


2. Build modified pxeboot for i386 architecture:

cd /sys/arch/i386/stand/pxeboot/ && make clean obj pxeboot

3. Copy pxeboot to the appropriate location on the deployment server (RemoteInstall\Boot\x86\pxelinux\OpenBSD)

4. Repeat the process for amd64 architecture; this time specify boot location for x64 architecture in sys/stand/boot/boot.c


--- sys/stand/boot/boot.c.orig  Fri Nov  5 19:57:56 2010
+++ sys/stand/boot/boot.c       Wed Nov  3 03:28:04 2010
@@ -67,7 +67,7 @@
        devboot(bootdev, cmd.bootdev);
        strlcpy(cmd.image, kernelfile, sizeof(cmd.image));
        cmd.boothowto = 0;
-       cmd.conf = "/etc/boot.conf";
+       cmd.conf = "boot\\x64\\pxelinux\\OpenBSD\\boot.conf";
        cmd.addr = (void *)DEFAULT_KERNEL_ADDRESS;
        cmd.timeout = 5;


Note: pxeboot built for i386 architecture will work on amd64 architecture, so there's no need to build it on amd64 platform.

5. After pxeboot files are copied to Boot\x86\pxelinux\OpenBSD and Boot\x64\pxelinux\OpenBSD locations on the deployment server, also copy bsd.rd from the distribution media to OpenBSD folders and create boot.conf file for both architectures:

set RISBoot=H:\RemoteInstall\Boot
for %a in (x86 x64) do <nul (set /p c=boot boot\%a\pxelinux\OpenBSD\bsd.rd)> %RISBoot%\%a\pxelinux\OpenBSD\boot.conf
:: i386 can be installed on x64
cd %RISBoot%\x64\pxelinux\OpenBSD && mklink /J i386 %RISBoot%\x86\pxelinux\OpenBSD


6. Add OpenBSD entries to pxelinux.cfg\default configuration files:
LABEL openbsd
    MENU LABEL OpenBSD/amd64
    PXE OpenBSD\pxeboot

    LABEL openbsd-i386
    MENU LABEL ^OpenBSD/i386
    PXE OpenBSD\i386\pxeboot

No comments:

Post a Comment