xref: /freebsd/sys/contrib/openzfs/scripts/dkms.postbuild (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
1#!/bin/sh
2
3PROG=$0
4
5while getopts "a:k:n:t:v:" opt; do
6	case $opt in
7		a) arch=$OPTARG    ;;
8		k) kver=$OPTARG    ;;
9		n) pkgname=$OPTARG ;;
10		t) tree=$OPTARG    ;;
11		v) pkgver=$OPTARG  ;;
12		*) err=1           ;;
13	esac
14done
15
16if [ -z "${arch}" ] || [ -z "${kver}" ] || [ -z "${pkgname}" ] || \
17    [ -z "${tree}" ] || [ -z "${pkgver}" ] || [ -n "${err}" ]; then
18	echo "Usage: $PROG -a <arch> -k <kver> -n <pkgname>" \
19	    "-t <tree> -v <pkgver>"
20	exit 1
21fi
22
23exec cp "${tree}/${pkgname}/${pkgver}/build/zfs_config.h"     \
24   "${tree}/${pkgname}/${pkgver}/build/module/Module.symvers" \
25   "${tree}/${pkgname}/${pkgver}/${kver}/${arch}/"
26