Network boot - n-hys/illumos-gate GitHub Wiki

Network boot

Introduction

The boot sequence is as follows:

  1. The firmware loads inetboot from a TFTP server. (QEMU will load inetboot directly).
  2. The inetboot loads boot_archive from a NFS server.
  3. The inetboot loads unix (kernel file) from boot_archive.
  4. Jump to the entry of unix.

To boot from the network, you need to configure DHCP, TFTP, and NFS servers.

Setting up a DHCP Server

The configuration of Vendor Class Identifier is required.

HW Vendor Class Identifier
AlphaPC 164LX SUNW.pc164lx
ODROID-C2 SUNW.meson-gxbb
Raspberry Pi 4B SUNW.rpi4
QEMU virt SUNW.virt
HiFive Unleashed SUNW.HiFive-Unleashed
Allwinner D1 Nezha SUNW.sun20i

Example configuration for the ISC DHCP Server.

/etc/dhcpd.conf
option space SUNW;
option SUNW.root-mount-options code 1 = text;
option SUNW.root-server-ip-address code 2 = ip-address;
option SUNW.root-server-hostname code 3 = text;
option SUNW.root-path-name code 4 = text;
option SUNW.swap-server-ip-address code 5 = ip-address;
option SUNW.swap-file-path code 6 = text;
option SUNW.boot-file-path code 7 = text;
option SUNW.posix-timezone-string code 8 = text;
option SUNW.boot-read-size code 9 = unsigned integer 16;
option SUNW.install-server-ip-address code 10 = ip-address;
option SUNW.install-server-hostname code 11 = text;
option SUNW.install-path code 12 = text;
option SUNW.sysid-config-file-server code 13 = text;
option SUNW.JumpStart-server code 14 = text;
option SUNW.terminal-name code 15 = text;
option SUNW.standalone-boot-uri code 16 = text;
option SUNW.standalone-boot-http-proxy code 17 = text;

subnet 192.168.0.0 netmask 255.255.255.0 {
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.0.255;
    #option routers 192.168.0.1;
    #option domain-name-servers 192.168.0.1;
    option domain-name "example.com";
    default-lease-time 14400;
    max-lease-time 172800;

    vendor-option-space SUNW;
    option SUNW.root-mount-options "rsize=32768";
    option SUNW.root-server-hostname "develop";
    option SUNW.root-server-ip-address 192.168.0.34;
    next-server 192.168.0.34;

    group { # id="Solaris-Alpha"
        option SUNW.root-path-name "/data/proto/root_alpha";
        host pc164lx {
            option vendor-class-identifier "SUNW.pc164lx";
            option host-name "pc164lx";
            filename "/root_alpha/platform/SUNW,pc164lx/inetboot";
            fixed-address 192.168.0.51;
            hardware ethernet 00:90:27:57:71:ac;
        }
    }

    group { # id="Solaris-ARMv8"
        option SUNW.root-path-name "/data/proto/root_aarch64";
        host virt-a64 {
            option vendor-class-identifier "SUNW.virt";
            option host-name "virt-a64";
            filename "/root_aarch64/platform/SUNW,virt/inetboot";
            fixed-address 192.168.0.52;
            hardware ethernet 52:54:00:70:0a:e4;
        }
        host meson {
            option host-name "meson";
            option vendor-class-identifier "SUNW.meson-gxbb";
            filename "/root_aarch64/platform/SUNW,meson-gxbb/inetboot";
            fixed-address 192.168.0.53;
            hardware ethernet 00:1e:06:33:77:91;
        }
    }

    group { # id="Solaris-RISC-V"
        option SUNW.root-path-name "/data/proto/root_riscv64";
        host virt-rv64 {
            option vendor-class-identifier "SUNW.virt";
            option host-name "virt-rv64";
            filename "/root_riscv64/platform/SUNW,virt/inetboot";
            fixed-address 192.168.0.54;
            hardware ethernet 52:54:00:70:0a:e3;
        }
        host unleashed {
            option vendor-class-identifier "SUNW.HiFive-Unleashed";
            option host-name "unleashed";
            filename "/root_riscv64/platform/SUNW,HiFive-Unleashed/inetboot";
            fixed-address 192.168.0.55;
            hardware ethernet 70:b3:d5:92:f0:95;
        }
    }
}

