[osv-dev] [PATCH] zfs: allow mounting and building on host

2022-07-16 Thread Waldemar Kozaczuk
This requires OpenZFS installed on host (see https://openzfs.github.io/openzfs-docs/Getting%20Started/Fedora/index.html for Fedora and https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/index.html for Ubuntu). In essence this patch adds new script zfs-image-on-host.sh that allows moun

[osv-dev] [PATCH] tests: fix misc-zfs-arc.cc

2022-07-16 Thread Waldemar Kozaczuk
This patch also enhances this test to make it support running with ZFS mounted from non-root. Signed-off-by: Waldemar Kozaczuk --- bsd/sys/cddl/compat/opensolaris/sys/mman.h| 1 + .../opensolaris/uts/common/fs/zfs/arc.c | 4 +- modules/tests/Makefile| 11 +--

[osv-dev] [PATCH] zpool import: do not try devices where ZFS is mounted

2022-07-16 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- .../lib/libzfs/common/libzfs_import.c | 48 +-- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/bsd/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c b/bsd/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impor

[osv-dev] [PATCH] tests: add misc-zfs-io to all images

2022-07-16 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- modules/tests/Makefile | 4 ++-- tests/misc-zfs-io.cc | 6 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/tests/Makefile b/modules/tests/Makefile index 7d15522c..d1732e75 100644 --- a/modules/tests/Makefile +++ b/modules/tests/

[osv-dev] [PATCH] zfs: support building rofs+zfs image and second ZFS disk

2022-07-16 Thread Waldemar Kozaczuk
This patch enhances the build scriots and run.py to allow build the images as described by #1200: 1. Run OSv from a single disk with two partitions: ROFS + ZFS (on /dev/vblk0.2) ./scripts/build image=tests,zfs,zfs-tools fs=rofs_with_zfs fs_size_mb=5000 ./scripts/run.py --execute='--mount-fs=zf

[osv-dev] [PATCH] vfs: support mounting ZFS from non-root partition

2022-07-16 Thread Waldemar Kozaczuk
This patch mainly enhances VFS layer to support dynamically loading the ZFS library libsolaris.so from other root filesystem like ROFS and mounting ZFS filesystem from devices different than /dev/vblk0.1. The supported scenarios include specifying a loader option '--mount-fs' or adding an entry to

[osv-dev] [PATCH] devfs: print details of mounted partition

2022-07-16 Thread Waldemar Kozaczuk
Print information about the partition and offset child device is created for. This is very helpful to understand the process of mounting the filesystems. Signed-off-by: Waldemar Kozaczuk --- fs/devfs/device.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/devfs/device.cc b/fs/devfs/de

[osv-dev] [PATCH] zfs: refactor loader to handle loading libsolaris.so

2022-07-16 Thread Waldemar Kozaczuk
This patch refactors the code that loads libsolaris.so to mount ZFS filesystem by extracting the common code into the load_zfs_library_and_mount_zfs_root() function. This will help us enhance the loader and VFS code to support mounting ZFS filesystem from devices different than /dev/vblk0.1. Refs

[osv-dev] [PATCH] zfs: use spa_dev_path instead of defaulting to /dev/vblk0.1

2022-07-16 Thread Waldemar Kozaczuk
The commit c9640a385c44704626a9169c03cff0752bfe764d addressing the issue #918, tweaked the vdev disk mounting logic to default to import the root pool from the device /dev/vblk0.1. This was really a hack that was satisfactory to support mounting a ZFS image created or modified on host. However, if