opnsense-src/sys
Marius Strobl 2d75b8321f Add initial support for booting from ZFS on sparc64. At least on Sun Fire
V100, the firmware is known to be broken and not allowing to simultaneously
open disk devices, causing attempts to boot from a mirror or RAIDZ to cause
a crash. This will be worked around later. The firmwares of newer sun4u models
don't seem to exhibit this problem though.

Steps for ZFS booting:

1. create VTOC8 label
# gpart create -s vtoc8 da0

2. add partitions, f.e.:
# gpart add -t freebsd-zfs -s 60g da0
# gpart add -t freebsd-swap da0
resulting in something like:
# gpart show
=>        0  143331930  da0  VTOC8  (68G)
          0  125821080    1  freebsd-zfs  (60G)
  125821080   17510850    2  freebsd-swap  (8.4G)

3. create zpool
# zpool create bunker da0a
or for mirror/RAIDZ (after preparing additional disks as in steps 1. + 2.):
# zpool create bunker mirror da0a da1a
# zpool create bunker raidz da0a da1a da2a ...

4. set bootfs
# zpool set bootfs=bunker bunker

5. install zfsboot
# zpool export bunker
# gpart bootcode -p /boot/zfsboot da0

6. write zfsloader to the ZFS Boot Block (so far, there's no dedicated tool
for this, so dd(1) has to be used for this purpose)
When using mirror/RAIDZ, step 4. and the dd(1) invocation should be repeated
for the additional disks in order to be able to boot from another disk in
case of failure.
# sysctl kern.geom.debugflags=0x10
# dd if=/boot/zfsloader of=/dev/da0a bs=512 oseek=1024 conv=notrunc
# zpool import bunker

7. install system on ZFS filesystem
Don't forget to set 'zfs_load="YES"' and vfs.root.mountfrom="zfs:bunker" in
loader.conf as well as 'zfs_enable="YES"'in rc.conf.

8. copy zpool.cache to the ZFS filesystem
cp -p /boot/zfs/zpool.cache /bunker/boot/zfs/zpool.cache

9. set mountpoint
# zfs set mountpoint=/ bunker

10. Now, given that aliases for all disks in the zpool exists (check with
the `devalias` command on the boot monitor prompt) and disk0 corresponds
to da0 (likewise for additional disks), the system can be booted from the
ZFS with:
{1} ok boot disk0

