Skip to content

Commit

Permalink
v6.26
Browse files Browse the repository at this point in the history
+ DietPi-Software | Docker: Prevent install if kernel version got upgraded and old version overwritten or purged. In this case, where /lib/modules/$(uname -r) is missing, certain Docker service start tasks fail, which makes the APT call fail, leading to follow up errors during dietpi-software run. The user must first reboot to load the new kernel. This is mostly an issue on RPi, where kernel packages are not versioned, thus regular "apt-get upgrade" includes kernel upgrades and those overwrite/purge the old kernel module files.
  • Loading branch information
MichaIng authored Sep 26, 2019
1 parent a3c8cf0 commit f563d9c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ _EOF_
fi

# If encryption has not yet been done, do it now!
elif GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//'); then
elif GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt); then

G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /DietPi/dietpi.txt
openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW
Expand Down Expand Up @@ -2199,6 +2199,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#-------------------------------------------------------------------------
# Pre-req software, for items that do NOT have their own array aSOFTWARE_REQUIRES_SOFTWARENAME

# Prevent Docker install if kernel has just been upgraded and old one overwritten/purged: https://github.com/MichaIng/DietPi/issues/3126
if [[ ${aSOFTWARE_INSTALL_STATE[162]} == 1 && ! -d /lib/modules/$(uname -r) ]]; then

G_WHIP_MSG '[WARNING] Docker install will be deselected\n
It seems that your kernel version has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install.\n
Please reselect Docker from dietpi-software after next reboot.'
aSOFTWARE_INSTALL_STATE[162]=0

fi

# Nextcloud extensions
# - Nextcloud Talk
software_id=114
Expand Down Expand Up @@ -5679,10 +5689,9 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use it's internal

Banner_Installing

# Offical installer
INSTALL_URL_ADDRESS='https://get.docker.com'
G_CHECK_URL "$INSTALL_URL_ADDRESS"

# Offical Docker installer
wget "$INSTALL_URL_ADDRESS" -O DockerInstall.sh
chmod +x DockerInstall.sh
G_ERROR_HANDLER_COMMAND='./DockerInstall.sh'
Expand All @@ -5691,6 +5700,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use it's internal
do

./DockerInstall.sh
G_ERROR_HANDLER_EXITCODE=$?
G_ERROR_HANDLER

done
Expand Down

0 comments on commit f563d9c

Please sign in to comment.