forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
strip out some mac os specific stuff
- Loading branch information
Showing
150 changed files
with
9,564 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build on macOS | ||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
#- name: csrutil disable | ||
# run: | | ||
# sudo csrutil disable | ||
#- name: csrutil enable | ||
# run: | | ||
# sudo csrutil enable --without kext | ||
#- name: spctl kext-consent disable | ||
# run: | | ||
# sudo spctl kext-consent disable | ||
- name: install deps | ||
run: | | ||
brew install automake libtool gawk coreutils | ||
- name: install deps | ||
run: | | ||
#brew install openssl@3 | ||
- name: autogen | ||
run: | | ||
./autogen.sh | ||
- name: configure | ||
run: | | ||
#https://stackoverflow.com/a/62591864 | ||
./configure CPPFLAGS="-I/usr/local/opt/gettext/include -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/gettext/lib/ -L/usr/local/opt/openssl/lib" | ||
- name: build | ||
run: | | ||
make -j 2 | ||
#- name: install | ||
# run: | | ||
# sudo make install DESTDIR=/// | ||
|
||
#- name: load | ||
# run: | | ||
# sudo kextload -v /Library/Extensions/zfs.kext | ||
|
||
#- name: ls | ||
# run: | | ||
# sudo ls -Rla | ||
# ls -Rla | ||
#- name: rsync | ||
# run: | | ||
# rsync -avx --exclude /out/ ${{github.workspace}}/ ${{github.workspace}}/out/ --no-links | ||
#- name: Upload dev build | ||
# uses: actions/[email protected] | ||
# with: | ||
# name: dev_build | ||
# path: ${{github.workspace}}/out/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
include $(srcdir)/%D%/macos/Makefile.am |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2154 | ||
# | ||
# Helper to mount and unmount snapshots when asked to by kernel. | ||
# | ||
# Mostly used in macOS. | ||
# | ||
set -ef | ||
|
||
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc" | ||
. "${ZED_ZEDLET_DIR}/zed-functions.sh" | ||
|
||
[ -n "${ZEVENT_SNAPSHOT_NAME}" ] || exit 1 | ||
[ -n "${ZEVENT_SUBCLASS}" ] || exit 2 | ||
|
||
if [ "${ZEVENT_SUBCLASS}" = "snapshot_mount" ]; then | ||
action="mount" | ||
elif [ "${ZEVENT_SUBCLASS}" = "snapshot_unmount" ]; then | ||
action="unmount" | ||
else | ||
zed_log_err "unsupported event class \"${ZEVENT_SUBCLASS}\"" | ||
exit 3 | ||
fi | ||
|
||
zed_exit_if_ignoring_this_event | ||
zed_check_cmd "${ZFS}" || exit 4 | ||
|
||
"${ZFS}" "${action}" "${ZEVENT_SNAPSHOT_NAME}" | ||
|
||
finished |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
snapshot_mount.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2154 | ||
# | ||
# Log the zevent via syslog. | ||
# | ||
|
||
# Given POOL and DATASET name for ZVOL | ||
# DEVICE_NAME for /dev/disk* | ||
# RAW_DEVICE_NAME for /dev/rdisk* | ||
# Create symlink in | ||
# /var/run/zfs/zvol/dsk/POOL/DATASET -> /dev/disk* | ||
# /var/run/zfs/zvol/rdsk/POOL/DATASET -> /dev/rdisk* | ||
|
||
ZVOL_ROOT="/var/run/zfs/zvol" | ||
|
||
mkdir -p "$(dirname "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" "$(dirname "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" | ||
|
||
# Remove them if they already exist. (ln -f is not portable) | ||
rm -f "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
|
||
ln -s "/dev/${ZEVENT_DEVICE_NAME}" "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
ln -s "/dev/${ZEVENT_RAW_NAME}" "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
|
||
logger -t "${ZED_SYSLOG_TAG:=zed}" -p "${ZED_SYSLOG_PRIORITY:=daemon.notice}" \ | ||
eid="${ZEVENT_EID}" class="${ZEVENT_SUBCLASS}" \ | ||
"${ZEVENT_POOL:+pool=$ZEVENT_POOL}/${ZEVENT_VOLUME} symlinked ${ZEVENT_DEVICE_NAME}" | ||
|
||
echo 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2154 | ||
# | ||
# Log the zevent via syslog. | ||
# | ||
|
||
# Given POOL and DATASET name for ZVOL | ||
# DEVICE_NAME for /dev/disk* | ||
# RAW_DEVICE_NAME for /dev/rdisk* | ||
# Create symlink in | ||
# /var/run/zfs/zvol/dsk/POOL/DATASET -> /dev/disk* | ||
# /var/run/zfs/zvol/rdsk/POOL/DATASET -> /dev/rdisk* | ||
|
||
ZVOL_ROOT="/var/run/zfs/zvol" | ||
|
||
rm -f "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
rmdir "$(dirname "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" "$(dirname "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" | ||
|
||
logger -t "${ZED_SYSLOG_TAG:=zed}" -p "${ZED_SYSLOG_PRIORITY:=daemon.notice}" \ | ||
eid="${ZEVENT_EID}" class="${ZEVENT_SUBCLASS}" \ | ||
"${ZEVENT_POOL:+pool=$ZEVENT_POOL}/${ZEVENT_VOLUME} removed symlink" | ||
|
||
echo 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.