#!/bin/zsh
# devfs/start.sh — populate /dev and configure socket protocol modules## Mirrors SMF's system/device/local method (lib/svc/method/devices-local).# devfsadm configures hardware; soconfig loads /etc/sock2path.d into kernel# sockfs so socket(AF_INET, ...) and socket(AF_INET6, ...) actually return# a valid fd. Without soconfig, every socket() of those families fails# EAFNOSUPPORT and ifconfig cannot configure any interface — including lo0.set -e
set -u
# Hardware device configuration. Hammerhead's SMF runs this unconditionally# (upstream illumos only runs it on reconfigure boots, which leaves PCI# NICs unattached on fresh deploys); we follow Hammerhead's convention./usr/sbin/devfsadm
# Force PCI bus enumeration in case devfsadm alone didn't trigger it./usr/bin/ls /devices/pci@0,0/ > /dev/null 2>&1|| true
# Load AF_* → STREAMS-module mappings into the kernel sockfs. THIS is the# step that makes socket(AF_INET, ...) work./sbin/soconfig -d /etc/sock2path.d
# Refresh kernel driver.conf cache./usr/sbin/devfsadm -I
exit 0