PR:             165025
Submitted by:   Gavin Mu
2012-05-01 17:16:01 +00:00
..
amd64 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
arm Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
boot Add initial support for booting from ZFS on sparc64. At least on Sun Fire 2012-05-01 17:16:01 +00:00
bsm Add ECAPMODE, "Not permitted in capability mode", a new kernel errno 2011-03-01 13:14:28 +00:00
cam Add support for: 2012-04-29 22:28:15 +00:00
cddl Partially revert r232938; ZFS only requires nfs4 but not posix1e. 2012-04-29 16:21:47 +00:00
compat - Implement pipe2 syscall for Linuxulator. This syscall appeared in 2.6.27 2012-04-16 21:22:02 +00:00
conf Break out the arge MDIO bus code into an optional argemdio device. 2012-05-01 06:18:30 +00:00
contrib Move several enums and structures required for L2 filtering from ip_fw_private.h to ip_fw.h. 2012-04-30 10:22:23 +00:00
crypto Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
ddb Update the ddb and gdb backends for the new 'trace_thread' hook. 2012-04-12 21:34:58 +00:00
dev Change the MIB cycle count API to return HAL_BOOL, rather than uint32_t, 2012-05-01 14:48:51 +00:00
fs - fixed a vnode lock hang-up issue. 2012-05-01 07:46:30 +00:00
gdb Update the ddb and gdb backends for the new 'trace_thread' hook. 2012-04-12 21:34:58 +00:00
geom Implement volume deletion if disk has more then one partition. 2012-05-01 09:21:21 +00:00
gnu/fs Remove unused thread argument to vrecycle(). 2012-04-23 14:10:34 +00:00
i386 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
ia64 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
isa - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
kern Allow for the process information sysctls to accept a thread id in addition 2012-04-23 20:56:05 +00:00
kgssapi Add missing break statement to make sure all 3DES etypes really are treated 2011-10-10 09:13:07 +00:00
libkern Remove second consts in r233288 in order to appease C++ compilers. 2012-03-26 18:22:04 +00:00
mips Convert AP96 to use the mdioproxy and ARGE_MDIO option. 2012-05-01 06:21:02 +00:00
modules Fix make depend. 2012-05-01 07:38:40 +00:00
net Move several enums and structures required for L2 filtering from ip_fw_private.h to ip_fw.h. 2012-04-30 10:22:23 +00:00
net80211 Update HWMP Proactive code and mesh route flags. 2012-05-01 16:18:38 +00:00
netatalk Fix typos 2012-02-28 15:07:05 +00:00
netgraph Fix panic in ng_patch(4) caused by checksum flags being added to mbuf flags. 2012-04-22 17:00:52 +00:00
netinet Move several enums and structures required for L2 filtering from ip_fw_private.h to ip_fw.h. 2012-04-30 10:22:23 +00:00
netinet6 in6_pcblookup_local() still can return a pcb with NULL 2012-03-21 08:43:38 +00:00
netipsec Add multi-FIB IPv6 support to the core network stack supplementing 2012-02-03 13:08:44 +00:00
netipx Convert all users of IF_ADDR_LOCK to use new locking macros that specify 2012-01-05 19:00:36 +00:00
netnatm
netncp Change ncp_scan_bindery_object() to pass a constant search string. 2011-10-16 08:44:03 +00:00
netsmb Add unicode support to msdosfs and smbfs; original pathes from imura, 2011-11-18 03:05:20 +00:00
nfs Add multi-FIB IPv6 support to the core network stack supplementing 2012-02-03 13:08:44 +00:00
nfsclient Remove unused thread argument from vtruncbuf(). 2012-04-23 13:21:28 +00:00
nfsserver Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0, 2011-12-15 02:26:53 +00:00
nlm jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011 2012-01-31 02:11:05 +00:00
ofed Move several enums and structures required for L2 filtering from ip_fw_private.h to ip_fw.h. 2012-04-30 10:22:23 +00:00
opencrypto Add the fo_chown and fo_chmod methods to struct fileops and use them 2011-08-16 20:07:47 +00:00
pc98 Clean up the intr* MD KPI from the SMP dependency, removing a cause of 2012-04-26 20:24:25 +00:00
pci intpm: add ATI IXP400 pci id 2012-04-16 10:33:46 +00:00
powerpc Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
rpc Both a crash reported on freebsd-current on Oct. 18 under the 2011-11-03 14:38:03 +00:00
security When allocation of labels on files is implicitly disabled due to MAC 2012-04-08 11:01:49 +00:00
sparc64 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
sys Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
teken Link the demo application against ncursesw to make Unicode work. 2011-10-13 14:20:27 +00:00
tools Make vnode_if.awk parse vnode operations with underscores, like VOP_FOO_BAR. 2012-02-21 19:35:59 +00:00
ufs Remove unused thread argument from ufs_extattr_uepm_lock()/ufs_extattr_uepm_unlock(). 2012-04-23 17:56:35 +00:00
vm Avoid a lock order reversal in pmap_extract_and_hold() from relocking 2012-04-22 17:58:30 +00:00
x86 Clean up the intr* MD KPI from the SMP dependency, removing a cause of 2012-04-26 20:24:25 +00:00
xdr
xen blkif interface comment cleanups. No functional changes 2012-02-29 17:47:01 +00:00
Makefile Add sys/ofed to the 'make cscope' target. 2012-03-20 18:05:15 +00:00