man: Add man page for create-usb

Closes: #1543
Approved by: cgwalters
This commit is contained in:
Matthew Leeds 2018-04-17 14:35:52 -07:00 committed by Atomic Bot
parent cf78888401
commit 972a1921f5
6 changed files with 145 additions and 3 deletions

View File

@ -45,7 +45,7 @@ man1_files += rofiles-fuse.1
endif
if ENABLE_EXPERIMENTAL_API
man1_files += ostree-find-remotes.1
man1_files += ostree-find-remotes.1 ostree-create-usb.1
endif
man5_files = ostree.repo.5 ostree.repo-config.5

127
man/ostree-create-usb.xml Normal file
View File

@ -0,0 +1,127 @@
<?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>
<para>
This command relies on the summary file in the source repo, so you
may want to run <command>ostree summary -u</command> before running
this command.
</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>
</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>

View File

@ -78,6 +78,12 @@ Boston, MA 02111-1307, USA.
default set of finders (sources for remotes) using the
<option>--finders</option> option documented below.
</para>
<para>
The <command>create-usb</command> command is the recommended way to
put refs on a USB such that <command>find-remotes</command> will
discover them. See
<citerefentry><refentrytitle>ostree-create-usb</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
</refsect1>
<refsect1>

View File

@ -283,6 +283,15 @@ Boston, MA 02111-1307, USA.
</para></listitem>
</varlistentry>
<!-- FIXME: Uncomment this when it's no longer experimental
<varlistentry>
<term><citerefentry><refentrytitle>ostree-create-usb</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>
&nbsp;Put the given refs on an external drive for P2P distribution.
</para></listitem>
</varlistentry>-->
<varlistentry>
<term><citerefentry><refentrytitle>ostree-diff</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

View File

@ -434,7 +434,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
g_array_sort (repos_refs, repo_and_refs_compare);
/* Also check the well-known special-case directories in the mount.
* Add them after sorting, so theyre always last. */
* Add them after sorting, so theyre always last.
* NOTE: If you change these, update the man page. */
const gchar * const well_known_repos[] =
{
".ostree/repo",

View File

@ -41,7 +41,6 @@ static GOptionEntry options[] =
{ NULL }
};
/* TODO: Add a man page. */
gboolean
ostree_builtin_create_usb (int argc,
char **argv,