[Midnightbsd-cvs] src [11626] trunk/etc/devd: add apple and zfs configs

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jul 8 12:52:07 EDT 2018


Revision: 11626
          http://svnweb.midnightbsd.org/src/?rev=11626
Author:   laffer1
Date:     2018-07-08 12:52:06 -0400 (Sun, 08 Jul 2018)
Log Message:
-----------
add apple and zfs configs

Added Paths:
-----------
    trunk/etc/devd/apple.conf
    trunk/etc/devd/hyperv.conf
    trunk/etc/devd/zfs.conf

Added: trunk/etc/devd/apple.conf
===================================================================
--- trunk/etc/devd/apple.conf	                        (rev 0)
+++ trunk/etc/devd/apple.conf	2018-07-08 16:52:06 UTC (rev 11626)
@@ -0,0 +1,74 @@
+# $MidnightBSD$
+#
+# PowerPC Apple specific devd events
+
+# Keyboard power key
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"Button";
+	action			"shutdown -p now";
+};
+
+
+# PowerBook and iBook lid close.
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"lid";
+	match "type"		"close";
+	action			"shutdown -p now";
+};
+
+
+# The next blocks enable brightness hotkeys that can be found on Apple laptops
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"keys";
+	match "type"		"brightness";
+	match "notify"		"down";
+	action			"sysctl dev.backlight.0.level=\
+		$(expr `sysctl -n dev.backlight.0.level` - 10)";
+};
+
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"keys";
+	match "type"		"brightness";
+	match "notify"		"up";
+	action			"sysctl dev.backlight.0.level=\
+		$(expr `sysctl -n dev.backlight.0.level` + 10)";
+};
+
+
+# The next blocks enable volume hotkeys that can be found on Apple laptops
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"keys";
+	match "type"		"mute";
+	action			"mixer 0";
+};
+
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"keys";
+	match "type"		"volume";
+	match "notify"		"down";
+	action			"mixer vol -10";
+};
+
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"keys";
+	match "type"		"volume";
+	match "notify"		"up";
+	action			"mixer vol +10";
+};
+
+# Eject key
+notify 0 {
+	match "system"		"PMU";
+	match "subsystem"	"keys";
+	match "type"		"eject";
+	action			"camcontrol eject cd0";
+};
+
+


