|
| 1 | +[1mzbm-kcl[0m |
| 2 | + |
| 3 | + [1mSYNOPSIS[0m |
| 4 | + |
| 5 | + [1mzbm-kcl[0m [OPTION]... [FILESYSTEM|EFI_EXECUTABLE] |
| 6 | + |
| 7 | + [1mDESCRIPTION[0m |
| 8 | + |
| 9 | + The [1mzbm-kcl[0m utility allows review and |
| 10 | + manipulation of the [33morg.zfsbootmenu:com- |
| 11 | + mandline[0m property on ZFS filesystems or the |
| 12 | + [33m.cmdline[0m section encoded within ZFSBootMenu |
| 13 | + EFI executables. ZFSBootMenu reads the |
| 14 | + property [33morg.zfsbootmenu:commandline[0m, 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 [33m.cmdline[0m 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 [1mzbm-kcl[0m 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 [33m./[0m. |
| 31 | + |
| 32 | + When neither a filesystem nor an EFI executable |
| 33 | + is specified, [1mzbm-kcl[0m will attempt to |
| 34 | + determine the root filesystem and operate on |
| 35 | + that. |
| 36 | + |
| 37 | + If an EFI executable of [33m-[0m is specified, [33mstdin[0m |
| 38 | + will be read as an EFI executable. |
| 39 | + |
| 40 | + With no options specified, [1mzbm-kcl[0m will print |
| 41 | + the current value of |
| 42 | + [33morg.zfsbootmenu:commandline[0m of the selected |
| 43 | + filesystem or the [33m.cmdline[0m section of the |
| 44 | + named EFI executable and exit. |
| 45 | + |
| 46 | + [1mOPTIONS[0m |
| 47 | + |
| 48 | + [1m-a[0m [33margument[0m |
| 49 | + |
| 50 | + Append the value of [33margument[0m to the kernel |
| 51 | + command line. The value of [33margument[0m can |
| 52 | + be a simple variable name for Boolean |
| 53 | + arguments or may take the form [33mvar=value[0m |
| 54 | + to provide a non-Boolean value. Multiple |
| 55 | + command-line arguments may be |
| 56 | + accumulated into a single [33margument[0m. 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 | + [1m-r[0m [33margument[0m |
| 70 | + |
| 71 | + Remove [33margument[0m from the kernel command line. |
| 72 | + The value of [33margument[0m can be a simple |
| 73 | + variable name, in which case all |
| 74 | + arguments of the form [33margument[0m or |
| 75 | + [33margument=<arbitrary-value>[0m will be |
| 76 | + stripped. Alternatively, a specific |
| 77 | + argument may be selected by specifying |
| 78 | + [33margument=<specific-value>[0m. |
| 79 | + |
| 80 | + This argument may be repeated any number of |
| 81 | + times. |
| 82 | + |
| 83 | + [1mNote[0m |
| 84 | + |
| 85 | + All removal options are processed [33mbefore[0m 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 [1mzbm-kcl[0m. |
| 91 | + |
| 92 | + [1m-e[0m |
| 93 | + |
| 94 | + Open the contents of the command-line in an |
| 95 | + interactive editor. If the environment |
| 96 | + defines [33m$EDITOR[0m, that will be used; |
| 97 | + otherwise, [1mvi[0m 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 | + [1mzbm-kcl[0m as the new command line. |
| 103 | + |
| 104 | + [1m-d[0m |
| 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 [33m.cmdline[0m |
| 118 | + section will be stripped. |
| 119 | + |
| 120 | + [1m-o[0m [33mdestination[0m |
| 121 | + |
| 122 | + Save the modified command line to [33mdestination[0m |
| 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 | + [33mdestination[0m of [33m-[0m will cause the file to |
| 130 | + be written to [33mstdout[0m. |
| 131 | + |
| 132 | + [1mEXAMPLES[0m |
| 133 | + |
| 134 | + Change the [33mloglevel[0m 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 | + [33mzroot/ROOT/void[0m boot environment, allowing |
| 143 | + it to inherit a command line set at [33mzroot[0m or |
| 144 | + [33mzroot/ROOT[0m 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 [33mzroot/ROOT[0m filesystem, but save the |
| 151 | + resulting changes to [33mzroot/ROOT/void[0m rather |
| 152 | + than back to [33mzroot/ROOT[0m: |
| 153 | + |
| 154 | + zbm-kcl -e -o zroot/ROOT/void zroot/ROOT |
| 155 | + |
| 156 | + Review the current command line embedded in the |
| 157 | + EFI file [33m/boot/efi/EFI/zfsbootmenu/zfsb- |
| 158 | + ootmenu.EFI[0m: |
| 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 [33mzfsbootmenu-custom.EFI[0m: |
| 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 | + [1mSEE ALSO[0m |
| 170 | + |
| 171 | + zfsbootmenu(7) |
0 commit comments