<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<!--
Copyright 2018 Matthew Leeds <matthew.leeds@endlessm.com>

SPDX-License-Identifier: LGPL-2.0+

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library 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
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-->

<refentry id="ostree">

    <refentryinfo>
        <title>ostree create-usb</title>
        <productname>OSTree</productname>

        <authorgroup>
            <author>
                <contrib>Developer</contrib>
                <firstname>Matthew</firstname>
                <surname>Leeds</surname>
                <email>matthew.leeds@endlessm.com</email>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>ostree create-usb</refentrytitle>
        <manvolnum>1</manvolnum>
    </refmeta>

    <refnamediv>
        <refname>ostree-create-usb</refname>
        <refpurpose>Put the given refs on an external drive for P2P distribution.</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
            <cmdsynopsis>
                <command>ostree create-usb</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">MOUNT-PATH</arg> <arg choice="req">COLLECTION-ID REF</arg> <arg choice="opt" rep="repeat">COLLECTION-ID REF</arg>
            </cmdsynopsis>
    </refsynopsisdiv>

    <refsect1>
        <title>Description</title>

        <para>
            This command creates a repository in MOUNT-PATH and pulls the given
            REF(s) into it so they can be found and pulled from (perhaps by another computer that's offline).
            See
            <citerefentry><refentrytitle>ostree-find-remotes</refentrytitle><manvolnum>1</manvolnum></citerefentry>
            for more information on P2P distribution.
        </para>
        <para>
            In order for ostree to pull refs from a mounted filesystem (such as
            a USB drive) the repo must be in a standard location. Specifically,
            subdirectories of <filename>.ostree/repos.d</filename> are checked,
            then <filename>.ostree/repo</filename>, <filename>ostree/repo</filename>,
            and <filename>var/lib/flatpak/repo</filename> are checked. By default
            <command>ostree create-usb</command> uses <filename>.ostree/repo</filename>,
            but if you specify another location using <option>--destination-repo</option>
            a symbolic link will be created for you in <filename>.ostree/repos.d</filename>.
        </para>
        <para>
            This command will regenerate the <filename>summary</filename> file
            in the destination repo so that it stays accurate, so you shouldn't
            try to use summary signatures in the destination repo. This
            shouldn't be a concern because clients that support pulling from
            USB mounts use signed per-repo and per-commit metadata instead of
            summary signatures.
        </para>
    </refsect1>

    <refsect1>
        <title>Options</title>

        <variablelist>
            <varlistentry>
                <term><option>--disable-fsync</option></term>

                <listitem><para>
                  Do not invoke fsync().
                </para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><option>--destination-repo</option>=DEST</term>

                <listitem><para>
                  Create the repository in DEST under MOUNT-PATH, rather than
                  the default location.
                </para></listitem>
            </varlistentry>

            <varlistentry>
                <term><option>--commit</option>=COMMIT</term>

                <listitem><para>
                  Pull COMMIT instead of whatever REF points to. This can only
                  be used if a single ref is specified.
                </para></listitem>
            </varlistentry>

        </variablelist>
    </refsect1>

    <refsect1>
        <title>Example</title>
        <para><command>ostree --repo=/var/lib/flatpak/repo create-usb /run/media/mwleeds/f6d04c7a-60f6-4ba3-bb96-0f40498675be com.exampleos.Apps app/org.kde.Khangman/x86_64/stable com.exampleos.Apps ostree-metadata com.exampleos.Apps appstream/x86_64</command></para>
<programlisting>

5 metadata, 213 content objects imported; 1 KiB transferred in 1 seconds                                                                                                                      Copied 3/3 refs successfully from ‘/var/lib/flatpak/repo’ to ‘.ostree/repo’ repository in ‘/run/media/mwleeds/f6d04c7a-60f6-4ba3-bb96-0f40498675be’.

</programlisting>
    </refsect1>
</refentry>
