Skip to content

Commit

Permalink
Merge pull request #214 from truenas/truenas/zfs-2.3-staging
Browse files Browse the repository at this point in the history
Early zfs-2.3 for SCALE 24.10
  • Loading branch information
ixhamza authored Feb 29, 2024
2 parents 8f2f6cd + f27da86 commit 34be70e
Show file tree
Hide file tree
Showing 80 changed files with 6,189 additions and 143 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on: [push]

jobs:
build-native-deb:
runs-on: ubuntu-22.04
container:
image: debian:testing
steps:
- name: Installing Dependencies
run: |
apt update > /dev/null 2>&1
apt install -y linux-image-amd64 linux-headers-amd64 debhelper-compat devscripts > /dev/null 2>&1
- name: Checkout
uses: actions/checkout@v2

- name: Build deb package
run: |
mk-build-deps --build-dep contrib/debian/control
apt install -y ./*.deb
sh autogen.sh
./configure
cp -a contrib/debian debian
sed 's/@CFGOPTS@/--enable-debuginfo/g' debian/rules.in > debian/rules
chmod +x debian/rules
dch -b -M --force-distribution --distribution bullseye-truenas-unstable 'Tagged from zfs CI'
debuild -us -uc -b
debian/rules override_dh_binary-modules
- name: Create artifacts dir
run: mkdir artifacts
if: success()

- name: Move artifacts
run: mv ../*.deb artifacts
if: success()

- uses: actions/upload-artifact@v1
with:
name: zfs-native
path: artifacts
if: success()
28 changes: 28 additions & 0 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build_image

on:
push:
branches:
- 'truenas/zfs-2.3-release'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ixsystems/zfs:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2 changes: 0 additions & 2 deletions .github/workflows/scripts/generate-summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ ERRLOGS=0
if [ ! -f Summary/Summary.md ]; then
# first call, we do the default summary (~500k)
echo -n > Summary.md
summarize_s "Sanity Tests Ubuntu 20.04" Logs-20.04-sanity
summarize_s "Sanity Tests Ubuntu 22.04" Logs-22.04-sanity
summarize_f "Functional Tests Ubuntu 20.04" Logs-20.04-functional
summarize_f "Functional Tests Ubuntu 22.04" Logs-22.04-functional

cat Summary.md >> $GITHUB_STEP_SUMMARY
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zfs-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [20.04, 22.04]
os: [22.04]
runs-on: ubuntu-${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [20.04, 22.04]
os: [22.04]
needs: build
uses: ./.github/workflows/zfs-linux-tests.yml
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
!configure.ac
!copy-builtin
!COPYRIGHT
!Dockerfile
!LICENSE
!Makefile.am
!META
Expand Down Expand Up @@ -84,6 +85,8 @@ modules.order
Makefile
Makefile.in
changelog
nfs41acl.h
nfs41acl_xdr.c
*.patch
*.orig
*.tmp
Expand Down
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM debian:bullseye-slim

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update

RUN apt-get install -y \
debhelper-compat \
devscripts

ENV WORK_DIR /zfs_app/zfs
WORKDIR ${WORK_DIR}

ADD . ${WORK_DIR}/

RUN mk-build-deps --build-dep contrib/debian/control
RUN apt install -y ./*.deb
RUN sh autogen.sh
RUN ./configure
RUN cp -a contrib/debian debian
RUN sed 's/@CFGOPTS@/--enable-debuginfo/g' debian/rules.in > debian/rules
RUN chmod +x debian/rules
RUN dch -b -M --force-distribution --distribution bullseye-truenas-unstable "Tagged from ixsystems/zfs CI"
RUN debuild -us -uc -b
RUN rm ../openzfs-zfs-dracut_*.deb
RUN rm ../openzfs-zfs-initramfs_*.deb
RUN apt-get install -y ../*.deb
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ cstyle_line = -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} +
endif
CHECKS += cstyle
cstyle:
$(AM_V_at)find $(top_srcdir) -name build -prune \
$(AM_V_at)find $(top_srcdir) -name build -prune -o -name zfsd -prune \
-o -type f -name '*.[hc]' \
! -name 'zfs_config.*' ! -name '*.mod.c' \
! -name 'nfs41acl_xdr.c' ! -name 'nfs41acl.h' \
! -name 'opt_global.h' ! -name '*_if*.h' \
! -name 'zstd_compat_wrapper.h' \
! -path './module/zstd/lib/*' \
Expand Down
3 changes: 3 additions & 0 deletions cmd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ include $(srcdir)/%D%/zpool/Makefile.am
include $(srcdir)/%D%/zpool_influxdb/Makefile.am
include $(srcdir)/%D%/zstream/Makefile.am

if BUILD_FREEBSD
include $(srcdir)/%D%/zfsd/Makefile.am
endif

if BUILD_LINUX
mounthelper_PROGRAMS += mount.zfs
Expand Down
9 changes: 6 additions & 3 deletions cmd/zed/agents/zfs_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH);
(void) nvlist_lookup_string(vdev, ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH,
&enc_sysfs_path);

#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk);
#endif
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_OFFLINE, &offline);
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_FAULTED, &faulted);

Expand Down Expand Up @@ -1040,7 +1041,9 @@ vdev_whole_disk_from_config(zpool_handle_t *zhp, const char *vdev_path)
if (!nvl)
return (0);

#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk);
#endif

return (wholedisk);
}
Expand Down Expand Up @@ -1088,10 +1091,10 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
zpool_close(zhp);
return (0);
}

#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
&wholedisk);

#endif
if (wholedisk) {
char *tmp;
path = strrchr(path, '/');
Expand Down
1 change: 1 addition & 0 deletions cmd/zfsd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/zfsd
25 changes: 25 additions & 0 deletions cmd/zfsd/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
zfsd_CFLAGS = $(AM_CFLAGS)
zfsd_CXXFLAGS = $(AM_CXXFLAGS)
zfsd_CPPFLAGS = $(AM_CPPFLAGS)

sbin_PROGRAMS += zfsd

zfsd_SOURCES = \
%D%/callout.cc \
%D%/case_file.cc \
%D%/vdev.cc \
%D%/vdev_iterator.cc \
%D%/zfsd.cc \
%D%/zfsd_event.cc \
%D%/zfsd_exception.cc \
%D%/zfsd_main.cc \
%D%/zpool_list.cc

zfsd_LDADD = \
libnvpair.la \
libuutil.la \
libzfs_core.la \
libzfs.la

zfsd_LDADD += -lrt -lprivatedevdctl -lgeom -lbsdxml -lsbuf
zfsd_LDFLAGS = -pthread
Loading

0 comments on commit 34be70e

Please sign in to comment.