Setting up a TFTP Server

You need to change the tftp server directory to /data/proto.
Configure TFTP_DIRECTORY in /etc/sysconfig/tftp when using openSUSE 15.3.

Setting up a NFS Server

Configure a NFSv3 Server.
The permission of root access to NFS is required.
The following is a example of /etc/exports.

/data/proto/root_aarch64        *(rw,no_root_squash,insecure,sync,no_subtree_check)
/data/proto/root_alpha          *(rw,no_root_squash,insecure,sync,no_subtree_check)
/data/proto/root_riscv64        *(rw,no_root_squash,insecure,sync,no_subtree_check)

Boot message example

When booting from network, some errors occurr but you can ignore errors.
You can login as root without using password.

boot.log
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(debug):v2.2-1315-g06cea2c63
NOTICE:  BL1: Built : 20:52:20, Jan 11 2021
INFO:    BL1: RAM 0xe04e000 - 0xe056000
WARNING: BL1: cortex_a53: CPU workaround for 835769 was missing!
WARNING: BL1: cortex_a53: CPU workaround for 843419 was missing!
WARNING: BL1: cortex_a53: CPU workaround for 855873 was missing!
INFO:    BL1: Loading BL2
INFO:    Loading image id=1 at address 0xe01b000
INFO:    Image id=1 loaded: 0xe01b000 - 0xe0231e1
NOTICE:  BL1: Booting BL2
INFO:    Entry point address = 0xe01b000
INFO:    SPSR = 0x3c5
NOTICE:  BL2: v2.3(debug):v2.2-1315-g06cea2c63
NOTICE:  BL2: Built : 20:52:20, Jan 11 2021
INFO:    BL2: Doing platform setup
INFO:    BL2: Loading image id 3
INFO:    Loading image id=3 at address 0xe040000
INFO:    Image id=3 loaded: 0xe040000 - 0xe04a084
INFO:    BL2: Skip loading image id 5
NOTICE:  BL1: Booting BL31
INFO:    Entry point address = 0xe040000
INFO:    SPSR = 0x3cd
NOTICE:  BL31: v2.3(debug):v2.2-1315-g06cea2c63
NOTICE:  BL31: Built : 20:52:20, Jan 11 2021
INFO:    ARM GICv2 driver initialized
INFO:    BL31: Initializing runtime services
WARNING: BL31: cortex_a53: CPU workaround for 835769 was missing!
WARNING: BL31: cortex_a53: CPU workaround for 843419 was missing!
WARNING: BL31: cortex_a53: CPU workaround for 855873 was missing!
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x40100000
INFO:    SPSR = 0x3c5
phys memory add 0000000040000000 - 000000013fffffff
add io 9040000 1000 for arm,pl011
add io 9000000 1000 for arm,pl011
add io 9010000 1000 for arm,pl031
add io 8000000 10000 for arm,cortex-a15-gic
add io 8010000 10000 for arm,cortex-a15-gic
add io a000000 1000 for virtio,mmio
add io a001000 1000 for virtio,mmio
add io a002000 1000 for virtio,mmio
add io a003000 1000 for virtio,mmio
bootargs=-D /virtio_mmio@a003e00
bootpath=/virtio_mmio@a003e00
bpath=/virtio_mmio@a003e00
vdev_probe error
rootnex_map_regspec: a003e00 -> ffff00000a003e00
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 9000000 -> ffff000009000000
cpu0: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu0: QEMU VIRT CPU
cpu1: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu1: QEMU VIRT CPU
cpu1 initialization complete - online
cpu2: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu2: QEMU VIRT CPU
cpu2 initialization complete - online
cpu3: ARM 64bit MIDR=410fd034 REVIDR=00000000
cpu3: QEMU VIRT CPU
cpu3 initialization complete - online
Loading smf(5) service descriptions: 138/138
ERROR: svc:/system/filesystem/usr:default failed to mount remount  (see 'svcs -x' for details)
Jul 26 10:16:34 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed with exit status 95.
Jul 26 10:16:34 svc.startd[100003]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Hostname: virt-a64
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Enter user name for system maintenance (control-d to bypass): 
⚠️ **GitHub.com Fallback** ⚠️