Thanks for your bugreport. I started on reproducing this but the current instructions have an isssue. The command "sudo sh -c 'cat /dev/null > kernel.efi'" destroys the current kernel (the good kernel). So trying to revert to that will always fail.
To simulate a bad kernel boot you will have to stop the shutdown after the refresh with "shutdown -c" and then use "sudo sh -c "cat /dev/null > /run/mnt/ubuntu-boot/EFI/ubuntu/try-kernel.efi""
With that I see that the try-boot fails and I need to power-cycle the system in grub. then it rollsback though:
"""
mvo@ubuntu:~$ snap change 6
Status Spawn Ready Summary
Done today at 10:41 UTC today at 10:47 UTC Ensure prerequisites for "pc-kernel" are available
Undone today at 10:41 UTC today at 10:47 UTC Download snap "pc-kernel" (1021) from channel "22/stable"
Done today at 10:41 UTC today at 10:47 UTC Fetch and check assertions for snap "pc-kernel" (1021)
Undone today at 10:41 UTC today at 10:47 UTC Mount snap "pc-kernel" (1021)
Undone today at 10:41 UTC today at 10:47 UTC Run pre-refresh hook of "pc-kernel" snap if present
Undone today at 10:41 UTC today at 10:47 UTC Stop snap "pc-kernel" services
Undone today at 10:41 UTC today at 10:47 UTC Remove aliases for snap "pc-kernel"
Undone today at 10:41 UTC today at 10:47 UTC Make current revision for snap "pc-kernel" unavailable
Done today at 10:41 UTC today at 10:47 UTC Update assets from kernel "pc-kernel" (1021)
Undone today at 10:41 UTC today at 10:47 UTC Copy snap "pc-kernel" data
Undone today at 10:41 UTC today at 10:47 UTC Setup snap "pc-kernel" (1021) security profiles
Undone today at 10:41 UTC today at 10:47 UTC Make snap "pc-kernel" (1021) available to the system
Error today at 10:41 UTC today at 10:47 UTC Automatically connect eligible plugs and slots of snap "pc-kernel"
Hold today at 10:41 UTC today at 10:47 UTC Set automatic aliases for snap "pc-kernel"
Hold today at 10:41 UTC today at 10:47 UTC Setup snap "pc-kernel" aliases
Hold today at 10:41 UTC today at 10:47 UTC Run post-refresh hook of "pc-kernel" snap if present
Hold today at 10:41 UTC today at 10:47 UTC Start snap "pc-kernel" (1021) services
Hold today at 10:41 UTC today at 10:47 UTC Clean up "pc-kernel" (1021) install
Hold today at 10:41 UTC today at 10:47 UTC Run configure hook of "pc-kernel" snap if present
Hold today at 10:41 UTC today at 10:47 UTC Run health check of "pc-kernel" snap
Done today at 10:41 UTC today at 10:47 UTC Handling re-refresh of "pc-kernel" as needed
......................................................................
Update assets from kernel "pc-kernel" (1021)
2022-06-20T10:42:43Z INFO No gadget assets update needed
......................................................................
Make snap "pc-kernel" (1021) available to the system
2022-06-20T10:42:43Z INFO Requested system restart.
......................................................................
Automatically connect eligible plugs and slots of snap "pc-kernel"
2022-06-20T10:42:43Z INFO Waiting for automatic snapd restart...
2022-06-20T10:42:43Z INFO Waiting for automatic snapd restart...
2022-06-20T10:42:44Z INFO Waiting for automatic snapd restart...
2022-06-20T10:42:44Z INFO Waiting for automatic snapd restart...
2022-06-20T10:42:45Z INFO Waiting for automatic snapd restart...
2022-06-20T10:42:45Z INFO Waiting for automatic snapd restart...
2022-06-20T10:47:05Z ERROR cannot finish pc-kernel installation, there was a rollback across reboot
Thanks for your bugreport. I started on reproducing this but the current instructions have an isssue. The command "sudo sh -c 'cat /dev/null > kernel.efi'" destroys the current kernel (the good kernel). So trying to revert to that will always fail.
To simulate a bad kernel boot you will have to stop the shutdown after the refresh with "shutdown -c" and then use "sudo sh -c "cat /dev/null > /run/mnt/ ubuntu- boot/EFI/ ubuntu/ try-kernel. efi""
With that I see that the try-boot fails and I need to power-cycle the system in grub. then it rollsback though:
"""
mvo@ubuntu:~$ snap change 6
Status Spawn Ready Summary
Done today at 10:41 UTC today at 10:47 UTC Ensure prerequisites for "pc-kernel" are available
Undone today at 10:41 UTC today at 10:47 UTC Download snap "pc-kernel" (1021) from channel "22/stable"
Done today at 10:41 UTC today at 10:47 UTC Fetch and check assertions for snap "pc-kernel" (1021)
Undone today at 10:41 UTC today at 10:47 UTC Mount snap "pc-kernel" (1021)
Undone today at 10:41 UTC today at 10:47 UTC Run pre-refresh hook of "pc-kernel" snap if present
Undone today at 10:41 UTC today at 10:47 UTC Stop snap "pc-kernel" services
Undone today at 10:41 UTC today at 10:47 UTC Remove aliases for snap "pc-kernel"
Undone today at 10:41 UTC today at 10:47 UTC Make current revision for snap "pc-kernel" unavailable
Done today at 10:41 UTC today at 10:47 UTC Update assets from kernel "pc-kernel" (1021)
Undone today at 10:41 UTC today at 10:47 UTC Copy snap "pc-kernel" data
Undone today at 10:41 UTC today at 10:47 UTC Setup snap "pc-kernel" (1021) security profiles
Undone today at 10:41 UTC today at 10:47 UTC Make snap "pc-kernel" (1021) available to the system
Error today at 10:41 UTC today at 10:47 UTC Automatically connect eligible plugs and slots of snap "pc-kernel"
Hold today at 10:41 UTC today at 10:47 UTC Set automatic aliases for snap "pc-kernel"
Hold today at 10:41 UTC today at 10:47 UTC Setup snap "pc-kernel" aliases
Hold today at 10:41 UTC today at 10:47 UTC Run post-refresh hook of "pc-kernel" snap if present
Hold today at 10:41 UTC today at 10:47 UTC Start snap "pc-kernel" (1021) services
Hold today at 10:41 UTC today at 10:47 UTC Clean up "pc-kernel" (1021) install
Hold today at 10:41 UTC today at 10:47 UTC Run configure hook of "pc-kernel" snap if present
Hold today at 10:41 UTC today at 10:47 UTC Run health check of "pc-kernel" snap
Done today at 10:41 UTC today at 10:47 UTC Handling re-refresh of "pc-kernel" as needed
....... ....... ....... ....... ....... ....... ....... ....... ....... .......
Update assets from kernel "pc-kernel" (1021)
2022-06- 20T10:42: 43Z INFO No gadget assets update needed
....... ....... ....... ....... ....... ....... ....... ....... ....... .......
Make snap "pc-kernel" (1021) available to the system
2022-06- 20T10:42: 43Z INFO Requested system restart.
....... ....... ....... ....... ....... ....... ....... ....... ....... .......
Automatically connect eligible plugs and slots of snap "pc-kernel"
2022-06- 20T10:42: 43Z INFO Waiting for automatic snapd restart... 20T10:42: 43Z INFO Waiting for automatic snapd restart... 20T10:42: 44Z INFO Waiting for automatic snapd restart... 20T10:42: 44Z INFO Waiting for automatic snapd restart... 20T10:42: 45Z INFO Waiting for automatic snapd restart... 20T10:42: 45Z INFO Waiting for automatic snapd restart... 20T10:47: 05Z ERROR cannot finish pc-kernel installation, there was a rollback across reboot
2022-06-
2022-06-
2022-06-
2022-06-
2022-06-
2022-06-
"""