11.1Sroy#/bin/sh 21.1Sroy# 31.5Sroy# $NetBSD: zfsroot.rc,v 1.5 2020/04/14 12:14:59 roy Exp $ 41.2Sroy 51.4Sroy# Assumption - boot.cfg loads this ramdisk. 61.4Sroy# Assumption - The needed kernel modules: solaris and zfs; are either on this 71.4Sroy# ramdisk OR loaded by boot.cfg. 81.4Sroy# Finding the correct dev node to mount to get them is too magic. 91.4Sroy# NetBSD cannot build and distribute a kernel with ZFS builtin. 101.4Sroy# Assumption - the root pool is set to legacy mount. 111.1Sroy 121.1Sroy# Configurable - define the ZFS root pool and ROOT. 131.1Sroy# XXX Can these be set in boot.cfg? 141.1Sroyrpool=rpool 151.1Sroyrroot=ROOT 161.1Sroy 171.1Sroy# Setup some stuff incase things go south and we drop to the shell 181.1Sroyexport HOME=/ 191.1Sroyexport PATH=/sbin:/bin:/usr/sbin:/usr/bin 201.1Sroyumask 022 211.1Sroy 221.2Sroyecho "Importing $rpool" 231.2Sroy/sbin/zpool import -f -N "$rpool" 241.2Sroy 251.2Sroyecho "Mounting $rpool/$rroot to /altroot" 261.2Sroy/sbin/mount -t zfs "$rpool/$rroot" /altroot; 271.2Sroy 281.2Sroy/sbin/sysctl -w init.root=/altroot 29