Split [debian.sh] into multiple scripts inside a [debian] directory, adjusted references in other files to reflect changes
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source \
|
||||||
|
/etc/os-release
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
printf \
|
||||||
|
"UMASK=0077\n" | \
|
||||||
|
tee /etc/initramfs-tools/conf.d/umask.conf &> /dev/null
|
||||||
|
|
||||||
|
update-initramfs \
|
||||||
|
-c \
|
||||||
|
-k all
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source \
|
||||||
|
/etc/os-release
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "${ID}" == 'debian' ]] && [[ ! "$(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 \
|
||||||
|
linux-headers-generic \
|
||||||
|
systemd-timesyncd \
|
||||||
|
whois \
|
||||||
|
zfsutils-linux
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
for file in /etc/logrotate.d/* ; do
|
||||||
|
if grep -Eq "(^|[^#y])compress" "$file" ; then
|
||||||
|
sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source \
|
||||||
|
/etc/os-release
|
||||||
|
|
||||||
|
|
||||||
|
packages=( \
|
||||||
|
ca-certificates \
|
||||||
|
console-setup \
|
||||||
|
cryptsetup \
|
||||||
|
curl \
|
||||||
|
dosfstools \
|
||||||
|
dpkg-dev \
|
||||||
|
efibootmgr \
|
||||||
|
ethtool \
|
||||||
|
firmware-{ast,atheros,bnx{2,2x},brcm80211,iwlwifi,libertas,linux,realtek,zd1211} \
|
||||||
|
flatpak \
|
||||||
|
keyboard-configuration \
|
||||||
|
linux-{headers,image}-amd64 \
|
||||||
|
locales \
|
||||||
|
nano \
|
||||||
|
network-manager \
|
||||||
|
openssh-{client,server} \
|
||||||
|
popularity-contest \
|
||||||
|
printer-driver-all \
|
||||||
|
rsync \
|
||||||
|
sudo \
|
||||||
|
systemd-timesyncd \
|
||||||
|
tasksel \
|
||||||
|
zfs-initramfs \
|
||||||
|
zstd \
|
||||||
|
)
|
||||||
|
|
||||||
|
include="--include=${packages[0]}"
|
||||||
|
|
||||||
|
for ((i=1;i<${#packages[@]};i++)); do
|
||||||
|
include+=" --include=${packages[${i}]}"
|
||||||
|
done
|
||||||
|
|
||||||
|
mmdebstrap \
|
||||||
|
--skip=check/empty \
|
||||||
|
--components=main,non-free-firmware,contrib \
|
||||||
|
--mode=root \
|
||||||
|
--format=directory \
|
||||||
|
${include} \
|
||||||
|
"${VERSION_CODENAME}" \
|
||||||
|
/mnt
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
networkInterface=($(ip -br addr show | awk '!/^lo/&&!/tailscale/&&!/^wg/{print$1}'))
|
||||||
|
shopt -s extglob
|
||||||
|
|
||||||
|
for ((i = 0; i < ${#networkInterface[@]}; i++)); do
|
||||||
|
cat << EOF | tee /mnt/etc/network/interfaces.d/${networkInterface[$i]} &> /dev/null
|
||||||
|
allow-hotplug ${networkInterface[$i]}
|
||||||
|
iface ${networkInterface[$i]} inet dhcp
|
||||||
|
EOF
|
||||||
|
done
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
apt \
|
||||||
|
purge \
|
||||||
|
--yes \
|
||||||
|
os-prober
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source \
|
||||||
|
/etc/os-release
|
||||||
|
|
||||||
|
|
||||||
|
cat << EOF | tee /mnt/etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
|
||||||
|
# ${VERSION_CODENAME^}
|
||||||
|
Enabled: yes
|
||||||
|
Types: deb deb-src
|
||||||
|
URIs: http://deb.debian.org/debian/
|
||||||
|
Suites: ${VERSION_CODENAME}
|
||||||
|
Components: main non-free-firmware contrib
|
||||||
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
|
# ${VERSION_CODENAME^} Security
|
||||||
|
Enabled: yes
|
||||||
|
Types: deb deb-src
|
||||||
|
URIs: http://deb.debian.org/debian-security/
|
||||||
|
Suites: ${VERSION_CODENAME}-security
|
||||||
|
Components: main non-free-firmware contrib
|
||||||
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
|
# ${VERSION_CODENAME^} Updates
|
||||||
|
Enabled: yes
|
||||||
|
Types: deb deb-src
|
||||||
|
URIs: http://deb.debian.org/debian/
|
||||||
|
Suites: ${VERSION_CODENAME}-updates
|
||||||
|
Components: main non-free-firmware contrib
|
||||||
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [[ -f '/mnt/etc/apt/sources.list' ]]; then
|
||||||
|
rm \
|
||||||
|
/mnt/etc/apt/sources.list
|
||||||
|
fi
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
systemctl \
|
||||||
|
enable \
|
||||||
|
zfs.target
|
||||||
|
systemctl \
|
||||||
|
enable \
|
||||||
|
zfs-import-cache
|
||||||
|
systemctl \
|
||||||
|
enable \
|
||||||
|
zfs-mount
|
||||||
|
systemctl \
|
||||||
|
enable \
|
||||||
|
zfs-import.target
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
if [[ ! -f /usr/bin/tasksel ]]; then
|
||||||
|
apt \
|
||||||
|
--update \
|
||||||
|
install \
|
||||||
|
--yes \
|
||||||
|
tasksel
|
||||||
|
fi
|
||||||
|
|
||||||
|
tasksel \
|
||||||
|
--new-install
|
||||||
+5
-5
@@ -39,14 +39,14 @@ if [[ "${ID}" == 'fedora' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/debian.sh" --dpkg-reconfigure
|
"${baseDir}/debian/dpkg-reconfigure.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${baseDir}/partition.sh" --efi
|
"${baseDir}/partition.sh" --efi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
if [[ -e '/usr/bin/os-prober' ]]; then
|
if [[ -e '/usr/bin/os-prober' ]]; then
|
||||||
"${baseDir}/debian.sh" --purge-os-prober
|
"${baseDir}/debian/purge-os-prober.sh"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -74,11 +74,11 @@ printf \
|
|||||||
"${baseDir}/swap.sh"
|
"${baseDir}/swap.sh"
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]]; then
|
if [[ "${ID}" == 'debian' ]]; then
|
||||||
"${baseDir}/debian.sh" --network-manager
|
"${baseDir}/debian/network-manager.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/debian.sh" --initramfs
|
"${baseDir}/debian/initramfs.sh"
|
||||||
elif [[ "${ID}" == 'fedora' ]]; then
|
elif [[ "${ID}" == 'fedora' ]]; then
|
||||||
"${baseDir}/fedora.sh" --dracut
|
"${baseDir}/fedora.sh" --dracut
|
||||||
fi
|
fi
|
||||||
@@ -92,7 +92,7 @@ fi
|
|||||||
"${baseDir}/efi.sh"
|
"${baseDir}/efi.sh"
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/debian.sh" --systemctl-enable
|
"${baseDir}/debian/systemctl-enable.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
zfs \
|
zfs \
|
||||||
|
|||||||
+3
-3
@@ -40,7 +40,7 @@ EOF
|
|||||||
if [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/elementary.sh" --namarupa
|
"${baseDir}/elementary.sh" --namarupa
|
||||||
elif [[ "${ID}" == 'debian' ]]; then
|
elif [[ "${ID}" == 'debian' ]]; then
|
||||||
"${baseDir}/debian.sh" --contrib
|
"${baseDir}/debian/contrib.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
@@ -51,11 +51,11 @@ if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" = 'debian' ]]; then
|
if [[ "${ID}" = 'debian' ]]; then
|
||||||
"${baseDir}/debian.sh" --tasksel
|
"${baseDir}/debian/tasksel.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/debian.sh" --logrotate
|
"${baseDir}/debian/logrotate.sh"
|
||||||
|
|
||||||
"${baseDir}/apt-snapshot.sh"
|
"${baseDir}/apt-snapshot.sh"
|
||||||
fi
|
fi
|
||||||
|
|||||||
+4
-4
@@ -40,7 +40,7 @@ if [[ -f '/usr/bin/gsettings' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/debian.sh" --live
|
"${baseDir}/debian/live.sh"
|
||||||
elif [[ "${ID}" == 'fedora' ]]; then
|
elif [[ "${ID}" == 'fedora' ]]; then
|
||||||
"${baseDir}/fedora.sh" --live
|
"${baseDir}/fedora.sh" --live
|
||||||
fi
|
fi
|
||||||
@@ -65,7 +65,7 @@ sleep 5
|
|||||||
if [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/elementary.sh" --mmdebstrap
|
"${baseDir}/elementary.sh" --mmdebstrap
|
||||||
elif [[ "${ID}" == 'debian' ]]; then
|
elif [[ "${ID}" == 'debian' ]]; then
|
||||||
"${baseDir}/debian.sh" --mmdebstrap
|
"${baseDir}/debian/mmdebstrap.sh"
|
||||||
elif [[ "${ID}" == 'fedora' ]]; then
|
elif [[ "${ID}" == 'fedora' ]]; then
|
||||||
"${baseDir}/fedora.sh" --rsync
|
"${baseDir}/fedora.sh" --rsync
|
||||||
fi
|
fi
|
||||||
@@ -73,7 +73,7 @@ fi
|
|||||||
"${baseDir}/hostname.sh"
|
"${baseDir}/hostname.sh"
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]]; then
|
if [[ "${ID}" == 'debian' ]]; then
|
||||||
"${baseDir}/debian.sh" --network-interfaces
|
"${baseDir}/debian/network-interfaces.sh"
|
||||||
elif [[ "${ID}" == 'elementary' ]]; then
|
elif [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/elementary.sh" --network
|
"${baseDir}/elementary.sh" --network
|
||||||
fi
|
fi
|
||||||
@@ -81,7 +81,7 @@ fi
|
|||||||
if [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'elementary' ]]; then
|
||||||
"${baseDir}/elementary.sh" --sources
|
"${baseDir}/elementary.sh" --sources
|
||||||
elif [[ "${ID}" == 'debian' ]]; then
|
elif [[ "${ID}" == 'debian' ]]; then
|
||||||
"${baseDir}/debian.sh" --sources
|
"${baseDir}/debian/sources.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${baseDir}/mount.sh"
|
"${baseDir}/mount.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user