xref: /src/usr.bin/etdump/etdump.1 (revision 283be95ea29abd7f867e4084bafe368c47f6c038)
1283be95eSAlexander Ziaee.\"
2283be95eSAlexander Ziaee.\" SPDX-License-Identifier: BSD-2-Clause
3283be95eSAlexander Ziaee.\"
4158d2fcdSBenno Rice.\" Copyright (c) 2018 iXsystems, Inc
5158d2fcdSBenno Rice.\" All rights reserved.
6158d2fcdSBenno Rice.\"
7158d2fcdSBenno Rice.\" Redistribution and use in source and binary forms, with or without
8158d2fcdSBenno Rice.\" modification, are permitted provided that the following conditions
9158d2fcdSBenno Rice.\" are met:
10158d2fcdSBenno Rice.\" 1. Redistributions of source code must retain the above copyright
11158d2fcdSBenno Rice.\"    notice, this list of conditions and the following disclaimer.
12158d2fcdSBenno Rice.\" 2. Redistributions in binary form must reproduce the above copyright
13158d2fcdSBenno Rice.\"    notice, this list of conditions and the following disclaimer in the
14158d2fcdSBenno Rice.\"    documentation and/or other materials provided with the distribution.
15158d2fcdSBenno Rice.\"
16158d2fcdSBenno Rice.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17158d2fcdSBenno Rice.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18158d2fcdSBenno Rice.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19158d2fcdSBenno Rice.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20158d2fcdSBenno Rice.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21158d2fcdSBenno Rice.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22158d2fcdSBenno Rice.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23158d2fcdSBenno Rice.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24158d2fcdSBenno Rice.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25158d2fcdSBenno Rice.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26158d2fcdSBenno Rice.\" SUCH DAMAGE.
27158d2fcdSBenno Rice.\"
28283be95eSAlexander Ziaee.Dd January 18, 2025
29283be95eSAlexander Ziaee.Dt ETDUMP 1
30158d2fcdSBenno Rice.Os
31158d2fcdSBenno Rice.Sh NAME
32158d2fcdSBenno Rice.Nm etdump
33283be95eSAlexander Ziaee.Nd dump ISO-9660 El Torito boot catalog information
34158d2fcdSBenno Rice.Sh SYNOPSIS
35158d2fcdSBenno Rice.Nm
36158d2fcdSBenno Rice.Op Fl f Ar format
37158d2fcdSBenno Rice.Op Fl o Ar file
38158d2fcdSBenno Rice.Ar
39158d2fcdSBenno Rice.Sh DESCRIPTION
40283be95eSAlexander ZiaeeThis program reads El Torito boot catalog information
41283be95eSAlexander Ziaeefrom an ISO-9660 image and outputs it in various formats.
42283be95eSAlexander ZiaeeIt can be used to check the catalog in an image or
43283be95eSAlexander Ziaeeto output catalog data in a format that can be used by other tools
44283be95eSAlexander Ziaeesuch as shell scripts.
45158d2fcdSBenno Rice.Pp
46158d2fcdSBenno RiceSupported options are:
47158d2fcdSBenno Rice.Bl -tag -width flag
48283be95eSAlexander Ziaee.It Fl f Ar format | Fl -format Ar format
49158d2fcdSBenno RiceSelect the output format.
50158d2fcdSBenno RiceSupported output formats are:
51283be95eSAlexander Ziaee.Bl -tag -width indent
52283be95eSAlexander Ziaee.It Cm text
53158d2fcdSBenno RiceHuman-readable text (default)
54283be95eSAlexander Ziaee.It Cm shell
55283be95eSAlexander ZiaeeEach boot entry is emitted as a string
56283be95eSAlexander Ziaeesuitable for passing to a sh-compatible eval command.
57158d2fcdSBenno RiceThe variables emitted are:
58283be95eSAlexander Ziaee.Bl -tag -width "et_platform"
59283be95eSAlexander Ziaee.It Dv et_platform
60158d2fcdSBenno RiceThe platform ID from the section header.
61158d2fcdSBenno RiceSet to 'default' for the initial (default) entry.
62283be95eSAlexander Ziaee.It Dv et_system
63158d2fcdSBenno RiceThe system ID from the boot entry.
64283be95eSAlexander Ziaee.It Dv et_lba
65158d2fcdSBenno RiceThe starting LBA (2048-byte blocks) of the boot image.
66283be95eSAlexander Ziaee.It Dv et_sectors
67158d2fcdSBenno RiceThe number of sectors (512-byte sectors) that comprise the boot image.
68158d2fcdSBenno Rice.El
69158d2fcdSBenno Rice.El
70283be95eSAlexander Ziaee.It Fl o Ar file | Fl -output Ar file
71158d2fcdSBenno RiceWrite output to
72158d2fcdSBenno Rice.Ar file .
73283be95eSAlexander ZiaeeIf
74283be95eSAlexander Ziaee.Ql -
75283be95eSAlexander Ziaeeis specified then standard out is used.
76158d2fcdSBenno Rice.El
77158d2fcdSBenno Rice.Sh EXAMPLES
78158d2fcdSBenno RiceTo see what entries are in a given boot catalog run
79158d2fcdSBenno Rice.Nm
80158d2fcdSBenno Ricepassing the filename of the image as an argument like so:
81158d2fcdSBenno Rice.Bd -literal -offset indent
82158d2fcdSBenno Rice% etdump bootonly.iso
83158d2fcdSBenno RiceImage in bootonly.iso
84158d2fcdSBenno RiceDefault entry
85158d2fcdSBenno Rice	System i386
86158d2fcdSBenno Rice	Start LBA 420 (0x1a4), sector count 4 (0x4)
87158d2fcdSBenno Rice	Media type: no emulation
88158d2fcdSBenno Rice
89158d2fcdSBenno RiceSection header: efi, final
90158d2fcdSBenno Rice	Section entry
91158d2fcdSBenno Rice		System i386
92158d2fcdSBenno Rice		Start LBA 20 (0x14), sector count 1600 (0x640)
93158d2fcdSBenno Rice		Media type: no emulation
94158d2fcdSBenno Rice.Ed
95158d2fcdSBenno Rice.Pp
96283be95eSAlexander ZiaeeTo use the output in a shell script a for loop can be used
97283be95eSAlexander Ziaeeto iterate over the entries returned using eval:
98158d2fcdSBenno Rice.Bd -literal -offset indent
99158d2fcdSBenno Ricefor entry in `etdump --format shell bootonly.iso`; do
100158d2fcdSBenno Rice	eval $entry
101158d2fcdSBenno Rice	echo $et_platform $et_system $et_lba $et_sectors
102158d2fcdSBenno Ricedone
103158d2fcdSBenno Rice.Ed
104283be95eSAlexander Ziaee.Sh SEE ALSO
105283be95eSAlexander Ziaee.Xr cd9660 4
106158d2fcdSBenno Rice.Sh HISTORY
107158d2fcdSBenno RiceThe
108158d2fcdSBenno Rice.Nm
109158d2fcdSBenno Riceutility first appeared in
1105ee52e15SBenno Rice.Fx 11.2
111