On 02/06/2012 02:01 PM, Przemek Klosowski wrote:
On 02/06/2012 11:58 AM, Peter Jones wrote:
> grubby, and something would have to provide a systemd service. Here's the
> basic algorithm:
> 1) kernel's %post/%posttrans adds the new stanza using new-kernel-package/
> grubby, but doesn't make the new kernel default.
> 2) kernel's %post saves new kernel version someplace (/etc/sysconfig/newkernel
> for the purpose of this text, we can decide if there's a more appropraite
> 3) set next boot kernel to the new kernel with grub2-reboot
> 4) during boot up, a systemd service compares uname to /etc/sysconfig/newkernel
> a) if they match, it worked - use grubby to make it the default
> b) if they don't match, it failed - do whatever it is you guys want to do.
> The only problem here is that when we get to 4b, we don't *really* know
> that we've attempted to boot the new kernel - the user could have manually
> intervened and booted the old (or some other) kernel. Dunno how to avoid that.
Would this be solved by writing down the version (output of 'uname -r' and/or
'cat /proc/cmdline' ) of the kernel after it successfully boots? if it worked
last time, it should work again.
No - the problem isn't that we can't spot success, the problem is that we
actually detect failure. But Matthew's suggestion effectively solves that.