Skip to content

Commit

Permalink
Merge pull request #2513 from Fourdee/dev
Browse files Browse the repository at this point in the history
Dev > Beta
  • Loading branch information
Fourdee authored Feb 7, 2019
2 parents 5ccb2f0 + 5ca1490 commit cec1f42
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 45 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

v6.21
(xx/02/19)
v6.21 (Hotfix)
(07/02/19)

Changes / Improvements / Optimisations:
- DietPi-Software | VNC4: Automated VNC password based on $GLOBAL_PW.
- DietPi-Software | GPU memory split: You will now be prompted to increase GPU memory if DietPi detects a higher value is required for installed software: https://github.com/Fourdee/DietPi/issues/2483

Bug Fixes:
- General | G_RUN_CMD: Resolved issue with incorrect exit code return: https://github.com/Fourdee/DietPi/issues/2508
- General | G_RUN_CMD: Resolved issue with incorrect exit code return. This also prevented the ability to remove networked drives from dietpi-drive_manager: https://github.com/Fourdee/DietPi/issues/2508
- General | Resolved an issue when updating to v6.20, where DietPi-RAMdisk failed to sync changes to disk, causing several issues after reboot: https://github.com/Fourdee/DietPi/issues/2471#issuecomment-460104856
- DietPi-Software | WireGuard: Server installation also sets port as configured during installation to wg0-client.conf. Disabled installation for ARMv6 (no binaries). Many thanks to @WilburWalsh for reporting this issue: https://github.com/Fourdee/DietPi/issues/2474
- DietPi-Software | VNCserver: Resolved "HOME" variable not set in service.
- DietPi-Software | MariaDB: Resolved an issue with latest MariaDB v10.3 update on Buster due to deprecated/removed settings: https://github.com/Fourdee/DietPi/pull/2490
Expand Down
1 change: 1 addition & 0 deletions PREP_SYSTEM_FOR_DIETPI.sh
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@
G_RUN_CMD systemctl enable dietpi-ramdisk

# - Mount tmpfs
mkdir -p /DietPi
G_RUN_CMD mount -t tmpfs -o size=10m tmpfs /DietPi
l_message='Starting DietPi-RAMdisk' G_RUN_CMD systemctl start dietpi-ramdisk

Expand Down
43 changes: 18 additions & 25 deletions dietpi/dietpi-update
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,6 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE
# - Save current version and Git owner/branch info
G_VERSIONDB_SAVE

# Failsafe: Restart RAMdisk + sync to disk
# - https://github.com/Fourdee/DietPi/issues/2473#issuecomment-458874222
# - https://dietpi.com/phpbb/viewtopic.php?f=9&t=2591
G_RUN_CMD systemctl restart dietpi-ramdisk
sync

# - Update info strings
INFO_VERSIONS_UPDATE

Expand All @@ -411,12 +405,7 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE
Apply_1st_Run_Update_Sucess(){

# - 1st run setup
if (( $G_DIETPI_INSTALL_STAGE == 0 )); then

export G_DIETPI_INSTALL_STAGE=1
echo $G_DIETPI_INSTALL_STAGE > /DietPi/dietpi/.install_stage

fi
(( $G_DIETPI_INSTALL_STAGE < 2 )) && echo 1 > /DietPi/dietpi/.install_stage

}

Expand Down Expand Up @@ -536,30 +525,34 @@ Please download the latest DietPi image:\n - https://dietpi.com/#download\n\n -
G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION"
G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION"

local do_reboot=0

# - 1st run setup
if (( $G_DIETPI_INSTALL_STAGE == 0 )); then
if (( $G_DIETPI_INSTALL_STAGE < 2 )); then

Apply_1st_Run_Update_Sucess

G_WHIP_MSG 'DietPi has been updated to the latest version.\n\nThe system will now reboot. Once completed, simply login to resume DietPi Setup. \n\nPress Enter to Continue.'
reboot
G_WHIP_MSG 'DietPi has been updated to the latest version.\n\nThe system will now reboot. Once completed, simply login to resume DietPi Setup.\n\nPress Enter to Continue.'
do_reboot=1

# - Reboot prompt, if system is already installed
elif (( $G_DIETPI_INSTALL_STAGE == 2 )); then

if G_WHIP_YESNO "[ OK ] Update applied\n
Current version: $INFO_CURRENT_VERSION\n
A system reboot is required to finalise the update. Would you like to reboot the system now?"; then
else

