xref: /illumos-gate/usr/src/man/man1/etdump.1 (revision 5c0b3261bd16d5eb356ffc864b6eab76c2e760e5)
1.\" Copyright (c) 2018 iXsystems, Inc
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd April 3, 2018
26.Dt ETDUMP 1
27.Os
28.Sh NAME
29.Nm etdump
30.Nd Dump El Torito boot catalog information from ISO images
31.Sh SYNOPSIS
32.Nm
33.Op Fl f Ar format
34.Op Fl o Ar file
35.Ar
36.Sh DESCRIPTION
37This program reads El Torito boot catalog information from an ISO image and
38outputs it in various formats.
39It can be used to check the catalog in an image or to output catalog data in
40a format that can be used by other tools such as shell scripts.
41.Pp
42Supported options are:
43.Bl -tag -width flag
44.It Fl f Ar format Fl -format Ar format
45Select the output format.
46Supported output formats are:
47.Bl -tag -width shell -offset indent
48.It Sy text
49Human-readable text (default)
50.It Sy shell
51Each boot entry is emitted as a string suitable for passing to a sh-compatible
52eval command.
53The variables emitted are:
54.Bl -tag -width et_platform -offset indent
55.It et_platform
56The platform ID from the section header.
57Set to 'default' for the initial (default) entry.
58.It et_system
59The system ID from the boot entry.
60.It et_lba
61The starting LBA (2048-byte blocks) of the boot image.
62.It et_sectors
63The number of sectors (512-byte sectors) that comprise the boot image.
64.El
65.El
66.It Fl o Ar file Fl -output Ar file
67Write output to
68.Ar file .
69If '-' is specified then standard out is used.
70.El
71.Sh EXAMPLES
72To see what entries are in a given boot catalog run
73.Nm
74passing the filename of the image as an argument like so:
75.Bd -literal -offset indent
76% etdump bootonly.iso
77Image in bootonly.iso
78Default entry
79	System i386
80	Start LBA 420 (0x1a4), sector count 4 (0x4)
81	Media type: no emulation
82
83Section header: efi, final
84	Section entry
85		System i386
86		Start LBA 20 (0x14), sector count 1600 (0x640)
87		Media type: no emulation
88.Ed
89.Pp
90To use the output in a shell script a for loop can be used to iterate over the
91entries returned using eval:
92.Bd -literal -offset indent
93for entry in `etdump --format shell bootonly.iso`; do
94	eval $entry
95	echo $et_platform $et_system $et_lba $et_sectors
96done
97.Ed
98