Split off more Debian-related tasks into 'debian.sh'

This commit is contained in:
2025-12-24 16:32:44 -05:00
parent 16018759fb
commit 8305fa16cd
4 changed files with 97 additions and 88 deletions

View File

@@ -9,7 +9,28 @@ source \
"${baseDir}/system.conf" "${baseDir}/system.conf"
if [[ "${1}" == '--mmdebstrap' ]]; then if [[ "${1}" == '--live' ]]; then
if [[ ! "$(hostname)" == "debian-live" ]]; then
cat << EOF | tee /etc/apt/sources.list.d/contrib.sources 1> /dev/null
Enabled: yes
Types: deb
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}
Components: contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
fi
apt \
--update \
install \
--yes \
mmdebstrap \
gdisk \
systemd-timesyncd \
whois \
zfsutils-linux
elif [[ "${1}" == '--mmdebstrap' ]]; then
packages=(\ packages=(\
console-setup \ console-setup \
cryptsetup \ cryptsetup \
@@ -86,4 +107,73 @@ Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF EOF
rm /mnt/etc/apt/sources.list rm /mnt/etc/apt/sources.list
elif [[ "${1}" == '--dpkg-reconfigure' ]]; then
cat << EOF
Regardless of the language(s) you choose, be sure to enable 'en_US.UTF-8'!
Press any key to continue...
EOF
read -srn 1
dpkg-reconfigure \
locales \
tzdata \
keyboard-configuration \
console-setup
elif [[ "${1}" == '--purge-os-prober' ]]; then
apt \
purge \
--yes \
os-prober
elif [[ "${1}" == '--network-manager' ]]; then
cp \
/etc/NetworkManager/NetworkManager.conf \
/etc/NetworkManager/NetworkManager.conf.orig
cat \
/etc/NetworkManager/NetworkManager.conf.orig | \
sed 's|managed=false|managed=true|' | \
tee /etc/NetworkManager/NetworkManager.conf &> /dev/null
elif [[ "${1}" == '--contrib' ]]; then
cat << EOF | tee --append /etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
# ${VERSION_CODENAME^} Backports
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}-backports
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
cat << EOF | tee /etc/apt/preferences.d/backports.pref &> /dev/null
Package: *
Pin: release n=${VERSION_CODENAME}*
Pin-Priority: 990
Package: linux-*
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
if [[ "${VERSION_CODENAME}" == 'bookworm' ]]; then
cat << EOF | tee --append /etc/apt/preferences.d/backports.pref &> /dev/null
Package: /wayland/
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
fi
elif [[ "${1}" == '--tasksel' ]]; then
if [[ ! -f /usr/bin/tasksel ]]; then
apt \
--update \
install \
--yes \
tasksel
fi
tasksel \
--new-install
fi fi

View File

@@ -112,19 +112,7 @@ if [[ "${ID}" == 'fedora' ]]; then
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
cat << EOF "${baseDir}/debian.sh" --dpkg-reconfigure
Regardless of the language(s) you choose, be sure to enable 'en_US.UTF-8'!
Press any key to continue...
EOF
read -srn 1
dpkg-reconfigure \
locales \
tzdata \
keyboard-configuration \
console-setup
fi fi
if [[ "${ID}" == 'debian' ]]; then if [[ "${ID}" == 'debian' ]]; then
@@ -155,10 +143,7 @@ mount \
/boot/efi /boot/efi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
apt \ "${baseDir}/debian.sh" --purge-os-prober
purge \
--yes \
os-prober
fi fi
printf \ printf \
@@ -185,14 +170,7 @@ if [[ "${enableSwap}" == "yes" ]]; then
fi fi
if [[ "${ID}" == 'debian' ]]; then if [[ "${ID}" == 'debian' ]]; then
cp \ "${baseDir}/debian.sh" --network-manager
/etc/NetworkManager/NetworkManager.conf \
/etc/NetworkManager/NetworkManager.conf.orig
cat \
/etc/NetworkManager/NetworkManager.conf.orig | \
sed 's|managed=false|managed=true|' | \
tee /etc/NetworkManager/NetworkManager.conf &> /dev/null
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then

View File

@@ -120,35 +120,7 @@ Pin: release n=${UBUNTU_VERSION_CODENAME}-backports
Pin-Priority: -1 Pin-Priority: -1
EOF EOF
elif [[ "${ID}" == 'debian' ]]; then elif [[ "${ID}" == 'debian' ]]; then
cat << EOF | tee --append /etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null "${baseDir}/debian.sh" --contrib
# ${VERSION_CODENAME^} Backports
Enabled: yes
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}-backports
Components: main non-free-firmware contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
cat << EOF | tee /etc/apt/preferences.d/backports.pref &> /dev/null
Package: *
Pin: release n=${VERSION_CODENAME}*
Pin-Priority: 990
Package: linux-*
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
if [[ "${VERSION_CODENAME}" == 'bookworm' ]]; then
cat << EOF | tee --append /etc/apt/preferences.d/backports.pref &> /dev/null
Package: /wayland/
Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
fi
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
@@ -164,15 +136,7 @@ if [[ "${ID}" == 'elementary' ]]; then
--autoremove \ --autoremove \
elementary-desktop elementary-desktop
elif [[ "${ID}" = 'debian' ]]; then elif [[ "${ID}" = 'debian' ]]; then
if [[ ! -f /usr/bin/tasksel ]]; then "${baseDir}/debian.sh" --tasksel
apt \
install \
--yes \
tasksel
fi
tasksel \
--new-install
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then

View File

@@ -31,20 +31,6 @@ source \
"${baseDir}/system.conf" "${baseDir}/system.conf"
if [[ "${ID}" == 'debian' ]]; then
if [[ ! "$(hostname)" == "debian-live" ]]; then
cat << EOF | tee /etc/apt/sources.list.d/contrib.sources 1> /dev/null
Enabled: yes
Types: deb
URIs: http://deb.debian.org/debian/
Suites: ${VERSION_CODENAME}
Components: contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
fi
fi
if [[ -f '/usr/bin/gsettings' ]]; then if [[ -f '/usr/bin/gsettings' ]]; then
gsettings \ gsettings \
set \ set \
@@ -54,16 +40,7 @@ if [[ -f '/usr/bin/gsettings' ]]; then
fi fi
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
apt \ "${baseDir}/debian.sh" --live
update && \
apt \
install \
--yes \
mmdebstrap \
gdisk \
systemd-timesyncd \
whois \
zfsutils-linux
elif [[ "${ID}" == 'fedora' ]]; then elif [[ "${ID}" == 'fedora' ]]; then
if [[ "${VERSION_ID}" -lt '41' ]]; then if [[ "${VERSION_ID}" -lt '41' ]]; then
dnf config-manager \ dnf config-manager \