Permalink
Browse files

Add iso plugin.

Create a virtual ISO (CD-ROM) from a directory of files.

For example:

  nbdkit iso /path/to/directory params="-JrT"

will serve (read-only and immutably) all the files from the directory
as a virtual ISO image.
  • Loading branch information...
rwmjones committed Sep 15, 2018
1 parent cde1290 commit 3c6e6b6d12e2bcee28c1629663c0393d6ff89a54
Showing with 565 additions and 0 deletions.
  1. +4 −0 README
  2. +28 −0 configure.ac
  3. +65 −0 plugins/iso/Makefile.am
  4. +302 −0 plugins/iso/iso.c
  5. +106 −0 plugins/iso/nbdkit-iso-plugin.pod
  6. +10 −0 tests/Makefile.am
  7. +50 −0 tests/test-iso.sh
4 README
@@ -73,6 +73,10 @@ For the curl (HTTP/FTP) plugin:
- libcurl
For the iso plugin:
- genisoimage or mkisofs
For the libvirt plugin:
- libvirt
@@ -443,6 +443,32 @@ AS_IF([test "$with_curl" != "no"],[
])
AM_CONDITIONAL([HAVE_CURL],[test "x$CURL_LIBS" != "x"])
dnl Check for genisoimage or mkisofs
dnl (only if you want to compile the iso plugin).
ISOPROG="no"
AC_ARG_WITH([iso],[
AS_HELP_STRING([--without-iso],
[disable iso plugin @<:@default=check@:>@])],
[],
[with_iso=check])
AS_IF([test "$with_iso" != "no"],[
AC_CHECK_PROG([GENISOIMAGE],[genisoimage],[genisoimage],[no])
AC_CHECK_PROG([MKISOFS],[mkisofs],[mkisofs],[no])
AS_IF([test "x$GENISOIMAGE" != "xno"],[
ISOPROG="$GENISOIMAGE"
],[
AS_IF([test "x$MKISOFS" != "xno"],[
ISOPROG="$MKISOFS"
])
])
AS_IF([test "x$ISOPROG" != "xno"],[
AC_DEFINE_UNQUOTED([ISOPROG],["$ISOPROG"],
[Program used by iso plugin to make ISOs.])
])
])
AC_SUBST([ISOPROG])
AM_CONDITIONAL([HAVE_ISO],[test "x$ISOPROG" != "xno"])
dnl Check for libvirt (only if you want to compile the libvirt plugin).
AC_ARG_WITH([libvirt],[
AS_HELP_STRING([--without-libvirt],
@@ -575,6 +601,7 @@ non_lang_plugins="\
file \
guestfs \
gzip \
iso \
libvirt \
memory \
nbd \
@@ -631,6 +658,7 @@ AC_CONFIG_FILES([Makefile
plugins/file/Makefile
plugins/guestfs/Makefile
plugins/gzip/Makefile
plugins/iso/Makefile
plugins/libvirt/Makefile
plugins/lua/Makefile
plugins/memory/Makefile
@@ -0,0 +1,65 @@
# nbdkit
# Copyright (C) 2018 Red Hat Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Red Hat nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
include $(top_srcdir)/common-rules.mk
EXTRA_DIST = nbdkit-iso-plugin.pod
if HAVE_ISO
plugin_LTLIBRARIES = nbdkit-iso-plugin.la
nbdkit_iso_plugin_la_SOURCES = \
iso.c \
$(top_srcdir)/include/nbdkit-plugin.h
nbdkit_iso_plugin_la_CPPFLAGS = \
-I$(top_srcdir)/include \
-I.
nbdkit_iso_plugin_la_CFLAGS = \
$(WARNINGS_CFLAGS)
nbdkit_iso_plugin_la_LDFLAGS = \
-module -avoid-version -shared
if HAVE_POD
man_MANS = nbdkit-iso-plugin.1
CLEANFILES += $(man_MANS)
nbdkit-iso-plugin.1: nbdkit-iso-plugin.pod
$(PODWRAPPER) --section=1 --man $@ \
--html $(top_builddir)/html/$@.html \
$<
endif HAVE_POD
endif
Oops, something went wrong.

0 comments on commit 3c6e6b6

Please sign in to comment.