Kernel upgrade breaks WireGuard? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
threefoursixeight
Posts: 17
Joined: Wed Oct 30, 2019 3:55 am

Kernel upgrade breaks WireGuard?

Post by threefoursixeight »

Hi guys,

Last time I upgraded my kernel and kernel headers, WireGuard was broken after I rebooted. I believe I couldn’t start wg-quick but I can’t remember exactly. I wasn’t able to fix it and had to completely reinstall dietpi to get everything working again.

I’m wondering if anyone has run into this problem before and fixed it?

I’m reading that it seems like I need to update the kernel, reboot, purge WireGuard dkms, then reinstall WireGuard dkms, but I’m not sure how this works with the way dietpi installs WireGuard.

Do I need to upgrade kernel, reboot, purge WireGuard dkms, then reinstall WireGuard through dietpi-software?

Thanks 🙂
User avatar
Joulinar
Posts: 2032
Joined: Sat Nov 16, 2019 12:49 am

Re: Kernel upgrade breaks WireGuard?

Post by Joulinar »

Hi,
many thanks for your report.

Yes indeed. There was a challenges in the past with WireGuard themselves if you updated the kernel. But this behavior changed by WireGuard and you should be able to update your kernel without issues now.

If it still did not work, your could run dpkg-reconfigure

Code: Select all

sudo dpkg-reconfigure wireguard-dkms
Personally I tested it today on my RPi4B as I was running G_AGUP and G_AGUG to update to the new Kernel 4.19.93-v7l+

before kernel update

Code: Select all

root@DietPi4:~# uname -a
Linux DietPi4 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux
root@DietPi4:~#
after kernel update

Code: Select all

root@DietPi4:~# uname -a
Linux DietPi4 4.19.93-v7l+ #1290 SMP Fri Jan 10 16:45:11 GMT 2020 armv7l GNU/Linux
root@DietPi4:~#
After reboot, WireGuard was still working. Even my already connected mobile devices survived the Kernel update + Reboot without issues. 8)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
threefoursixeight
Posts: 17
Joined: Wed Oct 30, 2019 3:55 am

Re: Kernel upgrade breaks WireGuard?

Post by threefoursixeight »

Sweet!! So in your instance, you didn’t have to do anything more than simply upgrade the kernel and restart? WireGuard just continued to work after rebooting?
User avatar
Joulinar
Posts: 2032
Joined: Sat Nov 16, 2019 12:49 am

Re: Kernel upgrade breaks WireGuard?

Post by Joulinar »

correct. I just did G_AGUP + G_AGUG, enjoyed a coffee while waiting on the update to be completed and rebooted the RPi once done. At least this was my experience today.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
threefoursixeight
Posts: 17
Joined: Wed Oct 30, 2019 3:55 am

Re: Kernel upgrade breaks WireGuard?

Post by threefoursixeight »

Joulinar wrote: Wed Jan 22, 2020 2:39 pm correct. I just did G_AGUP + G_AGUG, enjoyed a coffee while waiting on the update to be completed and rebooted the RPi once done. At least this was my experience today.
Do you mind telling me what G_AGUP and G_AGUG are?

Sudo apt-get update and sudo apt-get upgrade?
User avatar
MichaIng
Site Admin
Posts: 2271
Joined: Sat Nov 18, 2017 6:21 pm

Re: Kernel upgrade breaks WireGuard?

Post by MichaIng »

Exactly, newest WireGuard DKMS should place a kernel-upgrade hook that rebuilds the WireGuard kernel module automatically whenever the kernel is upgraded. At least with newest RPi firmware and all kernel packages I know for other model, this is the case, otherwise manual rebuild via dpkg-reconfigure + reboot as above is the way.
threefoursixeight
Posts: 17
Joined: Wed Oct 30, 2019 3:55 am

Re: Kernel upgrade breaks WireGuard?

Post by threefoursixeight »

MichaIng wrote: Wed Jan 22, 2020 3:02 pm Exactly, newest WireGuard DKMS should place a kernel-upgrade hook that rebuilds the WireGuard kernel module automatically whenever the kernel is upgraded. At least with newest RPi firmware and all kernel packages I know for other model, this is the case, otherwise manual rebuild via dpkg-reconfigure + reboot as above is the way.
Gotcha! Thanks for all your help!
User avatar
Joulinar
Posts: 2032
Joined: Sat Nov 16, 2019 12:49 am

Re: Kernel upgrade breaks WireGuard?

Post by Joulinar »

yep, these are the same commands. G_AGUP + G_AGUG are used by DietPi scripts. And much more important, way less characters to type into console :lol:
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
threefoursixeight
Posts: 17
Joined: Wed Oct 30, 2019 3:55 am

Re: Kernel upgrade breaks WireGuard?

Post by threefoursixeight »

Joulinar wrote: Wed Jan 22, 2020 3:06 pm yep, these are the same commands. G_AGUP + G_AGUG are used by DietPi scripts. And much more important, way less characters to type into console :lol:
Gotcha! I guess I’m even lazier with my bash alias of suu for sudo apt-get update && sudo apt-get upgrade 😂
User avatar
MichaIng
Site Admin
Posts: 2271
Joined: Sat Nov 18, 2017 6:21 pm

Re: Kernel upgrade breaks WireGuard?

Post by MichaIng »

G_AG* commands are most imporantly non-interactive, hence they will never ask you whether to install dependencies, keep or overwrite old config files (old are always kept, new ones installed with *-dpkg-new/dist suffix), purge depandants etc. On stable distro version and older (Buster, Stretch, Jessie, ...) this is safe, on testing version (Bullseye) it could lead to unexpected package installs/uninstalls and new package versions are not assured to be compatible with old config files etc, hence I would use the interactive bare apt/apt-get commands there ;).
Post Reply