%.xml: %.adoc
@rm -f -- "$@"
- asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
+ asciidoc -f man/asciidoc.conf -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
# If ANOTRA_BIN not set, default to look for "npx" to run "npx antora". If we
# end up with undefined ANTORA_BIN (i.e. not set and npx not found), we'll give
log:
# In C terms, -Werror
failure_level: warn
+
+asciidoc:
+ extensions:
+ - ./doc_site/extensions/man.js
--- /dev/null
+/* Example use
+ *
+ * man:page[N,external]
+ *
+ * N: section
+ * external: optional arg, links to external man page
+ *
+ */
+module.exports = function(registry) {
+ registry.inlineMacro('man', function() {
+ var self = this
+ self.process(function (parent, target, attrs) {
+ let section = attrs.$positional[0] === undefined ? '' : attrs.$positional[0];
+ let internal = attrs.$positional[1] === undefined ? true : false
+ const attributes = {}
+ const content = `${target}(${section})`
+ let url
+ if (internal) {
+ url = `${target}.${section}.html`
+ } else {
+ url = `https://manpages.ubuntu.com/man${section}/${target}.${section}.html`
+ }
+ return self.createInline(parent, 'anchor',
+ content, { type: 'link', target: url, attributes })
+ })
+ })
+}
+
--- /dev/null
+# Borrowed from
+# https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/main/lib/man-inline-macro.rb
+
+require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
+
+include Asciidoctor
+
+# An inline macro that generates links to related man pages.
+#
+# Usage:
+#
+# man:gittutorial[7]
+#
+class ManInlineMacro < Extensions::InlineMacroProcessor
+ use_dsl
+
+ named :man
+ name_positional_attributes 'volnum'
+
+ def process parent, target, attrs
+ text = manname = target
+ suffix = ''
+ target = %(#{manname}.html)
+ if (volnum = attrs['volnum'])
+ suffix = %((#{volnum}))
+ end
+ if parent.document.basebackend? 'html'
+ parent.document.register :links, target
+ node = create_anchor parent, text, type: :link, target: target
+ elsif parent.document.backend == 'manpage'
+ node = create_inline parent, :quoted, manname, type: :strong
+ else
+ node = create_inline parent, :quoted, manname
+ end
+ suffix ? (create_inline parent, :quoted, %(#{node.convert}#{suffix})) : node
+ end
+end
+
+Extensions.register :uri_schemes do
+ inline_macro ManInlineMacro
+ # The following alias allows this macro to be used with the git man pages
+ inline_macro ManInlineMacro, :linkgit
+end
--- /dev/null
+## man: macro
+#
+# Usage: man:command[manpage-section]
+#
+# Note, {0} is the manpage section, while {target} is the command.
+#
+# Show man link as: <command>(<section>); if section is defined, else just show
+# the command.
+#
+# NOTE(ianw): lightly modified from
+# https://github.com/git/git/blob/master/Documentation/asciidoc.conf#L10
+
+[macros]
+(?su)[\\]?(?P<name>man):(?P<target>\S*?)\[(?P<attrlist>.*?)(,external)?\]=
+
+[attributes]
+asterisk=*
+plus=+
+caret=^
+startsb=[
+endsb=]
+backslash=\
+tilde=~
+apostrophe='
+backtick=`
+litdd=--
+
+ifdef::backend-docbook[]
+[man-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
+endif::backend-docbook[]
+
+ifdef::backend-docbook[]
+ifdef::doctype-manpage[]
+# The following two small workarounds insert a simple paragraph after screen
+[listingblock]
+<example><title>{title}</title>
+<literallayout class="monospaced">
+|
+</literallayout><simpara></simpara>
+{title#}</example>
+
+[verseblock]
+<formalpara{id? id="{id}"}><title>{title}</title><para>
+{title%}<literallayout{id? id="{id}"}>
+{title#}<literallayout>
+|
+</literallayout>
+{title#}</para></formalpara>
+{title%}<simpara></simpara>
+endif::doctype-manpage[]
+endif::backend-docbook[]
+
+ifdef::doctype-manpage[]
+ifdef::backend-docbook[]
+[header]
+template::[header-declarations]
+<refentry>
+<refmeta>
+<refentrytitle>{mantitle}</refentrytitle>
+<manvolnum>{manvolnum}</manvolnum>
+<refmiscinfo class="source">{mansource}</refmiscinfo>
+<refmiscinfo class="version">{manversion}</refmiscinfo>
+<refmiscinfo class="manual">{manmanual}</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>{manname}</refname>
+ <refpurpose>{manpurpose}</refpurpose>
+</refnamediv>
+endif::backend-docbook[]
+endif::doctype-manpage[]
+
+ifdef::backend-xhtml11[]
+[attributes]
+git-relative-html-prefix=
+[man-inlinemacro]
+<a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a>
+endif::backend-xhtml11[]
SEE ALSO
--------
-*dracut*(8)
+man:dracut[8]
Initramfs images are also called "initrd".
-For a complete list of kernel command line options see *dracut.cmdline*(7).
+For a complete list of kernel command line options see man:dracut.cmdline[7].
If you are dropped to an emergency shell, while booting your initramfs,
the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
**--enhanced-cpio**::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
- copy-on-write filesystems by using the copy_file_range(2) syscall via Rust's
+ copy-on-write filesystems by using the man:copy_file_range[2] syscall via Rust's
io::copy(). When specified, initramfs archives are also padded to ensure
optimal data alignment for extent sharing. To retain reflink data
deduplication benefits, this should be used alongside the **--no-compress**
SEE ALSO
--------
-*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)
+man:dracut.cmdline[7] man:dracut.conf[5] man:lsinitrd[1]
SEE ALSO
--------
-*dracut*(8) *bootup*(7)
+man:dracut[8] man:bootup[7,external]
NB: If systemd is included in the dracut initrd, dracut's built in
removable device keying support won't work. systemd will prompt for
a password from the console even if you've supplied **rd.luks.key**.
-You may be able to use standard systemd *fstab*(5) syntax to
+You may be able to use standard systemd man:fstab[5,external] syntax to
get the same effect. If you do need **rd.luks.key** to work,
you will have to exclude the "systemd" dracut module and any modules
-that depend on it. See *dracut.conf*(5) and
+that depend on it. See man:dracut.conf[5] and
https://bugzilla.redhat.com/show_bug.cgi?id=905683 for more
information.
The following options are supported by the 'network-legacy' dracut
module. Other network modules might support a slightly different set of
options; refer to the documentation of the specific network module in use. For
-NetworkManager, see *nm-initrd-generator*(8).
+NetworkManager, see man:nm-initrd-generator[8].
**ip=**__{dhcp|on|any|dhcp6|auto6|either6|link6|single-dhcp}__::
dhcp|on|any::: get ip from dhcp server from all interfaces. If netroot=dhcp,
**team=**__<teammaster>__:__<teamslaves>__[:__<teamrunner>__]::
Setup team device <teammaster> on top of <teamslaves>.
<teamslaves> is a comma-separated list of physical (ethernet) interfaces.
- <teamrunner> is the runner type to be used (see *teamd.conf*(5)); defaults to
+ <teamrunner> is the runner type to be used (see man:teamd.conf[5,external]); defaults to
activebackup.
Team without parameters assumes
team=team0:eth0,eth1:activebackup
SEE ALSO
--------
-*dracut*(8) *dracut.conf*(5)
+man:dracut[8] man:dracut.conf[5]
See Also
--------
-*dracut*(8) *dracut.cmdline*(7)
+man:dracut[8] man:dracut.cmdline[7]
SEE ALSO
--------
-*dracut*(8)
+man:dracut[8]
== Adding dracut Modules
Some dracut modules are turned off by default and have to be activated manually.
You can do this by adding the dracut modules to the configuration file
-_/etc/dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_. See *dracut.conf*(5).
+_/etc/dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_. See man:dracut.conf[5]
You can also add dracut modules on the command line
by using the `-a` or `--add` option:
Sometimes you don't want a dracut module to be included for reasons of speed,
size or functionality. To do this, either specify the omit_dracutmodules
variable in the _dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_ configuration
-file (see *dracut.conf*(5)), or use the `-o` or `--omit` option
+file (see man:dracut.conf[5]) or use the `-o` or `--omit` option
on the command line:
[,console]
If you need a special kernel module in the initramfs, which is not
automatically picked up by dracut, you have the use the --add-drivers option
on the command line or the drivers variable in the _/etc/dracut.conf_
-or _/etc/dracut.conf.d/myconf.conf_ configuration file (see *dracut.conf*(5)):
+or _/etc/dracut.conf.d/myconf.conf_ configuration file (see man:dracut.conf[5]):
[,console]
----
root-path option. See <<NetworkBoot>>.
For a full reference of all kernel command line parameters,
-see *dracut.cmdline*(7).
+see man:dracut.cmdline[7].
To get a quick start for the suitable kernel command line on your system,
use the __--print-cmdline__ option:
[[additional-dracut-boot-parameters]]
=== Additional dracut boot parameters
-For more debugging options, see *dracut.cmdline*(7).
+For more debugging options, see man:dracut.cmdline[7].
[[debugging-dracut-on-shutdown]]
SEE ALSO
--------
-*dracut*(8)
+man:dracut[8]