Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep networking packages for containers #6583

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .build/images/dietpi-installer
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)

Expand Down Expand Up @@ -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

Expand Down