diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 440f046afd..3ff37c4206 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -450,7 +450,8 @@ _EOF_ esac G_WHIP_MENU_ARRAY+=( '' '●─ Other ' - '75' ': Container image' + '75.1' ': Container image without network' + '75.2' ': Container image with network' '22' ': Generic device' ) @@ -863,6 +864,22 @@ setenv rootuuid "true"' /boot/boot.cmd G_DIETPI-NOTIFY 2 'Marking all packages as auto-installed first, to allow effective autoremove afterwards' local apackages mapfile -t apackages < <(apt-mark showmanual) + + # Containers with network: keep necessary packages to avoid losing network connectivity + if [[ ${apackages[0]} && $G_HW_MODEL == 75 && $HW_VARIANT == 2 ]] + then + rpackages=( + 'ifupdown' + 'isc-dhcp-client' + ) + apackages_string="${apackages[*]}" + for pkg in "${rpackages[@]}" + do + apackages_string=$(echo "$apackages_string" | sed "s/\b$pkg\b//g" | tr -s ' ') + done + IFS=' ' read -r -a apackages <<< "$apackages_string" + fi + [[ ${apackages[0]} ]] && G_EXEC apt-mark auto "${apackages[@]}" unset -v apackages