mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
dib: add tgz output format
Implement the "tgz" output format, i.e. "tar" compressed as gzip. This was implemented in diskimage-builder upstream as commit da41ee6012b064aa6901c871a1104a3a3933117e.
This commit is contained in:
@@ -32,6 +32,7 @@ formats = \
|
||||
qcow2 \
|
||||
raw \
|
||||
tar \
|
||||
tgz \
|
||||
vhd
|
||||
|
||||
SOURCES_ML = \
|
||||
|
||||
35
dib/output_format_tgz.ml
Normal file
35
dib/output_format_tgz.ml
Normal file
@@ -0,0 +1,35 @@
|
||||
(* virt-dib
|
||||
* Copyright (C) 2017 Red Hat Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*)
|
||||
|
||||
open Common_utils
|
||||
open Common_gettext.Gettext
|
||||
|
||||
open Output_format
|
||||
|
||||
let tgz_run_fs (g : Guestfs.guestfs) filename _ =
|
||||
message (f_"Compressing the image as tar.gz");
|
||||
g#tar_out ~excludes:[| "./sys/*"; "./proc/*" |] ~compress:"gzip"
|
||||
"/" filename
|
||||
|
||||
let fmt = {
|
||||
defaults with
|
||||
name = "tgz";
|
||||
run_on_filesystem = Some tgz_run_fs;
|
||||
}
|
||||
|
||||
let () = register_format fmt
|
||||
@@ -216,6 +216,10 @@ Raw disk format.
|
||||
|
||||
An uncompressed tarball.
|
||||
|
||||
=item C<tgz>
|
||||
|
||||
A tarball compressed with gzip.
|
||||
|
||||
=item C<vhd>
|
||||
|
||||
C<Virtual Hard Disk> disk image. This output format requires
|
||||
|
||||
Reference in New Issue
Block a user