From 8db3831443fea1656eb18ffed347e76f749cd42f Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 15 May 2024 07:56:10 +0000 Subject: [PATCH] Import from AlmaLinux stable repository --- .gitignore | 2 +- .nbdkit.metadata | 2 +- ...itialization-from-incompatible-point.patch | 44 +++++ .../0001-ssh-Remove-left-over-comment.patch | 31 ---- ...work-documentation-for-dir-parameter.patch | 58 ++++++ ...error-message-when-all-authenticatio.patch | 68 ------- ...when-referencing-dir-option-from-dir.patch | 28 +++ ...-when-image-does-not-contain-a-LUKS-.patch | 44 ----- ...multi-conn-for-read-only-connections.patch | 95 ---------- ...ework-documentation-of-dir-parameter.patch | 108 +++++++++++ ...arkup-for-linking-to-other-man-pages.patch | 29 +++ ...call-nbdkit_error-twice-on-error-pat.patch | 30 ++++ ...ggest-alternate-partition-sectorsize.patch | 52 ++++++ SOURCES/copy-patches.sh | 2 +- SOURCES/nbdkit-1.32.5.tar.gz.sig | 17 -- SOURCES/nbdkit-1.36.2.tar.gz.sig | 17 ++ SPECS/nbdkit.spec | 169 +++++++++++++----- 17 files changed, 490 insertions(+), 306 deletions(-) create mode 100644 SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch delete mode 100644 SOURCES/0001-ssh-Remove-left-over-comment.patch create mode 100644 SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch delete mode 100644 SOURCES/0002-ssh-Improve-the-error-message-when-all-authenticatio.patch create mode 100644 SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch delete mode 100644 SOURCES/0003-luks-Avoid-crash-when-image-does-not-contain-a-LUKS-.patch delete mode 100644 SOURCES/0004-curl-Enable-multi-conn-for-read-only-connections.patch create mode 100644 SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch create mode 100644 SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch create mode 100644 SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch create mode 100644 SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch delete mode 100644 SOURCES/nbdkit-1.32.5.tar.gz.sig create mode 100644 SOURCES/nbdkit-1.36.2.tar.gz.sig diff --git a/.gitignore b/.gitignore index 83d9540..409e0a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/libguestfs.keyring -SOURCES/nbdkit-1.32.5.tar.gz +SOURCES/nbdkit-1.36.2.tar.gz diff --git a/.nbdkit.metadata b/.nbdkit.metadata index 346822d..6653ce4 100644 --- a/.nbdkit.metadata +++ b/.nbdkit.metadata @@ -1,2 +1,2 @@ cc1b37b9cfafa515aab3eefd345ecc59aac2ce7b SOURCES/libguestfs.keyring -c8260e2f6fb16a16cefe0cf670fc5a0f41dd7110 SOURCES/nbdkit-1.32.5.tar.gz +ca7c103dc96a65bfa5f6263bb5df8478f8038948 SOURCES/nbdkit-1.36.2.tar.gz diff --git a/SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch b/SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch new file mode 100644 index 0000000..77863d5 --- /dev/null +++ b/SOURCES/0001-configure-Fix-initialization-from-incompatible-point.patch @@ -0,0 +1,44 @@ +From ac87babe2d1652e3f37715efe9f29ad6f16eb9df Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 4 Dec 2023 10:23:29 +0000 +Subject: [PATCH] configure: Fix initialization from incompatible pointer type + +With GCC 14: + + configure:20816: checking if environ is declared in header files + configure:20833: gcc -c -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grec +ord-gcc-switches -pipe -Wall -Werror=format-security +-Werror=implicit-function-declaration -Werror=implicit-int +-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS +-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong +-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic +-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection +-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer conftest.c >&5 + conftest.c: In function 'test': + conftest.c:62:22: error: initialization of 'const char **' from incompatible p +ointer type 'char **' + 62 | const char **env = environ; + | ^~~~~~~ + +Thanks: Florian Weimer +(cherry picked from commit 32a9ee6650654469cd591a3ae26842c54f898392) +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 3b12e357..beab4674 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -335,7 +335,7 @@ AC_LANG_SOURCE([[ + static int + test (void) + { +- const char **env = environ; ++ char **env = environ; + return env ? 1 : 0; // this just forces env to be used + } + ]]) +-- +2.39.3 + diff --git a/SOURCES/0001-ssh-Remove-left-over-comment.patch b/SOURCES/0001-ssh-Remove-left-over-comment.patch deleted file mode 100644 index 70ca28d..0000000 --- a/SOURCES/0001-ssh-Remove-left-over-comment.patch +++ /dev/null @@ -1,31 +0,0 @@ -From e0e592775911ebe2178b04b4b20f95fea2f2fe9c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 5 Jan 2023 16:05:33 +0000 -Subject: [PATCH] ssh: Remove left over comment - -This comment was left over from when I copied the libssh example code. -It adds no value so remove it. - -(cherry picked from commit c93a8957efcc26652b31f5bc359dfd3c4019b4f8) ---- - plugins/ssh/ssh.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/plugins/ssh/ssh.c b/plugins/ssh/ssh.c -index 6cf40c26..aaa7c2b9 100644 ---- a/plugins/ssh/ssh.c -+++ b/plugins/ssh/ssh.c -@@ -356,10 +356,6 @@ authenticate (struct ssh_handle *h) - if (rc == SSH_AUTH_SUCCESS) return 0; - } - -- /* Example code tries keyboard-interactive here, but we cannot use -- * that method from a server. -- */ -- - if (password != NULL && (method & SSH_AUTH_METHOD_PASSWORD)) { - rc = authenticate_password (h->session, password); - if (rc == SSH_AUTH_SUCCESS) return 0; --- -2.31.1 - diff --git a/SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch b/SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch new file mode 100644 index 0000000..c368250 --- /dev/null +++ b/SOURCES/0002-file-Rework-documentation-for-dir-parameter.patch @@ -0,0 +1,58 @@ +From 054798ca11b9f0b71fbad302edf66b52519f5aa2 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 14 Dec 2023 17:47:10 +0000 +Subject: [PATCH] file: Rework documentation for dir= parameter + +The existing documentation tended towards jargon and lacked examples. + +(cherry picked from commit 7cbd49ced6414e49fcf4ff1a967929a2b83ab44e) +--- + plugins/file/nbdkit-file-plugin.pod | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index 857ad21e..e47eae97 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -64,13 +64,23 @@ symbolic links. Other special files in the directory (such as + subdirectories, pipes, or Unix sockets) are ignored. + + When this mode is used, the file to be served is chosen by the export +-name passed by the client, where the client can request a list of +-available exports using NBD_OPT_LIST. A client that requests the +-default export (C<"">) will be rejected. However, you can use +-L to adjust what export names the client +-sees or uses as a default. For security, when using directory mode, ++name passed by the client. For security, when using directory mode, + this plugin will not accept export names containing slash (C). + ++To list exports, use L I<--list> option, for example: ++ ++ nbdinfo --list nbd://localhost ++ ++An NBD client can request a list of available exports using ++C. ++ ++A client that requests the default export (C<"">) will be rejected. ++However, you can use L to adjust what ++export names the client sees, and which one the client uses as a ++default. For example to make F be the default export: ++ ++ nbdkit file dir=/dir --filter=exportname default-export=file ++ + =item BFILE_DESCRIPTOR + + (nbdkit E 1.34, not Windows) +@@ -262,7 +272,8 @@ L, + L, + L, + L, +-L. ++L, ++L. + + =head1 AUTHORS + +-- +2.39.3 + diff --git a/SOURCES/0002-ssh-Improve-the-error-message-when-all-authenticatio.patch b/SOURCES/0002-ssh-Improve-the-error-message-when-all-authenticatio.patch deleted file mode 100644 index 71ccb6a..0000000 --- a/SOURCES/0002-ssh-Improve-the-error-message-when-all-authenticatio.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 916f90972af60576591dea4a4f1d07e4dae6d9cf Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 5 Jan 2023 11:29:32 +0000 -Subject: [PATCH] ssh: Improve the error message when all authentication - methods fail - -The current error message: - - nbdkit: ssh[1]: error: all possible authentication methods failed - -is confusing and non-actionable. It's hard even for experts to -understand the relationship between the authentication methods offered -by a server and what we require. - -Try to improve the error message in some common situations, especially -where password authentication on the server side is disabled but the -client supplied a password=... parameter. After this change, you will -see an actionable error: - - nbdkit: ssh[1]: error: the server does not offer password - authentication but you tried to use a password; if you have root - access to the server, try editing 'sshd_config' and setting - 'PasswordAuthentication yes'; otherwise try setting up public key - authentication - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2158300 -Reviewed-by: Laszlo Ersek -(cherry picked from commit bea88cff5ac9c42f1a068ad24d43d5ed0506edaa) ---- - plugins/ssh/ssh.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/plugins/ssh/ssh.c b/plugins/ssh/ssh.c -index aaa7c2b9..5a132d8f 100644 ---- a/plugins/ssh/ssh.c -+++ b/plugins/ssh/ssh.c -@@ -361,6 +361,28 @@ authenticate (struct ssh_handle *h) - if (rc == SSH_AUTH_SUCCESS) return 0; - } - -+ /* All compatible methods were tried and none worked. Come up with -+ * an actionable diagnostic message if we recognise the problem. -+ */ -+ if (!(method & SSH_AUTH_METHOD_PUBLICKEY) && password == NULL) { -+ nbdkit_error ("the server does not offer public key authentication; " -+ "try using the password=... parameter"); -+ return -1; -+ } -+ if ((method & SSH_AUTH_METHOD_PASSWORD) && password != NULL) { -+ nbdkit_error ("password authentication failed, " -+ "is the username and password correct?"); -+ return -1; -+ } -+ if (!(method & SSH_AUTH_METHOD_PASSWORD) && password != NULL) { -+ nbdkit_error ("the server does not offer password authentication " -+ "but you tried to use a password; if you have root access " -+ "to the server, try editing 'sshd_config' and setting " -+ "'PasswordAuthentication yes'; otherwise try setting up " -+ "public key authentication"); -+ return -1; -+ } -+ - nbdkit_error ("all possible authentication methods failed"); - return -1; - } --- -2.31.1 - diff --git a/SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch b/SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch new file mode 100644 index 0000000..56610e5 --- /dev/null +++ b/SOURCES/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch @@ -0,0 +1,28 @@ +From 596f97316e65c151741e6ee42893023f6e945c01 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:08:37 +0000 +Subject: [PATCH] file: Fix markup when referencing dir= option from dirfd= + docs + +Fixes: commit dd28b005430d020ccd1825437937c317332d3007 +(cherry picked from commit 5b8c9c49cc352e9b0fba4dde9e0f57c53c9c2457) +--- + plugins/file/nbdkit-file-plugin.pod | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index e47eae97..5feb8ea9 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -85,7 +85,7 @@ default. For example to make F be the default export: + + (nbdkit E 1.34, not Windows) + +-This is like the I option, but instead of specifying the ++This is like the C option, but instead of specifying the + directory by name, the parent process should open the directory and + pass this file descriptor by inheritance to nbdkit. + +-- +2.39.3 + diff --git a/SOURCES/0003-luks-Avoid-crash-when-image-does-not-contain-a-LUKS-.patch b/SOURCES/0003-luks-Avoid-crash-when-image-does-not-contain-a-LUKS-.patch deleted file mode 100644 index 9838b2d..0000000 --- a/SOURCES/0003-luks-Avoid-crash-when-image-does-not-contain-a-LUKS-.patch +++ /dev/null @@ -1,44 +0,0 @@ -From dc86950fff020688a17b6ff0dbfea7bdb0d8f1b9 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 10 Jan 2023 08:39:11 +0000 -Subject: [PATCH] luks: Avoid crash when image does not contain a LUKS header - -We attempt to load the LUKS header in the prepare() callback. If this -fails, h->h will be NULL and we'll crash in close() when we attempt to -access and free h->h->masterkey. - -This crash could have been triggered another way: if open() followed -by close() was called, without prepare() or other callbacks. - -Reported-by: Ming Xie -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2159581 -(cherry picked from commit cad4b96b17ed4ad7882100efa0d9073ac9d8b11c) ---- - filters/luks/luks-encryption.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/filters/luks/luks-encryption.c b/filters/luks/luks-encryption.c -index 26f81e7b..6f33e76e 100644 ---- a/filters/luks/luks-encryption.c -+++ b/filters/luks/luks-encryption.c -@@ -856,11 +856,13 @@ load_header (nbdkit_next *next, const char *passphrase) - void - free_luks_data (struct luks_data *h) - { -- if (h->masterkey) { -- memset (h->masterkey, 0, h->phdr.master_key_len); -- free (h->masterkey); -+ if (h) { -+ if (h->masterkey) { -+ memset (h->masterkey, 0, h->phdr.master_key_len); -+ free (h->masterkey); -+ } -+ free (h); - } -- free (h); - } - - uint64_t --- -2.31.1 - diff --git a/SOURCES/0004-curl-Enable-multi-conn-for-read-only-connections.patch b/SOURCES/0004-curl-Enable-multi-conn-for-read-only-connections.patch deleted file mode 100644 index f4fe94d..0000000 --- a/SOURCES/0004-curl-Enable-multi-conn-for-read-only-connections.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 3f74004478d3590840d7eba97a590b7ec954957f Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 2 Feb 2023 13:59:32 +0000 -Subject: [PATCH] curl: Enable multi-conn for read-only connections -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Comparing before and after this commit shows approximately double the -performance. In other tests this allowed us to download files from -web servers at line speed. - - Benchmark 1: nbdkit -r curl file:/var/tmp/jammy-server-cloudimg-amd64.raw --run "nbdcopy -p \$uri null:" - Time (mean ± σ): 943.8 ms ± 18.8 ms [User: 316.2 ms, System: 1029.7 ms] - Range (min … max): 923.7 ms … 989.2 ms 10 runs - - Benchmark 2: ~/d/nbdkit/nbdkit -r curl file:/var/tmp/jammy-server-cloudimg-amd64.raw --run "nbdcopy -p \$uri null:" - Time (mean ± σ): 455.0 ms ± 6.2 ms [User: 542.2 ms, System: 1824.7 ms] - Range (min … max): 449.1 ms … 471.6 ms 10 runs - - Summary - ' ~/d/nbdkit/nbdkit -r curl file:/var/tmp/jammy-server-cloudimg-amd64.raw --run "nbdcopy -p \$uri null:" ' ran - 2.07 ± 0.05 times faster than ' nbdkit -r curl file:/var/tmp/jammy-server-cloudimg-amd64.raw --run "nbdcopy -p \$uri null:" ' - -Multi-conn is enabled only when we know the connection is read-only: - - $ ./nbdkit -r curl file:/var/tmp/jammy-server-cloudimg-amd64.raw --run ' nbdinfo $uri ' | grep can_multi_conn - can_multi_conn: true - $ ./nbdkit curl file:/var/tmp/jammy-server-cloudimg-amd64.raw --run ' nbdinfo $uri ' | grep can_multi_conn - can_multi_conn: false - -See also: -https://listman.redhat.com/archives/libguestfs/2023-February/030581.html - -Reviewed-by: Eric Blake -(cherry picked from commit bb0f93ad7b9de451874d0c54188bf69cd37c5409) ---- - plugins/curl/curl.c | 14 ++++++++++++++ - plugins/curl/curldefs.h | 1 + - 2 files changed, 15 insertions(+) - -diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c -index e89bea99..eeba5aa4 100644 ---- a/plugins/curl/curl.c -+++ b/plugins/curl/curl.c -@@ -455,6 +455,7 @@ curl_open (int readonly) - nbdkit_error ("calloc: %m"); - return NULL; - } -+ h->readonly = readonly; - - h->c = curl_easy_init (); - if (h->c == NULL) { -@@ -764,6 +765,18 @@ curl_get_size (void *handle) - return h->exportsize; - } - -+/* Multi-conn is safe for read-only connections, but HTTP does not -+ * have any concept of flushing so we cannot use it for read-write -+ * connections. -+ */ -+static int -+curl_can_multi_conn (void *handle) -+{ -+ struct curl_handle *h = handle; -+ -+ return !! h->readonly; -+} -+ - /* NB: The terminology used by libcurl is confusing! - * - * WRITEFUNCTION / write_cb is used when reading from the remote server -@@ -907,6 +920,7 @@ static struct nbdkit_plugin plugin = { - .open = curl_open, - .close = curl_close, - .get_size = curl_get_size, -+ .can_multi_conn = curl_can_multi_conn, - .pread = curl_pread, - .pwrite = curl_pwrite, - }; -diff --git a/plugins/curl/curldefs.h b/plugins/curl/curldefs.h -index f3095f92..9d4949f3 100644 ---- a/plugins/curl/curldefs.h -+++ b/plugins/curl/curldefs.h -@@ -64,6 +64,7 @@ extern const char *user_agent; - /* The per-connection handle. */ - struct curl_handle { - CURL *c; -+ int readonly; - bool accept_range; - int64_t exportsize; - char errbuf[CURL_ERROR_SIZE]; --- -2.31.1 - diff --git a/SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch b/SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch new file mode 100644 index 0000000..88fc6e8 --- /dev/null +++ b/SOURCES/0004-file-Further-rework-documentation-of-dir-parameter.patch @@ -0,0 +1,108 @@ +From 0d080223a8567a5ef673deb6ac49152fd67dd1b7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:03:13 +0000 +Subject: [PATCH] file: Further rework documentation of dir= parameter + +Move the documentation to a new section, allowing us to expand on this +topic. This also makes the HTML documentation linkable. + +Updates: commit 7cbd49ced6414e49fcf4ff1a967929a2b83ab44e +(cherry picked from commit 74621ec608d0edd76c2d8de140e7d1d5626c8251) +--- + plugins/file/nbdkit-file-plugin.pod | 66 +++++++++++++++++++++-------- + 1 file changed, 49 insertions(+), 17 deletions(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index 5feb8ea9..de8fbeba 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -63,23 +63,7 @@ directory named C, including those found by following + symbolic links. Other special files in the directory (such as + subdirectories, pipes, or Unix sockets) are ignored. + +-When this mode is used, the file to be served is chosen by the export +-name passed by the client. For security, when using directory mode, +-this plugin will not accept export names containing slash (C). +- +-To list exports, use L I<--list> option, for example: +- +- nbdinfo --list nbd://localhost +- +-An NBD client can request a list of available exports using +-C. +- +-A client that requests the default export (C<"">) will be rejected. +-However, you can use L to adjust what +-export names the client sees, and which one the client uses as a +-default. For example to make F be the default export: +- +- nbdkit file dir=/dir --filter=exportname default-export=file ++See L below. + + =item BFILE_DESCRIPTOR + +@@ -89,6 +73,8 @@ This is like the C option, but instead of specifying the + directory by name, the parent process should open the directory and + pass this file descriptor by inheritance to nbdkit. + ++See L below. ++ + =item B + + =item B +@@ -140,6 +126,52 @@ L (or C) you can serve all regular ++files and block devices located directly inside the directory named ++C, including those found by following symbolic links. ++Other special files in the directory (such as subdirectories, pipes, ++or Unix sockets) are ignored. ++ ++When this mode is used, the file to be served is chosen by the export ++name passed by the client. For security, when using directory mode, ++this plugin will not accept export names containing slash (C). ++ ++For example: ++ ++ $ ls -l /var/tmp/exports ++ total 0 ++ -rw-r--r--. 1 rjones rjones 1048576 Dec 14 15:34 disk1 ++ -rw-r--r--. 1 rjones rjones 2097152 Dec 14 15:34 disk2 ++ lrwxrwxrwx. 1 rjones rjones 9 Dec 14 15:35 sda1 -> /dev/sda1 ++ $ nbdkit file dir=/var/tmp/exports ++ ++will serve three exports called C<"disk1">, C<"disk2"> and C<"sda1">. ++The first two are regular files and the last is a block device. You ++can add or remove files or symbolic links from the directory while ++nbdkit is running. ++ ++To list exports, use L I<--list> option, for example: ++ ++ $ nbdinfo --list nbd://localhost ++ protocol: newstyle-fixed without TLS, using structured packets ++ export="disk1": ++ export-size: 1048576 (1M) ++ uri: nbd://localhost:10809/disk1 ++ [etc] ++ ++An NBD client can request a list of available exports using ++C. For libnbd clients see nbd_opt_list(3). ++ ++A client that requests the default export (C<"">) will be rejected. ++However, you can use L to adjust the ++default export as well as other transformations of export names. For ++example to make F be the default export: ++ ++ nbdkit file dir=/var/tmp/exports \ ++ --filter=exportname default-export=disk1 ++ + =head2 Optimizing for random or sequential access + + If you know in advance that the NBD client will access the file +-- +2.39.3 + diff --git a/SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch b/SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch new file mode 100644 index 0000000..3c2c4f2 --- /dev/null +++ b/SOURCES/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch @@ -0,0 +1,29 @@ +From c155987ee521c2d6a163d2814dc869ec1e89fd90 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:32:50 +0000 +Subject: [PATCH] exportname: Fix markup for linking to other man pages + +Fixes: commit 7623b2cc45078cca88fdd2d96c70c7f82a0db49d +(cherry picked from commit 6104f55f3851f3b82dc69f7e78c32e9c7a93dbc9) +--- + filters/exportname/nbdkit-exportname-filter.pod | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/filters/exportname/nbdkit-exportname-filter.pod b/filters/exportname/nbdkit-exportname-filter.pod +index 1d69f7d4..f95a37be 100644 +--- a/filters/exportname/nbdkit-exportname-filter.pod ++++ b/filters/exportname/nbdkit-exportname-filter.pod +@@ -10,8 +10,8 @@ nbdkit-exportname-filter - adjust export names between client and plugin + + =head1 DESCRIPTION + +-Some plugins (such as C and filters (such as +-C are able to serve different content based on ++Some plugins (such as L and filters (such as ++L are able to serve different content based on + the export name requested by the client. The NBD protocol allows a + server to advertise the set of export names it is serving. However, + the list advertised (or absent) from the plugin may not always match +-- +2.39.3 + diff --git a/SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch b/SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch new file mode 100644 index 0000000..9127c68 --- /dev/null +++ b/SOURCES/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch @@ -0,0 +1,30 @@ +From b8eb91e9102a2ae6cb96b0f2ffdb96b724cbb1b7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 20 Dec 2023 10:38:27 +0000 +Subject: [PATCH] partition: Don't call nbdkit_error twice on error path + +Fixes: commit 7b9301a4c569456a4f96784229a2cd48e8957662 +(cherry picked from commit 036b178a4affd00b8bbdb6cb140e81b62f57a374) +--- + filters/partition/partition-gpt.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/filters/partition/partition-gpt.c b/filters/partition/partition-gpt.c +index 80acddb4..930e2081 100644 +--- a/filters/partition/partition-gpt.c ++++ b/filters/partition/partition-gpt.c +@@ -92,10 +92,8 @@ find_gpt_partition (nbdkit_next *next, + int err; + + if (get_gpt_header (header_bytes, +- &nr_partition_entries, &size_partition_entry) == -1) { +- nbdkit_error ("cannot support non-standard GPT header"); ++ &nr_partition_entries, &size_partition_entry) == -1) + return -1; +- } + + if (partnum > nr_partition_entries) { + nbdkit_error ("GPT partition number out of range"); +-- +2.39.3 + diff --git a/SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch b/SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch new file mode 100644 index 0000000..4b8a01c --- /dev/null +++ b/SOURCES/0007-partition-Suggest-alternate-partition-sectorsize.patch @@ -0,0 +1,52 @@ +From 3b168aa842dc80a6d95b2c1ccb52a8ef664e7aba Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 20 Dec 2023 10:34:10 +0000 +Subject: [PATCH] partition: Suggest alternate partition-sectorsize + +When we reach this error it means that we have failed to detect the +"EFI PART" signature (indicating GPT) and we've fallen back to parsing +MBR, but in doing so we have discovered a GPT protective MBR which +should only happen for GPT. A possible cause for missing the +signature was because we have the wrong sector size. + +Therefore check for the current sector size (which should be either +512 or 4096) and suggest that the user sets the other sector size. + +Also avoids the case where the user already set partition-sectorsize=4k +and we were suggesting that they set it again. + +Reported-by: Ming Xie +Fixes: commit 7b9301a4c569456a4f96784229a2cd48e8957662 +Fixes: https://issues.redhat.com/browse/RHEL-19815 +(cherry picked from commit cd761c9bf770b23f678fd82f0d1c8d4cce2ed1b5) +--- + filters/partition/partition-mbr.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/filters/partition/partition-mbr.c b/filters/partition/partition-mbr.c +index 3927c31f..6a81addb 100644 +--- a/filters/partition/partition-mbr.c ++++ b/filters/partition/partition-mbr.c +@@ -87,9 +87,16 @@ find_mbr_partition (nbdkit_next *next, + !is_extended (partition.part_type_byte) && + partnum == i+1) { + if (partition.part_type_byte == 0xEE) { +- nbdkit_error ("rejecting GPT protective entry from MBR, " +- "if the underlying storage uses 4K sectors " +- "try using partition-sectorsize=4k"); ++ if (sector_size == 512) ++ nbdkit_error ("rejecting GPT protective entry from MBR, " ++ "if the underlying storage uses 4K sectors " ++ "try using partition-sectorsize=4k"); ++ else if (sector_size == 4096) ++ nbdkit_error ("rejecting GPT protective entry from MBR, " ++ "if the underlying storage uses 512 byte sectors " ++ "try using partition-sectorsize=512"); ++ else ++ nbdkit_error ("rejecting GPT protective entry from MBR"); + return -1; + } + *offset_r = partition.start_sector * (int64_t) sector_size; +-- +2.39.3 + diff --git a/SOURCES/copy-patches.sh b/SOURCES/copy-patches.sh index 01f5f6f..5b17fc5 100755 --- a/SOURCES/copy-patches.sh +++ b/SOURCES/copy-patches.sh @@ -6,7 +6,7 @@ set -e # directory. Use it like this: # ./copy-patches.sh -rhel_version=9.2 +rhel_version=9.4 # Check we're in the right directory. if [ ! -f nbdkit.spec ]; then diff --git a/SOURCES/nbdkit-1.32.5.tar.gz.sig b/SOURCES/nbdkit-1.32.5.tar.gz.sig deleted file mode 100644 index d3a243d..0000000 --- a/SOURCES/nbdkit-1.32.5.tar.gz.sig +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmO0P9URHHJpY2hAYW5u -ZXhpYS5vcmcACgkQkXOPc+G3aKBj/w/+MahWvHpk6oOoif9pvshQ5ZXWWH8+4DCZ -fMPQPRuU3j64tj2kUrp87zChVPkQv27v+RuQcs5OuhfB/nvCIJiK6dSMq6KQmIv2 -b3LieGAuIlhr89YIGQRi7j+R8iWiQgm+dT6BNeu3n7kbpEbJPPUHhz2YNlw1x/LJ -mfSEh+0HXKKz7HsCDwUCenq/pCPyD4p9x0UB0xqDT7PLg3qGwpHCMTuslrX3alOu -EYl+NDr9q266IQYGUh1zpSkobLNLvHI+TFyYEvytDnU4MylyslOdDIsA89E/y29r -rSMl9edDjhQ/h51In1Q8rKmlXFrcwDeRUywybn09m1gu++bxls5W1LFAZvp/YBa+ -nWYv3o58epJSbhEL6NO5fl88Ea5JJYqhB+I1ezud/nJ3Uu/t9C7m69Mt96U5NhQ5 -9irjO1Przz/3ft9+t7hW2u3MFNrEA/u1+e/Jnyr4+g8ZYmM1V7hQWqGwjO09zUZT -5xR41WHxG3ZbuUOv5r5Xt7Xvp1tiiWxiyEWOBydQwsnV9yZR/G2m3eWFE5H315r+ -qGQXbr41mnsUAG6G8VXsNwK8cu3YQkZBHm4et4wFmvI6C1n2I7jhQBoXkdi9BKj9 -Rh/h3DDmYB2Ud6G/ApWwfRFhSPM/apuUYfuYlXPKteFhtPjfbNSlHkm4hr1lFbK/ -+X9eYoD9410= -=qSZX ------END PGP SIGNATURE----- diff --git a/SOURCES/nbdkit-1.36.2.tar.gz.sig b/SOURCES/nbdkit-1.36.2.tar.gz.sig new file mode 100644 index 0000000..860ae27 --- /dev/null +++ b/SOURCES/nbdkit-1.36.2.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAmVjGrARHHJpY2hAYW5u +ZXhpYS5vcmcACgkQkXOPc+G3aKD2Kw/8CQVsyhgHBZ/73IRM7hskDVwidNJ9dgaZ +5BSsgyr8DU0W3yEgwFGAOb7wzKaFBN5vewAiftBz5sDSbddo7b5kzci4Fm+t+G/5 +fE5FRzyj9mwOWvympcfdIwK9lDC+0Kr7lBq7WM8QjS4kG67Dxa9hXFKRxaIHjkY7 +HK2WLUEF8/GU7dE+2aj77CXOo2gwfttCaNdPEv2pqq0ox8TKajWfInsCZ4t7DxUq +EoWTuDYlIMxLN8TSA71Am+8m8zmAZQ7WUr4cB3F8Y9EP8CljaFymI+sAv/EoeHTd +At9ZrT4Pjx0eO47MrSliincxlFIkFB9Bo316NHQ0c8gjQLgLq3nkjGlmr0P5S/iI +VMl4jVp8N2X0gXc78LQy1ARXGUD7IkCm2GePADZb4L8aSewXT6lT3UkONXToZuGE +yXLOPKVnvlnRE4DHQnvDYrwZns2Xm0u+na2bFTJgRu1i+dVSCa2a+ON7s+I2g9OI +jPAw/ps9PeNEi2F6shbJPskQCHZxZUKgrWPq4elPhFDFn1OPUBHeE/qwI5PhnpcC +LL94qWsqI/iXplvcJQ28ioXrbZFygDWheoErMtzt2K36kMDRmCQo4vPf6O+Z3qsb +9JfMLO0U7yjTI7+NJOrXa/aFAD+d0/twr177ox76kngbt7Bu+Thc7gEdncgC6w0B +8gBSF4OZ0w0= +=LFMp +-----END PGP SIGNATURE----- diff --git a/SPECS/nbdkit.spec b/SPECS/nbdkit.spec index 46daee2..c12553a 100644 --- a/SPECS/nbdkit.spec +++ b/SPECS/nbdkit.spec @@ -22,6 +22,8 @@ %global have_ocaml 1 %endif +%global have_blkio 1 + # Architectures where we run the complete test suite including # the libguestfs tests. # @@ -46,17 +48,17 @@ ExclusiveArch: x86_64 %global verify_tarball_signature 1 # If there are patches which touch autotools files, set this to 1. -%global patches_touch_autotools %{nil} +%global patches_touch_autotools 1 # The source directory. -%global source_directory 1.32-stable +%global source_directory 1.36-stable Name: nbdkit -Version: 1.32.5 -Release: 4%{?dist} +Version: 1.36.2 +Release: 1%{?dist} Summary: NBD server -License: BSD +License: BSD-3-Clause URL: https://gitlab.com/nbdkit/nbdkit %if 0%{?rhel} >= 8 @@ -75,13 +77,16 @@ Source2: libguestfs.keyring Source3: copy-patches.sh # Patches come from the upstream repository: -# https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-9.2/ +# https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-9.4/ # Patches. -Patch0001: 0001-ssh-Remove-left-over-comment.patch -Patch0002: 0002-ssh-Improve-the-error-message-when-all-authenticatio.patch -Patch0003: 0003-luks-Avoid-crash-when-image-does-not-contain-a-LUKS-.patch -Patch0004: 0004-curl-Enable-multi-conn-for-read-only-connections.patch +Patch0001: 0001-configure-Fix-initialization-from-incompatible-point.patch +Patch0002: 0002-file-Rework-documentation-for-dir-parameter.patch +Patch0003: 0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch +Patch0004: 0004-file-Further-rework-documentation-of-dir-parameter.patch +Patch0005: 0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch +Patch0006: 0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch +Patch0007: 0007-partition-Suggest-alternate-partition-sectorsize.patch # For automatic RPM Provides generation. # See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html @@ -103,6 +108,9 @@ BuildRequires: libguestfs-devel BuildRequires: libvirt-devel BuildRequires: xz-devel BuildRequires: zlib-devel +%if !0%{?rhel} +BuildRequires: zlib-ng-devel +%endif BuildRequires: libzstd-devel BuildRequires: libcurl-devel BuildRequires: libnbd-devel >= 1.3.11 @@ -112,6 +120,9 @@ BuildRequires: e2fsprogs, e2fsprogs-devel BuildRequires: xorriso BuildRequires: rb_libtorrent-devel %endif +%if 0%{?have_blkio} +BuildRequires: libblkio-devel +%endif BuildRequires: bash-completion BuildRequires: perl-devel BuildRequires: perl(ExtUtils::Embed) @@ -202,7 +213,6 @@ reading the nbdkit(1) and nbdkit-plugin(3) manual pages. %package server Summary: The %{name} server -License: BSD %description server This package contains the %{name} server with only the null plugin @@ -213,7 +223,6 @@ the metapackage "nbdkit". %package basic-plugins Summary: Basic plugins for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} @@ -238,6 +247,8 @@ nbdkit-memory-plugin A virtual memory plugin. nbdkit-ondemand-plugin Create filesystems on demand. +nbdkit-ones-plugin Fill disk with repeated 0xff or other bytes. + nbdkit-pattern-plugin Fixed test pattern. nbdkit-partitioning-plugin Create virtual disks from partitions. @@ -255,7 +266,6 @@ nbdkit-zero-plugin Zero-length plugin for testing. %package example-plugins Summary: Example plugins for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %if !0%{?rhel} # example4 is written in Perl. @@ -269,10 +279,20 @@ This package contains example plugins for %{name}. # The plugins below have non-trivial dependencies are so are # packaged separately. +%if 0%{?have_blkio} +%package blkio-plugin +Summary: libblkio NVMe, vhost-user, vDPA, VFIO plugin for %{name} +Requires: %{name}-server%{?_isa} = %{version}-%{release} + +%description blkio-plugin +This package contains libblkio (NVMe, vhost-user, vDPA, VFIO) support +for %{name}. +%endif + + %if !0%{?rhel} %package cc-plugin Summary: Write small inline C plugins and scripts for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: gcc Requires: %{_bindir}/cat @@ -287,7 +307,6 @@ in C, install %{name}-devel for that. %if !0%{?rhel} %package cdi-plugin Summary: Containerized Data Import plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: jq Requires: podman @@ -299,7 +318,6 @@ This package contains Containerized Data Import support for %{name}. %package curl-plugin Summary: HTTP/FTP (cURL) plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description curl-plugin @@ -309,7 +327,6 @@ This package contains cURL (HTTP/FTP) support for %{name}. %if !0%{?rhel} && 0%{?have_libguestfs} %package guestfs-plugin Summary: libguestfs plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description guestfs-plugin @@ -320,7 +337,6 @@ This package is a libguestfs plugin for %{name}. %if !0%{?rhel} %package iso-plugin Summary: Virtual ISO 9660 plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: xorriso @@ -332,7 +348,6 @@ This package is a virtual ISO 9660 (CD-ROM) plugin for %{name}. %if !0%{?rhel} %package libvirt-plugin Summary: Libvirt plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description libvirt-plugin @@ -344,7 +359,6 @@ virDomainBlockPeek API. %package linuxdisk-plugin Summary: Virtual Linux disk plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} # for mke2fs Requires: e2fsprogs @@ -356,7 +370,6 @@ This package is a virtual Linux disk plugin for %{name}. %if !0%{?rhel} %package lua-plugin Summary: Lua plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description lua-plugin @@ -366,7 +379,6 @@ This package lets you write Lua plugins for %{name}. %package nbd-plugin Summary: NBD proxy / forward plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description nbd-plugin @@ -377,7 +389,6 @@ to another NBD server. %if !0%{?rhel} && 0%{?have_ocaml} %package ocaml-plugin Summary: OCaml plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description ocaml-plugin @@ -389,7 +400,6 @@ To compile OCaml plugins you will also need to install %package ocaml-plugin-devel Summary: OCaml development environment for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: %{name}-ocaml-plugin%{?_isa} = %{version}-%{release} @@ -401,7 +411,6 @@ This package lets you write OCaml plugins for %{name}. %if !0%{?rhel} %package perl-plugin Summary: Perl plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description perl-plugin @@ -411,7 +420,6 @@ This package lets you write Perl plugins for %{name}. %package python-plugin Summary: Python 3 plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description python-plugin @@ -421,7 +429,6 @@ This package lets you write Python 3 plugins for %{name}. %if !0%{?rhel} %package ruby-plugin Summary: Ruby plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description ruby-plugin @@ -434,7 +441,6 @@ This package lets you write Ruby plugins for %{name}. # which varies across architectures, RPM does not allow this. %package S3-plugin Summary: Amazon S3 and Ceph plugin for %{name} -License: BSD Requires: %{name}-python-plugin >= 1.22 # XXX Should not need to add this. Requires: python3-boto3 @@ -447,7 +453,6 @@ or Ceph using %{name}. %package ssh-plugin Summary: SSH plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description ssh-plugin @@ -457,7 +462,6 @@ This package contains SSH support for %{name}. %if !0%{?rhel} %package tcl-plugin Summary: Tcl plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description tcl-plugin @@ -467,7 +471,6 @@ This package lets you write Tcl plugins for %{name}. %package tmpdisk-plugin Summary: Remote temporary filesystem disk plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} # For mkfs and mke2fs (defaults). Requires: util-linux, e2fsprogs @@ -484,7 +487,6 @@ This package is a remote temporary filesystem disk plugin for %{name}. %if !0%{?rhel} %package torrent-plugin Summary: BitTorrent plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description torrent-plugin @@ -495,7 +497,6 @@ This package is a BitTorrent plugin for %{name}. %ifarch x86_64 %package vddk-plugin Summary: VMware VDDK plugin for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} # https://bugzilla.redhat.com/show_bug.cgi?id=1931818 Requires: libxcrypt-compat @@ -508,7 +509,6 @@ VMware VDDK for accessing VMware disks and servers. %package basic-filters Summary: Basic filters for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description basic-filters @@ -534,6 +534,8 @@ nbdkit-delay-filter Inject read and write delays. nbdkit-error-filter Inject errors. +nbdkit-evil-filter Add random data corruption to reads. + nbdkit-exitlast-filter Exit on last client connection. nbdkit-exitwhen-filter Exit gracefully when an event occurs. @@ -572,6 +574,10 @@ nbdkit-pause-filter Pause NBD requests. nbdkit-protect-filter Write-protect parts of a plugin. +%if !0%{?rhel} +nbdkit-qcow2dec-filter Decode qcow2 files. + +%endif nbdkit-rate-filter Limit bandwidth by connection or server. nbdkit-readahead-filter Prefetch data when reading sequentially. @@ -592,7 +598,6 @@ nbdkit-truncate-filter Truncate, expand, round up or round down size. %if !0%{?rhel} %package ext2-filter Summary: ext2, ext3 and ext4 filesystem support for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description ext2-filter @@ -603,7 +608,6 @@ This package contains ext2, ext3 and ext4 filesystem support for %package gzip-filter Summary: GZip filter for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description gzip-filter @@ -612,7 +616,6 @@ This package is a gzip filter for %{name}. %package stats-filter Summary: Statistics filter for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description stats-filter @@ -621,7 +624,6 @@ Display statistics about operations. %package tar-filter Summary: Tar archive filter for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: tar Obsoletes: %{name}-tar-plugin < 1.23.9-3 @@ -632,7 +634,6 @@ This package is a tar archive filter for %{name}. %package xz-filter Summary: XZ filter for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} %description xz-filter @@ -641,7 +642,6 @@ This package is the xz filter for %{name}. %package devel Summary: Development files and documentation for %{name} -License: BSD Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -653,7 +653,6 @@ plugins for %{name}. %package srpm-macros Summary: RPM Provides rules for %{name} plugins and filters -License: BSD BuildArch: noarch %description srpm-macros @@ -663,7 +662,6 @@ for %{name} plugins and filters found in the plugins directory. %package bash-completion Summary: Bash tab-completion for %{name} -License: BSD BuildArch: noarch Requires: bash-completion >= 2.0 Requires: %{name}-server = %{version}-%{release} @@ -689,35 +687,73 @@ autoreconf -i # package into their vendor/ directory. export PYTHON=%{__python3} %configure \ - --with-extra='%{name}-%{version}-%{release}' \ --disable-static \ + --with-extra='%{name}-%{version}-%{release}' \ + --with-tls-priority=@NBDKIT,SYSTEM \ + --with-bash-completions \ + --with-curl \ + --with-gnutls \ + --with-liblzma \ + --with-libnbd \ + --with-manpages \ + --with-selinux \ + --with-ssh \ + --with-zlib \ +%if !0%{?rhel} + --with-zlib-ng \ +%else + --without-zlib-ng \ +%endif + --enable-linuxdisk \ + --enable-python \ --disable-golang \ --disable-rust \ + --disable-valgrind \ %if !0%{?rhel} && 0%{?have_ocaml} --enable-ocaml \ %else --disable-ocaml \ %endif -%if 0%{?rhel} +%if !0%{?rhel} + --enable-lua \ + --enable-perl \ + --enable-ruby \ + --enable-tcl \ + --enable-torrent \ + --with-ext2 \ + --with-iso \ + --with-libvirt \ +%else --disable-lua \ --disable-perl \ --disable-ruby \ --disable-tcl \ + --disable-torrent \ --without-ext2 \ --without-iso \ --without-libvirt \ %endif +%if 0%{?have_blkio} + --with-libblkio \ +%else + --without-libblkio \ +%endif +%ifarch x86_64 + --enable-vddk \ +%else + --disable-vddk \ +%endif %if !0%{?rhel} && 0%{?have_libguestfs} --with-libguestfs \ %else --without-libguestfs \ %endif -%ifarch %{complete_test_arches} +%ifarch !0%{?rhel} && 0%{?have_libguestfs} && %{complete_test_arches} --enable-libguestfs-tests \ %else --disable-libguestfs-tests \ %endif - --with-tls-priority=@NBDKIT,SYSTEM + %{nil} # Verify that it picked the correct version of Python # to avoid RHBZ#1404631 happening again silently. @@ -737,13 +773,15 @@ find $RPM_BUILD_ROOT -name '*.la' -delete rm -f $RPM_BUILD_ROOT%{_mandir}/man3/nbdkit-rust-plugin.3* %if 0%{?rhel} -# In RHEL, remove some plugins we cannot --disable. -for f in cc cdi torrent; do +# In RHEL, remove some plugins and filters we cannot --disable. +for f in cc cdi ; do rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/nbdkit-$f-plugin.so rm -f $RPM_BUILD_ROOT%{_mandir}/man?/nbdkit-$f-plugin.* done rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/nbdkit-S3-plugin rm -f $RPM_BUILD_ROOT%{_mandir}/man1/nbdkit-S3-plugin.1* +rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/filters/nbdkit-qcow2dec-filter.so +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/nbdkit-qcow2dec-filter.1* %endif # Install RPM dependency generator. @@ -841,6 +879,7 @@ export LIBGUESTFS_TRACE=1 %{_libdir}/%{name}/plugins/nbdkit-info-plugin.so %{_libdir}/%{name}/plugins/nbdkit-memory-plugin.so %{_libdir}/%{name}/plugins/nbdkit-ondemand-plugin.so +%{_libdir}/%{name}/plugins/nbdkit-ones-plugin.so %{_libdir}/%{name}/plugins/nbdkit-partitioning-plugin.so %{_libdir}/%{name}/plugins/nbdkit-pattern-plugin.so %{_libdir}/%{name}/plugins/nbdkit-random-plugin.so @@ -856,6 +895,7 @@ export LIBGUESTFS_TRACE=1 %{_mandir}/man1/nbdkit-info-plugin.1* %{_mandir}/man1/nbdkit-memory-plugin.1* %{_mandir}/man1/nbdkit-ondemand-plugin.1* +%{_mandir}/man1/nbdkit-ones-plugin.1* %{_mandir}/man1/nbdkit-partitioning-plugin.1* %{_mandir}/man1/nbdkit-pattern-plugin.1* %{_mandir}/man1/nbdkit-random-plugin.1* @@ -875,6 +915,15 @@ export LIBGUESTFS_TRACE=1 %{_mandir}/man1/nbdkit-example*-plugin.1* +%if 0%{?have_blkio} +%files blkio-plugin +%doc README.md +%license LICENSE +%{_libdir}/%{name}/plugins/nbdkit-blkio-plugin.so +%{_mandir}/man1/nbdkit-blkio-plugin.1* +%endif + + %if !0%{?rhel} %files cc-plugin %doc README.md @@ -1051,6 +1100,7 @@ export LIBGUESTFS_TRACE=1 %{_libdir}/%{name}/filters/nbdkit-ddrescue-filter.so %{_libdir}/%{name}/filters/nbdkit-delay-filter.so %{_libdir}/%{name}/filters/nbdkit-error-filter.so +%{_libdir}/%{name}/filters/nbdkit-evil-filter.so %{_libdir}/%{name}/filters/nbdkit-exitlast-filter.so %{_libdir}/%{name}/filters/nbdkit-exitwhen-filter.so %{_libdir}/%{name}/filters/nbdkit-exportname-filter.so @@ -1070,6 +1120,9 @@ export LIBGUESTFS_TRACE=1 %{_libdir}/%{name}/filters/nbdkit-partition-filter.so %{_libdir}/%{name}/filters/nbdkit-pause-filter.so %{_libdir}/%{name}/filters/nbdkit-protect-filter.so +%if !0%{?rhel} +%{_libdir}/%{name}/filters/nbdkit-qcow2dec-filter.so +%endif %{_libdir}/%{name}/filters/nbdkit-rate-filter.so %{_libdir}/%{name}/filters/nbdkit-readahead-filter.so %{_libdir}/%{name}/filters/nbdkit-retry-filter.so @@ -1087,6 +1140,7 @@ export LIBGUESTFS_TRACE=1 %{_mandir}/man1/nbdkit-ddrescue-filter.1* %{_mandir}/man1/nbdkit-delay-filter.1* %{_mandir}/man1/nbdkit-error-filter.1* +%{_mandir}/man1/nbdkit-evil-filter.1* %{_mandir}/man1/nbdkit-exitlast-filter.1* %{_mandir}/man1/nbdkit-exitwhen-filter.1* %{_mandir}/man1/nbdkit-exportname-filter.1* @@ -1106,6 +1160,9 @@ export LIBGUESTFS_TRACE=1 %{_mandir}/man1/nbdkit-partition-filter.1* %{_mandir}/man1/nbdkit-pause-filter.1* %{_mandir}/man1/nbdkit-protect-filter.1* +%if !0%{?rhel} +%{_mandir}/man1/nbdkit-qcow2dec-filter.1* +%endif %{_mandir}/man1/nbdkit-rate-filter.1* %{_mandir}/man1/nbdkit-readahead-filter.1* %{_mandir}/man1/nbdkit-retry-filter.1* @@ -1200,6 +1257,22 @@ export LIBGUESTFS_TRACE=1 %changelog +* Tue Dec 20 2023 Richard W.M. Jones - 1.36.2-1 +- Rebase to 1.36.2 + resolves: RHEL-14475 +- partition: Suggest alternate partition-sectorsize + resolves: RHEL-19815 + +* Tue Aug 01 2023 Richard W.M. Jones - 1.34.2-1 +- Rebase to 1.34.2 + resolves: rhbz#2168629 +- Backport nbdkit-curl-plugin "multi" interface support + resolves: rhbz#2228131 + +* Tue Apr 18 2023 Richard W.M. Jones - 1.34.1-1 +- Rebase to 1.34.1 + resolves: rhbz#2168629 + * Fri Feb 03 2023 Richard W.M. Jones - 1.32.5-4 - Rebase to new stable branch version 1.32.5 resolves: rhbz#2135765