From 16d105e1be9c920df56307c503630ccf47a7cacc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 25 May 2020 17:44:20 +0200 Subject: [PATCH] v6.31 + DietPi-PREP | Do not remove /home (recreated anyway) and /media but their content only, since their existence is required to fulfil FHS and their absence can hence lead to issues: https://github.com/MichaIng/DietPi/issues/3558, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956495#15 --- PREP_SYSTEM_FOR_DIETPI.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 7877e7bdd1..51ccb014c2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -1027,10 +1027,10 @@ _EOF_' G_DIETPI-NOTIFY 2 'Removing misc files/folders/services, not required by DietPi' - [[ -d '/home' ]] && rm -vR /home - [[ -d '/media' ]] && rm -vR /media - [[ -d '/selinux' ]] && rm -vR /selinux - [[ -d '/var/cache/apparmor' ]] && rm -vR /var/cache/apparmor + [[ -d '/home' ]] && rm -Rfv /home/{,.??,.[^.]}* || mkdir /home + [[ -d '/media' ]] && rm -Rfv /media/{,.??,.[^.]}* || mkdir /media + [[ -d '/selinux' ]] && rm -Rv /selinux + [[ -d '/var/cache/apparmor' ]] && rm -Rv /var/cache/apparmor rm -Rfv /var/lib/dhcp/{,.??,.[^.]}* rm -Rfv /var/backups/{,.??,.[^.]}*