Property changes on: trunk/etc/devd/apple.conf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/etc/devd/hyperv.conf
===================================================================
--- trunk/etc/devd/hyperv.conf	                        (rev 0)
+++ trunk/etc/devd/hyperv.conf	2018-07-08 16:52:06 UTC (rev 11626)
@@ -0,0 +1,109 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/etc/devd/hyperv.conf 322129 2017-08-07 02:15:13Z sephe $
+#
+# Hyper-V specific events
+
+notify 10 {
+	match "system"		"DEVFS";
+	match "subsystem"	"CDEV";
+	match "type"		"CREATE";
+	match "cdev"		"hv_kvp_dev";
+	action "/usr/sbin/hv_kvp_daemon";
+};
+
+notify 10 {
+	match "system"		"DEVFS";
+	match "subsystem"	"CDEV";
+	match "type"		"DESTROY";
+	match "cdev"		"hv_kvp_dev";
+	action "pkill -x hv_kvp_daemon";
+};
+
+notify 11 {
+	match "system"		"DEVFS";
+	match "subsystem"	"CDEV";
+	match "type"		"CREATE";
+	match "cdev"		"hv_fsvss_dev";
+	action "/usr/sbin/hv_vss_daemon";
+};
+
+notify 11 {
+	match "system"		"DEVFS";
+	match "subsystem"	"CDEV";
+	match "type"		"DESTROY";
+	match "cdev"		"hv_fsvss_dev";
+	action "pkill -x hv_vss_daemon";
+};
+
+#
+# Rules for non-transparent network VF.
+#
+# How network VF works with hn(4) on Hyper-V in non-transparent mode:
+#
+# - Each network VF has a cooresponding hn(4).
+# - The network VF and the it's cooresponding hn(4) have the same hardware
+#   address.
+# - Once the network VF is up, e.g. ifconfig VF up:
+#   o  All of the transmission should go through the network VF.
+#   o  Most of the reception goes through the network VF.
+#   o  Small amount of reception may go through the cooresponding hn(4).
+#      This reception will happen, even if the the cooresponding hn(4) is
+#      down.  The cooresponding hn(4) will change the reception interface
+#      to the network VF, so that network layer and application layer will
+#      be tricked into thinking that these packets were received by the
+#      network VF.
+#   o  The cooresponding hn(4) pretends the physical link is down.
+# - Once the network VF is down or detached:
+#   o  All of the transmission should go through the cooresponding hn(4).
+#   o  All of the reception goes through the cooresponding hn(4).
+#   o  The cooresponding hn(4) fallbacks to the original physical link
+#      detection logic.
+#
+# All these features are mainly used to help live migration, during which
+# the network VF will be detached, while the network communication to the
+# VM must not be cut off.  In order to reach this level of live migration
+# transparency, we use failover mode lagg(4) with the network VF and the
+# cooresponding hn(4) attached to it.
+#
+# To ease user configuration for both network VF and non-network VF, the
+# lagg(4) will be created by the following rules, and the configuration
+# of the cooresponding hn(4) will be applied to the lagg(4) automatically.
+#
+# NOTE:
+# If live migration is not needed at all, the following rules could be
+# commented out, and the network VF interface could be used exclusively.
+# Most often the cooresponding hn(4) could be completely ignored.
+#
+#
+# Default workflow for the network VF bringup:
+# 1) ETHERNET/IFATTACH -> VF interface up (delayed by rc.conf hyperv_vf_delay
+#    seconds).  This operation will trigger HYPERV_NIC_VF/VF_UP.
+# 2) HYPERV_NIC_VF/VF_UP:
+#    a) Create laggX coresponding to hnX.
+#    b) Add hnX and VF to laggX.
+#    c) Whack all previous network configuration on hnX, including stopping
+#       dhclient.
+#    d) Apply rc.conf ifconfig_hnX to laggX; i.e. including starting dhclient.
+#
+# NOTE:
+# HYPERV_NIC_VF/VF_UP action script could be customized per-interface by
+# adding /usr/libexec/hyperv/hyperv_vfup.hnX script.
+# /usr/libexec/hyperv/hyperv_vfup could be used as the template for the
+# customized per-interface script.
+#
+# NOTE:
+# For transparent network VF, hyperv_vfattach does nothing and
+# HYPERV_NIC_VF/VF_UP will not be triggered at all.
+#
+
+notify 10 {
+	match "system"		"HYPERV_NIC_VF";
+	match "type"		"VF_UP";
+	action "/usr/libexec/hyperv/hyperv_vfup $subsystem";
+};
+
+notify 10 {
+	match "system"		"ETHERNET";
+	match "type"		"IFATTACH";
+	action "/usr/libexec/hyperv/hyperv_vfattach $subsystem 0";
+};


Property changes on: trunk/etc/devd/hyperv.conf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/etc/devd/zfs.conf
===================================================================
--- trunk/etc/devd/zfs.conf	                        (rev 0)
+++ trunk/etc/devd/zfs.conf	2018-07-08 16:52:06 UTC (rev 11626)
@@ -0,0 +1,77 @@
+# $MidnightBSD$
+#
+# Sample ZFS problem reports handling.
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.checksum";
+	action "logger -p local7.warn -t ZFS 'checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.io";
+	action "logger -p local7.warn -t ZFS 'vdev I/O failure, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size error=$zio_err'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.data";
+	action "logger -p local7.warn -t ZFS 'pool I/O failure, zpool=$pool error=$zio_err'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.zpool";
+	action "logger -p local7.err -t ZFS 'failed to load zpool $pool'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.vdev\..*";
+	action "logger -p local7.err -t ZFS 'vdev problem, zpool=$pool path=$vdev_path type=$type'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.io_failure";
+	action "logger -p local7.alert -t ZFS 'catastrophic pool I/O failure, zpool=$pool'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.probe_failure";
+	action "logger -p local7.err -t ZFS 'vdev probe failure, zpool=$pool path=$vdev_path'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.log_replay";
+	action "logger -p local7.err -t ZFS 'pool log replay failure, zpool=$pool'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"fs.zfs.config_cache_write";
+	action "logger -p local7.warn -t ZFS 'failed to write zpool.cache, zpool=$pool'";
+};
+
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"resource.fs.zfs.removed";
+	action "logger -p local7.notice -t ZFS 'vdev is removed, pool_guid=$pool_guid vdev_guid=$vdev_guid'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"resource.fs.zfs.autoreplace";
+	action "logger -p local7.info -t ZFS 'autoreplace is configured for vdev, pool_guid=$pool_guid vdev_guid=$vdev_guid'";
+};
+
+notify 10 {
+	match "system"		"ZFS";
+	match "type"		"resource.fs.zfs.statechange";
+	action "logger -p local7.notice -t ZFS 'vdev state changed, pool_guid=$pool_guid vdev_guid=$vdev_guid'";
+};
+


Property changes on: trunk/etc/devd/zfs.conf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list