Skip to content

Commit

Permalink
Add keyboard shortcut to remove pinned kernel
Browse files Browse the repository at this point in the history
* Plumb a key option to unset the default kernel for a BE

* Add help documentation, force two column view
  • Loading branch information
zdykstra committed Jun 20, 2021
1 parent 40dd0e3 commit 635d140
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
5 changes: 5 additions & 0 deletions 90zfsbootmenu/help-files/134/kernel-management.pod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

The operation will fail gracefully if the pool can not be set read/write.

[MOD+U] unset default
Inherit the ZFS property org.zfsbootmenu:kernel from a parent if present, otherwise unset the property.

The operation will fail gracefully if the pool can not be set read/write.

[MOD+L] view logs
View logs, as indicated by [!]. The indicator will be yellow for warning conditions and red for errors.

Expand Down
7 changes: 7 additions & 0 deletions 90zfsbootmenu/help-files/54/kernel-management.pod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
The operation will fail gracefully if the pool can
not be set read/write.

[MOD+U] unset default
Inherit the ZFS property org.zfsbootmenu:kernel from
a parent if present, otherwise unset the property.

The operation will fail gracefully if the pool can
not be set read/write.

[MOD+L] view logs
View logs, as indicated by [!]. The indicator will
be yellow for warning conditions and red for errors.
Expand Down
6 changes: 6 additions & 0 deletions 90zfsbootmenu/help-files/94/kernel-management.pod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

The operation will fail gracefully if the pool can not be set read/write.

[MOD+U] unset default
Inherit the ZFS property org.zfsbootmenu:kernel from a parent if present, otherwise unset
the property.

The operation will fail gracefully if the pool can not be set read/write.

[MOD+L] view logs
View logs, as indicated by [!]. The indicator will be yellow for warning conditions and red
for errors.
Expand Down
7 changes: 4 additions & 3 deletions 90zfsbootmenu/zfsbootmenu-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,11 @@ draw_kernel() {

zdebug "using kernels file: ${_kernels}"

header="$( header_wrap "[RETURN] boot" "[ESCAPE] back" "[CTRL+D] set default" "" \
"[CTRL+L] view logs" " " "[CTRL+H] help" )"
header="$( header_wrap "[RETURN] boot" "[ESCAPE] back" "" \
"[CTRL+D] set default" "[CTRL+U] unset default" "" \
"[CTRL+L] view logs" "[CTRL+H] help" )"

expects="--expect=alt-d"
expects="--expect=alt-d,alt-u"

if ! selected="$( HELP_SECTION=kernel-management ${FUZZYSEL} \
--prompt "${benv} > " --tac --with-nth=2 --header="${header}" \
Expand Down
3 changes: 3 additions & 0 deletions 90zfsbootmenu/zfsbootmenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ while true; do
IFS=' ' read -r fs kpath initrd <<< "${selected_kernel}"
set_default_kernel "${fs}" "${kpath}"
;;
"mod-u")
set_default_kernel "${fs}"
;;
esac
;;
"mod-p")
Expand Down
6 changes: 6 additions & 0 deletions pod/online/kernel-management.pod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ The ZFS property I<org.zfsbootmenu:kernel> is used to store the default kernel f

The operation will fail gracefully if the pool can not be set I<read/write>.

=item I<[MOD+U]> B<unset default>

Inherit the ZFS property I<org.zfsbootmenu:kernel> from a parent if present, otherwise unset the property.

The operation will fail gracefully if the pool can not be set I<read/write>.

=item I<[MOD+L]> B<view logs>

View logs, as indicated by I<[!]>. The indicator will be yellow for warning conditions and red for errors.
Expand Down

0 comments on commit 635d140

Please sign in to comment.