reboot
G_WHIP_YESNO "[ OK ] Update applied\n
Current version: $INFO_CURRENT_VERSION\n
A system reboot is required to finalise the update. Would you like to reboot the system now?" && do_reboot=1

else
fi

/DietPi/dietpi/dietpi-services restart
# Failsafe: Restart RAMdisk + sync to disk
# - https://github.com/Fourdee/DietPi/issues/2473#issuecomment-458874222
# - https://dietpi.com/phpbb/viewtopic.php?f=9&t=2591
G_RUN_CMD systemctl restart dietpi-ramdisk
sync

fi
(( $do_reboot )) && reboot

fi
/DietPi/dietpi/dietpi-services restart

fi

Expand Down
34 changes: 19 additions & 15 deletions dietpi/patch_file
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@
#Patches that require a restart of DietPi-Update and patch system.
Restart_DietPi_Update(){

#Save current version, to re-run patch on next launch
#Save current version, to rerun patch on next launch
G_VERSIONDB_SAVE

#Remove DietPi-Update and DietPi-Patchfile working directories do allow concurrent execution
#Remove DietPi-Update and DietPi-Patchfile working directories to allow concurrent execution
cd /tmp
rm -R /tmp/DietPi-Update /tmp/DietPi-Patchfile

G_DIETPI-NOTIFY 0 'Re-running DietPi-Update, to apply this new system'
G_DIETPI-NOTIFY 0 'Re-running DietPi-Update, to apply this new system...'

#Sync changes to disk to avoid async issues
sync
sleep 3

#Apply update forcefully, since user has already chosen to do so
/DietPi/dietpi/dietpi-update 1
Expand All @@ -51,8 +55,8 @@

}

#Pre-v6.17: Switch to new branch and versioning system
# As loaded pre-v6.17 dietpi-update will overwrite .version to previous 2 line system, we need to rerun dietpi-update.
#Pre-v6.17: Apply to new branch and versioning system
# As loaded pre-v6.17 dietpi-update will overwrite ".version" to previous 2 line system, we need to rerun dietpi-update.
if (( $G_DIETPI_VERSION_SUB < 17 )) && [[ ! $(sed -n 6p /DietPi/dietpi/.version) ]]; then

#Switch from obsolete testing to new dev branch
Expand All @@ -72,35 +76,35 @@

fi

#Update G_DIETPI_INSTALL_STAGE to new versioning system.
#Pre-v6.20: Update to new G_DIETPI_INSTALL_STAGE system
# As loaded pre-v6.20 dietpi-update will recreate ".update_stage", we need to rerun dietpi-update.
if [[ -f /DietPi/dietpi/.update_stage ]]; then

rm -f /DietPi/dietpi/.update_stage /boot/dietpi/.update_stage

# Failsafe: Assure removal is synced to disk
sync
rm -f /{DietPi,boot}/dietpi/.update_stage

echo ''
G_DIETPI-NOTIFY 0 'DietPi has applied a new G_DIETPI_INSTALL_STAGE system to the device.'

#System already installed, re-run patch
if (( $(</DietPi/dietpi/.install_stage) == 1 )); then
#System already installed, rerun patch
if (( $(</DietPi/dietpi/.install_stage) > 0 )); then

echo 2 > /DietPi/dietpi/.install_stage
Restart_DietPi_Update

#System updating for the 1st time. We need to reboot the system, to kill dietpi-software old code and reload the new one.
elif (( $(</DietPi/dietpi/.install_stage) < 1 )); then
else

echo 0 > /DietPi/dietpi/.install_stage
G_WHIP_MSG 'A system reboot is required to update G_DIETPI_INSTALL_STAGE system. Once the system reboots, please login to continue setup.'
G_RUN_CMD systemctl restart dietpi-ramdisk
sync
G_WHIP_MSG 'A system reboot is required to apply the new G_DIETPI_INSTALL_STAGE system. Once the system has rebooted, please login to continue setup.'
sleep 3 # Sleep to assure sync has finished in case of G_USER_INPUTS=0
reboot

fi

fi


#/////////////////////////////////////////////////////////////////////////////////////
#Incremental patch system:
Incremental_Patch_System(){
Expand Down
4 changes: 2 additions & 2 deletions dietpi/server_version-6
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
6
20
6
21
1

0 comments on commit cec1f42

Please sign in to comment.