Skip to content

Commit

Permalink
v6.20
Browse files Browse the repository at this point in the history
+ Reboot required.

EG: in case of Odroid headers do not match active kernel, thus fails to active module.

https://github.com/Fourdee/DietPi/issues/2052#issuecomment-453690247
  • Loading branch information
Daniel Knight committed Jan 12, 2019
1 parent ddb317f commit 5ecea64
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -4997,21 +4997,26 @@ _EOF_
G_AGUP

# - Odroids need to purge before we install, else, does not update to latest version...
if (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )); then
(( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )) && G_AGP $kernel_packages

G_AGP $kernel_packages
G_AGI $kernel_packages

fi
if [[ $kernel_version_active != $(ls /lib/modules/) ]]; then

G_AGI $kernel_packages
G_WHIP_MSG '[INFO] Wireguard:\n\nKernel update detected, a reboot is required before Wireguard module can be built with latest kernel.\n\nOnce the system has rebooted, please reselect "Wireguard" for installation in "DietPi-Software" to continue.'
aSOFTWARE_INSTALL_STATE[$software_id]=0

# iptables required to forward incoming VPN traffic to internet interface
# qrencode required to create client config QR code on console
# reinstall to rebuild kernel modules via wireguard-dkms, failsafe.
G_AGI --reinstall wireguard wireguard-dkms iptables qrencode
else

# Enable the kernel module | exit on failure
G_RUN_CMD modprobe wireguard
# iptables required to forward incoming VPN traffic to internet interface
# qrencode required to create client config QR code on console
# reinstall to rebuild kernel modules via wireguard-dkms, failsafe.
G_AGI --reinstall wireguard wireguard-dkms iptables qrencode

# Enable the kernel module | exit on failure
G_RUN_CMD modprobe wireguard

fi

unset kernel_packages

Expand Down

2 comments on commit 5ecea64

@MichaIng
Copy link
Owner

@MichaIng MichaIng commented on 5ecea64 Jan 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fourdee
modprobe wireguard fails without reboot, if new kernel was installed, since it was build for the new (not yet active) kernel. But if we allow modrpobe to fail, the standard reboot after dietpi-software will solve it. WireGuard APT install activates the module automatically (after reboot).

Instead of --reinstall, dpkg-reconfigure wireguard should be used to rebuild the kernel package.

We could handle all of this via:

dpkg-query -s wireguard &> /dev/null || local wireguard_package='wireguard'
...
G_AGI "$wireguard_package ..."
[[ $wireguard_package ]] || dpkg-reconfigure $wireguard_package
  • If WireGuard was not installed before, simply add it to G_AGI list. It's install will build the kernel module and have it enabled after reboot.
  • Otherwise don't install WireGuard, it was upgraded at dietpi-software start, but reconfigure it after kernel package upgrades to rebuild the module.

This is only required, if on RPi and/or Odroid the module rebuild is not triggered automatically on kernel package upgrade. Otherwise everything will be done automatically by the APT packages.

@Fourdee
Copy link
Collaborator

@Fourdee Fourdee commented on 5ecea64 Jan 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaIng

We could handle all of this via:

Yep, my concern is alot of our users use the dietpi-software install method. Won't work until after a reboot.

However, we could add a G_WHIP_MSG if modprobe failed, mentioning this if dietpi-software install was used.
Although I like the G_RUN_CMD modprobe, which will fail and notify user if module install went wrong.

Ideally we need a REBOOT_REQUIRED flag in dietpi-software, however, with so much software to go through and possible combinations, might be an impossible task to get it 100% right.

Please sign in to comment.