#!/bin/sh

symlink_action() {
	case "$ACTION" in
		add) ln -sf "$1" "$2";;
		remove) rm -f "$2";;
	esac
}

clock_name=$(cat ${SYSFS:-/sys}/class/ptp/$MDEV/clock_name 2>/dev/null | sed -e 's/ /_/g')
case "$clock_name" in
	KVM_virtual_PTP)	symlink_action $MDEV ptp_kvm ;;
	ptp_vmw)		symlink_action $MDEV ptp_vmw ;;
	hyperv)			symlink_action $MDEV ptp_hyperv ;;
esac
