Skip to content

Commit deefabd

Browse files
committed
release,recovery: add tools to images
* Add ca-certs to recovery image, so cURL can connect over HTTPS * Add sgdisk to recovery image * Add zbm-kcl / zbm-kcl.8 documentation to release and recovery images Closes #400
1 parent 951db73 commit deefabd

File tree

8 files changed

+409
-4
lines changed

8 files changed

+409
-4
lines changed

dracut/module-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ install() {
113113
inst_simple "${_libexec}" "/libexec/$( basename "${_libexec}" )" || _ret=$?
114114
done
115115

116-
# User-facing utilities, useful for running in a recover shell
116+
# User-facing utilities, useful for running in a recovery shell
117117
for _bin in "${zfsbootmenu_module_root}"/bin/*; do
118118
inst_simple "${_bin}" "/bin/$( basename "${_bin}" )" || _ret=$?
119119
done

etc/zfsbootmenu/recovery.conf.d/recovery.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Disk manipulation
2-
install_optional_items+=" /bin/gdisk /bin/parted /bin/wipefs /bin/kpartx "
2+
install_optional_items+=" /bin/gdisk /bin/parted /bin/wipefs /bin/kpartx /bin/sgdisk"
33

44
# Filesystem creation
55
install_optional_items+=" /bin/mkfs.vfat /bin/mkfs.ext4 "
@@ -13,3 +13,6 @@ install_optional_items+=" /bin/cryptsetup "
1313
# Networking
1414
install_optional_items+=" /bin/ip /bin/curl /bin/dhclient /sbin/dhclient-script /bin/ssh "
1515
add_dracutmodules+=" kernel-network-modules qemu-net "
16+
17+
# SSL bundle for cURL
18+
install_optional_items+=" /etc/ssl/certs/ca-certificates.crt "

etc/zfsbootmenu/release.conf.d/common.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
zfsbootmenu_teardown+=" /zbm/contrib/xhci-teardown.sh "
22
zfsbootmenu_early_setup+=" /zbm/contrib/10-console-init.sh /zbm/contrib/20-console-autosize.sh "
33

4+
# zbm-kcl
5+
install_optional_items+=" /zbm/bin/zbm-kcl "
6+
47
install_optional_items+=" /etc/zbm-commit-hash "
58

69
omit_dracutmodules+=" crypt-ssh nfs lunmask "

releng/rst2help.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66
td="zfsbootmenu/help-files"
77
for size in 52 92 132 ; do
88
rm "${td}/${size}"/* >/dev/null 2>&1 || /bin/true
9-
for doc in docs/online/*.rst docs/man/zfsbootmenu.7.rst; do
9+
for doc in docs/online/*.rst docs/man/zfsbootmenu.7.rst docs/man/zbm-kcl.8.rst; do
1010
[ -d "${td}/${size}" ] || mkdir -p "${td}/${size}"
1111
file="$( basename -s .rst "${doc}" ).ansi"
1212
echo "Converting ${doc} for ${size} columns"
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
zbm-kcl
2+
3+
SYNOPSIS
4+
5+
zbm-kcl [OPTION]... [FILESYSTEM|EFI_EXECUTABLE]
6+
7+
DESCRIPTION
8+
9+
The zbm-kcl utility allows review and manipulation of the org.zfsbootmenu:commandline property on ZFS filesystems or the
10+
.cmdline section encoded within ZFSBootMenu EFI executables. ZFSBootMenu reads the property org.zfsbootmenu:commandline, as
11+
set or inherited on each environment that it recognizes, to set the command line for the kernel that it boots. The
12+
ZFSBootMenu EFI executable reads its own .cmdline section to parse options that control the behavior of ZFSBootMenu itself.
13+
14+
The final argument is treated as a ZFS filesystem as long as one exists with the specified name. If a matching filesystem cannot
15+
be found, the argument is treated as an EFI executable. To force zbm-kcl to treat the final argument as a relative path to
16+
an EFI executable even when a ZFS filesystem exists with the same name, prefix the path with ./.
17+
18+
When neither a filesystem nor an EFI executable is specified, zbm-kcl will attempt to determine the root filesystem and operate
19+
on that.
20+
21+
If an EFI executable of - is specified, stdin will be read as an EFI executable.
22+
23+
With no options specified, zbm-kcl will print the current value of org.zfsbootmenu:commandline of the selected filesystem or the
24+
.cmdline section of the named EFI executable and exit.
25+
26+
OPTIONS
27+
28+
-a argument
29+
30+
Append the value of argument to the kernel command line. The value of argument can be a simple variable name for Boolean
31+
arguments or may take the form var=value to provide a non-Boolean value. Multiple command-line arguments may be
32+
accumulated into a single argument. If the value of any variable value contains spaces, it should be surrounded by
33+
double quotes. In that case, surround the entire argument in single quotes to ensure that the double quotes are recorded
34+
in the property:
35+
36+
zbm-kcl -a 'variable="some argument with spaces"'
37+
38+
This argument may be repeated any number of times.
39+
40+
-r argument
41+
42+
Remove argument from the kernel command line. The value of argument can be a simple variable name, in which case all arguments
43+
of the form argument or argument=<arbitrary-value> will be stripped. Alternatively, a specific argument may be selected
44+
by specifying argument=<specific-value>.
45+
46+
This argument may be repeated any number of times.
47+
48+
Note
49+
50+
All removal options are processed before any append options are processed, making it possible to replace an existing
51+
argument by combining removal and append options into a single invocation of zbm-kcl.
52+
53+
-e
54+
55+
Open the contents of the command-line in an interactive editor. If the environment defines $EDITOR, that will be used;
56+
otherwise, vi will be used by default. After making changes as desired, overwrite the (temporary) file that was opened
57+
and quit the editor. The contents of the saved file will be written by zbm-kcl as the new command line.
58+
59+
-d
60+
61+
Delete the command-line property.
62+
63+
For a ZFS filesystem, this is accomplished by calling
64+
65+
zfs inherit org.zfsbootmenu:commandline <filesystem>
66+
67+
to allow the boot environment to inherit any command-line property that may be defined by some parent.
68+
69+
For a ZFSBootMenu EFI executable, the .cmdline section will be stripped.
70+
71+
-o destination
72+
73+
Save the modified command line to destination rather than back to the original source. When the source is a ZFS filesystem,
74+
the destination must also be a valid ZFS filesystem. When the source is an EFI executable, the destination will be
75+
treated as a file; a special EFI destination of - will cause the file to be written to stdout.
76+
77+
EXAMPLES
78+
79+
Change the loglevel value on the currently booted environment by removing any existing value from the command line and appending
80+
the desired argument:
81+
82+
zbm-kcl -a loglevel=7 -r loglevel
83+
84+
Delete the entire command line from the zroot/ROOT/void boot environment, allowing it to inherit a command line set at zroot or
85+
zroot/ROOT if either of these defines a value:
86+
87+
zbm-kcl -d zroot/ROOT/void
88+
89+
Allow interactive editing of the command line on the zroot/ROOT filesystem, but save the resulting changes to zroot/ROOT/void
90+
rather than back to zroot/ROOT:
91+
92+
zbm-kcl -e -o zroot/ROOT/void zroot/ROOT
93+
94+
Review the current command line embedded in the EFI file /boot/efi/EFI/zfsbootmenu/zfsbootmenu.EFI:
95+
96+
zbm-kcl /boot/efi/EFI/zfsbootmenu/zfsbootmenu.EFI
97+
98+
Fetch the official ZFSBootMenu release EFI executable, customizing the menu timeout and saving the result to
99+
zfsbootmenu-custom.EFI:
100+
101+
curl -L https://get.zfsbootmenu.org/efi | \
102+
zbm-kcl -a zbm.timeout=15 -r zbm.timeout -o zfsbootmenu-slow.EFI -
103+
104+
SEE ALSO
105+
106+
zfsbootmenu(7)
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
zbm-kcl
2+
3+
SYNOPSIS
4+
5+
zbm-kcl [OPTION]... [FILESYSTEM|EFI_EXECUTABLE]
6+
7+
DESCRIPTION
8+
9+
The zbm-kcl utility allows review and
10+
manipulation of the org.zfsbootmenu:com-
11+
mandline property on ZFS filesystems or the
12+
.cmdline section encoded within ZFSBootMenu
13+
EFI executables. ZFSBootMenu reads the
14+
property org.zfsbootmenu:commandline, as set
15+
or inherited on each environment that it
16+
recognizes, to set the command line for the
17+
kernel that it boots. The ZFSBootMenu EFI
18+
executable reads its own .cmdline section to
19+
parse options that control the behavior of
20+
ZFSBootMenu itself.
21+
22+
The final argument is treated as a ZFS
23+
filesystem as long as one exists with the
24+
specified name. If a matching filesystem
25+
cannot be found, the argument is treated as
26+
an EFI executable. To force zbm-kcl to treat
27+
the final argument as a relative path to an
28+
EFI executable even when a ZFS filesystem
29+
exists with the same name, prefix the path
30+
with ./.
31+
32+
When neither a filesystem nor an EFI executable
33+
is specified, zbm-kcl will attempt to
34+
determine the root filesystem and operate on
35+
that.
36+
37+
If an EFI executable of - is specified, stdin
38+
will be read as an EFI executable.
39+
40+
With no options specified, zbm-kcl will print
41+
the current value of
42+
org.zfsbootmenu:commandline of the selected
43+
filesystem or the .cmdline section of the
44+
named EFI executable and exit.
45+
46+
OPTIONS
47+
48+
-a argument
49+
50+
Append the value of argument to the kernel
51+
command line. The value of argument can
52+
be a simple variable name for Boolean
53+
arguments or may take the form var=value
54+
to provide a non-Boolean value. Multiple
55+
command-line arguments may be
56+
accumulated into a single argument. If
57+
the value of any variable value contains
58+
spaces, it should be surrounded by
59+
double quotes. In that case, surround
60+
the entire argument in single quotes to
61+
ensure that the double quotes are
62+
recorded in the property:
63+
64+
zbm-kcl -a 'variable="some argument with spaces"'
65+
66+
This argument may be repeated any number of
67+
times.
68+
69+
-r argument
70+
71+
Remove argument from the kernel command line.
72+
The value of argument can be a simple
73+
variable name, in which case all
74+
arguments of the form argument or
75+
argument=<arbitrary-value> will be
76+
stripped. Alternatively, a specific
77+
argument may be selected by specifying
78+
argument=<specific-value>.
79+
80+
This argument may be repeated any number of
81+
times.
82+
83+
Note
84+
85+
All removal options are processed before any
86+
append options are processed, making
87+
it possible to replace an existing
88+
argument by combining removal and
89+
append options into a single
90+
invocation of zbm-kcl.
91+
92+
-e
93+
94+
Open the contents of the command-line in an
95+
interactive editor. If the environment
96+
defines $EDITOR, that will be used;
97+
otherwise, vi will be used by default.
98+
After making changes as desired,
99+
overwrite the (temporary) file that was
100+
opened and quit the editor. The contents
101+
of the saved file will be written by
102+
zbm-kcl as the new command line.
103+
104+
-d
105+
106+
Delete the command-line property.
107+
108+
For a ZFS filesystem, this is accomplished by
109+
calling
110+
111+
zfs inherit org.zfsbootmenu:commandline <filesystem>
112+
113+
to allow the boot environment to inherit any
114+
command-line property that may be
115+
defined by some parent.
116+
117+
For a ZFSBootMenu EFI executable, the .cmdline
118+
section will be stripped.
119+
120+
-o destination
121+
122+
Save the modified command line to destination
123+
rather than back to the original source.
124+
When the source is a ZFS filesystem, the
125+
destination must also be a valid ZFS
126+
filesystem. When the source is an EFI
127+
executable, the destination will be
128+
treated as a file; a special EFI
129+
destination of - will cause the file to
130+
be written to stdout.
131+
132+
EXAMPLES
133+
134+
Change the loglevel value on the currently
135+
booted environment by removing any existing
136+
value from the command line and appending
137+
the desired argument:
138+
139+
zbm-kcl -a loglevel=7 -r loglevel
140+
141+
Delete the entire command line from the
142+
zroot/ROOT/void boot environment, allowing
143+
it to inherit a command line set at zroot or
144+
zroot/ROOT if either of these defines a
145+
value:
146+
147+
zbm-kcl -d zroot/ROOT/void
148+
149+
Allow interactive editing of the command line on
150+
the zroot/ROOT filesystem, but save the
151+
resulting changes to zroot/ROOT/void rather
152+
than back to zroot/ROOT:
153+
154+
zbm-kcl -e -o zroot/ROOT/void zroot/ROOT
155+
156+
Review the current command line embedded in the
157+
EFI file /boot/efi/EFI/zfsbootmenu/zfsb-
158+
ootmenu.EFI:
159+
160+
zbm-kcl /boot/efi/EFI/zfsbootmenu/zfsbootmenu.EFI
161+
162+
Fetch the official ZFSBootMenu release EFI
163+
executable, customizing the menu timeout and
164+
saving the result to zfsbootmenu-custom.EFI:
165+
166+
curl -L https://get.zfsbootmenu.org/efi | \
167+
zbm-kcl -a zbm.timeout=15 -r zbm.timeout -o zfsbootmenu-slow.EFI -
168+
169+
SEE ALSO
170+
171+
zfsbootmenu(7)

0 commit comments

Comments
 (0)