reorder_kernel error after upgrading to 6.2 stable

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

reorder_kernel error after upgrading to 6.2 stable

Stephen Hassard
Hi folks,

I just ran into an issue that I was working through on the #openbsd IRC channel that I figure I'd report with a work around.

/usr/libexec/reorder_kernel reports that it's unable to relink my kernel due to a SHA mismatch:
--
Oct  9 09:36:52 stump reorder_kernel: kernel relinking failed; see /usr/share/compile/GENERIC.MP/relink.log
--

Where '/usr/share/compile/GENERIC.MP/relink.log' contains:
--
(SHA256) /bsd: FAILED
--

The fix was easy enough:
--
doas sha256 -h /var/db/kernel.SHA256 /bsd
--

I'm not sure where the original SHA256 came from, but it didn't end up matching any of the kernels distributed with 6.2 stable.

With the above command, the reorder_kernel script is all happy now.

Thanks!

Reply | Threaded
Open this post in threaded view
|

Re: reorder_kernel error after upgrading to 6.2 stable

Theo de Raadt-2
If you replace the kernel by hand, that is precisely what happens.

It assumes you are going to be developing kernels, and therefore
won't touch it.  It reports that.

If you manually hash the kernel, upon your next boot it will start
replacing it, because the relink process believes it is in control
of kernel replacement

> I just ran into an issue that I was working through on the #openbsd IRC channel that I figure I'd report with a work around.
>
> /usr/libexec/reorder_kernel reports that it's unable to relink my kernel due to a SHA mismatch:
> --
> Oct  9 09:36:52 stump reorder_kernel: kernel relinking failed; see /usr/share/compile/GENERIC.MP/relink.log
> --
>
> Where '/usr/share/compile/GENERIC.MP/relink.log' contains:
> --
> (SHA256) /bsd: FAILED
> --
>
> The fix was easy enough:
> --
> doas sha256 -h /var/db/kernel.SHA256 /bsd
> --
>
> I'm not sure where the original SHA256 came from, but it didn't end up matching any of the kernels distributed with 6.2 stable.
>
> With the above command, the reorder_kernel script is all happy now.
>
> Thanks!
>

Reply | Threaded
Open this post in threaded view
|

Re: reorder_kernel error after upgrading to 6.2 stable

Stephen Hassard
On Mon, Oct 09, 2017 at 11:26:23AM -0600, Theo de Raadt wrote:
> If you replace the kernel by hand, that is precisely what happens.

I shouldn't have been running a hand-replaced kernel, but my 6.1 stable system (which was updated to the latest syspatch level and was updating packages via mtier) didn't seen to update the kernel properly on the first boot into 6.2. The boot loader reported that it could not find /bsd after upgrade and I ended up rebooting into bsd.rd to copy the kernel back into the root to fix things up.

It's certainly not a huge deal to fix, but I couldn't find any related documentation to suggest how to get reorder_kernel working again.

Thanks again for the clarification on the behaviour.

Thanks,
Steve