search for: labelopt

Displaying 12 results from an estimated 12 matches for "labelopt".

2020 Apr 04
0
[PATCH nbdkit 1/2] tmpdisk: Generate the default command from a shell script fragment.
...tmpdisk.c b/plugins/tmpdisk/tmpdisk.c index a5aacc9d..5e8df151 100644 --- a/plugins/tmpdisk/tmpdisk.c +++ b/plugins/tmpdisk/tmpdisk.c @@ -55,24 +55,10 @@ static int64_t size = -1; static const char *label = NULL; static const char *type = "ext4"; -static const char *command = - "labelopt='-L'\n" - "case \"$type\" in\n" - " ext?)\n" - " extra='-F' ;;\n" - " *fat|msdos)\n" - " extra='-I' ;;\n" - " ntfs)\n" - " extra='-Q -F'\n" - &q...
2020 Apr 04
4
[PATCH nbdkit 0/2] Generalize the tmpdisk plugin.
Patch 1/2 is uncontroversial. Patch 2/2 is an interesting idea I had to generalize this plugin. It already uses a complete embedded shell script to do most of the work. What if, instead of making special cases for "type" and "label" params, we simply turn any other plugin parameters into script variables? This part of it works fine. However there is another problem which is
2020 Mar 17
0
Re: [PATCH nbdkit v2] New tmpdisk plugin.
...ND through /bin/sh, the nbdkit user can inject ANY action they want, but I don't see that as inherently risky as nbdkit is not running with more privileges than the user already has. > +++ b/plugins/tmpdisk/tmpdisk.c > @@ -0,0 +1,427 @@ > +static const char *command = > + "labelopt='-L'\n" > + "case \"$type\" in\n" > + " ext?)\n" > + " extra='-F' ;;\n" > + " *fat|msdos)\n" > + " extra='-I' ;;\n" > + " ntfs)\n" > + "...
2020 Mar 17
2
[PATCH nbdkit v2] New tmpdisk plugin.
...lt;fcntl.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/wait.h> + +#define NBDKIT_API_VERSION 2 +#include <nbdkit-plugin.h> + +#include "cleanup.h" +#include "utils.h" + +static int64_t size = -1; + +static const char *command = + "labelopt='-L'\n" + "case \"$type\" in\n" + " ext?)\n" + " extra='-F' ;;\n" + " *fat|msdos)\n" + " extra='-I' ;;\n" + " ntfs)\n" + " extra='-Q -F'\n" + &q...
2020 Mar 16
1
[PATCH nbdkit] New tmpdisk plugin.
Unfinished (needs tests). This is my attempt to make a "remote tmpfs" plugin as outlined in this prior email: https://www.redhat.com/archives/libguestfs/2020-March/msg00134.html Although it would be possible to construct something a bit like this using existing plugins and filters (perhaps with some new features in those filters) I think it may be nicer to have a dedicated plugin for
2020 Mar 17
2
[PATCH nbdkit v3] New tmpdisk plugin.
v2 was here: https://www.redhat.com/archives/libguestfs/2020-March/msg00154.html v3: - Micro-optimize tmpdir. - Quote $disk in default command shell fragment. - Don't redirect mkfs output to /dev/null. Instead use exec </dev/null >/dev/null before the shell fragment. We may want to do this in other places where we run external shell scripts, or more generally for all
2020 Apr 04
0
[PATCH nbdkit 2/2] tmpdisk: Pass any parameters as shell variables to the command.
....sh.in index 251e0b7b..87c86f1e 100644 --- a/plugins/tmpdisk/default-command.sh.in +++ b/plugins/tmpdisk/default-command.sh.in @@ -30,6 +30,9 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +# If not set, default to ext4. +type="${type:-ext4}" + labelopt='-L' case "$type" in -- 2.25.0
2020 Aug 14
2
[PATCH nbdkit] New ondemand plugin.
...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. + +# If not set, default to ext4. +type="${type:-ext4}" + +labelopt='-L' + +case "$type" in + ext?) + extra='-F' ;; + *fat|msdos) + extra='-I' ;; + ntfs) + extra='-Q -F' + labelopt='-n' ;; + xfs) + extra='-f' ;; +esac + +# Create the output disk. +truncate -s $s...
2020 Apr 07
0
[PATCH nbdkit v2] tmpdisk: Pass any parameters as shell variables to the command.
....sh.in index 251e0b7b..d60402b5 100644 --- a/plugins/tmpdisk/default-command.sh.in +++ b/plugins/tmpdisk/default-command.sh.in @@ -30,6 +30,9 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +# If not set, default to ext4. +type="${type:-ext4}" + labelopt='-L' case "$type" in @@ -44,6 +47,9 @@ case "$type" in extra='-f' ;; esac +# Create the output disk. +truncate -s $size "$disk" + if [ "x$label" = "x" ]; then mkfs -t "$type" $extra "$disk" e...
2020 Apr 08
0
[PATCH nbdkit v3] tmpdisk: Pass any parameters as shell variables to the command.
....sh.in index 251e0b7b..d60402b5 100644 --- a/plugins/tmpdisk/default-command.sh.in +++ b/plugins/tmpdisk/default-command.sh.in @@ -30,6 +30,9 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. +# If not set, default to ext4. +type="${type:-ext4}" + labelopt='-L' case "$type" in @@ -44,6 +47,9 @@ case "$type" in extra='-f' ;; esac +# Create the output disk. +truncate -s $size "$disk" + if [ "x$label" = "x" ]; then mkfs -t "$type" $extra "$disk" e...
2020 Apr 08
2
[PATCH nbdkit v3] tmpdisk: Generalize the tmpdisk plugin.
v2 was here: https://www.redhat.com/archives/libguestfs/2020-April/msg00075.html In v3: - Add [VAR=VALUE ...] to manual. - Various minor improvements to the manual. - Work (at least, in theory - not tested) with block devices or symlinks. I didn't document this because it's hard to ensure these files or block devices would be cleaned up, so here be dragons. - Remove O_NOCTTY. -
2020 Apr 07
2
[PATCH nbdkit v2] tmpdisk: Generalize the tmpdisk plugin
An evolution of v1 here: https://www.redhat.com/archives/libguestfs/2020-April/msg00035.html I want to generalize the tmpdisk plugin, particularly so you can use commands like ‘qemu-img create’ or even ‘virt-builder’. (Actually virt-builder really works - I tested it - but of course it causes a 30+ second delay when connecting to the server.) You can now use commands such as: nbdkit tmpdisk