IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
<para><function>ImportTar()</function>/<function>ImportTarEx()</function> and
<function>ImportRaw()</function>/<function>ImportRawEx()</function> import a disk image and place it
into the image directory. The first argument should be a file descriptor (opened for reading) referring
to the tar or raw file to import. It should reference a file on disk, a pipe or a socket. When
<function>ImportTar()</function>/<function>ImportTarEx()</function> is used the file descriptor should
refer to a tar file, optionally compressed with <citerefentryproject="die-net"><refentrytitle>gzip</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentryproject="die-net"><refentrytitle>bzip2</refentrytitle><manvolnum>1</manvolnum></citerefentry>, or
<function>ImportRaw()</function>/<function>ImportRawEx()</function> is used the file descriptor should
refer to a raw or qcow2 disk image containing an MBR or GPT disk label, also optionally compressed with
gzip, bzip2 or xz. In either case, if the file is specified as a file descriptor on disk, progress
information is generated for the import operation (as in that case we know the total size on disk). If
a socket or pipe is specified, progress information is not available. The file descriptor argument is
followed by a local name for the image. This should be a name suitable as a hostname and will be used
to name the imported image below <filename>/var/lib/machines/</filename>. A tar import is placed as a
directory tree or a <citerefentryproject="url"><refentrytitleurl="https://btrfs.readthedocs.io/en/latest/btrfs.html">btrfs</refentrytitle><manvolnum>8</manvolnum></citerefentry>
subvolume below the image directory under the specified name with no suffix appended. A raw import is
placed as a file in the image directory with the <filename>.raw</filename> suffix appended. In case of
<function>ImportTar()</function>/<function>ImportRaw()</function>, if the <option>force</option>
argument is true, any pre-existing image with the same name is removed before starting the
operation. Otherwise, the operation fails if an image with the same name already exists. The
<option>read_only</option> argument controls whether to create a writable or read-only image. In case
of <function>ImportTarEx()</function>/<function>ImportRawEx()</function> these boolean flags are
provided via a 64bit flags parameter instead, with bit 0 mapping to the <option>force</option>
parameter, and bit 1 mapping to <option>read_only</option>. The <option>class</option> parameter
specifies the image class, and takes one of <literal>machine</literal>, <literal>portable</literal>,
<literal>sysext</literal>, <literal>confext</literal>. All four methods return immediately after
starting the import, with the import transfer ongoing. They return a pair of transfer identifier and
object path, which may be used to retrieve progress information about the transfer or to cancel it. The
transfer identifier is a simple numeric identifier, the object path references an
specified file descriptor will be a tar file in case of
<function>ExportTar()</function>/<function>ExportTarEx()</function> or a raw disk image in case of
<function>ExportRaw()</function>/<function>ExportRawEx()</function>. Note that currently raw disk
images may not be exported as tar files, and vice versa. This restriction might be lifted
eventually. The method returns a transfer identifier and object path for cancelling or tracking the
export operation, similarly to <function>ImportTar()</function>/<function>ImportTarEx()</function> or
<function>ImportRaw()</function>/<function>ImportRawEx()</function> as described
above. <function>ExportTarEx()</function>/<function>ExportRawEx()</function> expect the image class as
additional parameter, as well as a 64bit flags parameter that currently must be specified as
zero.</para>
<para><function>PullTar()</function>/<function>PullTarEx()</function> and
<function>PullRaw()</function>/<function>PullRawEx()</function> may be used to download, verify and
import a system image from a URL. They take a URL argument which should point to a tar or raw file on
the <literal>http://</literal> or <literal>https://</literal> protocols, possibly compressed with xz,
bzip2 or gzip. The second argument is a local name for the image. It should be suitable as a hostname,
similarly to the matching argument of the
<function>ImportTar()</function>/<function>ImportTarEx()</function> and
<function>ImportRaw()</function>/<function>ImportRawEx()</function> methods above. The third argument
indicates the verification mode for the image. It may be one of <literal>no</literal>,
<literal>checksum</literal>, <literal>signature</literal>. <literal>no</literal> turns off any kind of
verification of the image; <literal>checksum</literal> looks for a <filename>SHA256SUM</filename> file
next to the downloaded image and verifies any SHA256 hash value in that file against the image;
<literal>signature</literal> does the same but also tries to authenticate the
<filename>SHA256SUM</filename> file via <citerefentryproject="man-pages"><refentrytitle>gpg</refentrytitle><manvolnum>8</manvolnum></citerefentry> first. In
case of <function>PullTar()</function>/<function>PullRaw()</function> the last argument indicates
whether to replace a possibly pre-existing image with the same local name (if <literal>true</literal>),
or whether to fail (if <literal>false</literal>). In case of
<function>PullTarEx()</function>/<function>PullRawEx()</function> the last argument is a 64bit flags
parameter, where bit 0 controls the <literal>force</literal> flag, bit 1 is a
<literal>read_only</literal> flag that controls whether the created image shall be marked read-only,
and bit 2 is a <literal>keep_download</literal> flag that indicates whether a pristine, read-only copy
of the downloaded image shell be kept, in addition for the local copy of the image. The
<function>…_Ex()</function> variants also expect an image class string (as above). Like the import and
export calls above, these calls return a pair of transfer identifier and object path for the ongoing