V8.00.000.2025.06.17
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -84,7 +84,7 @@ generate_sources() {
|
||||
# shellcheck disable=SC2153
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list"
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-CreationInfo: ${VAR_DATE}; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
|
||||
148
func/cdi_4100_base/4105_generate_sources_822.sh
Normal file
148
func/cdi_4100_base/4105_generate_sources_822.sh
Normal file
@@ -0,0 +1,148 @@
|
||||
#!/bin/bash
|
||||
# SPDX-Version: 3.0
|
||||
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
|
||||
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
|
||||
# SPDX-FileType: SOURCE
|
||||
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
|
||||
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
|
||||
# SPDX-PackageName: CISS.debian.installer
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Generate target '/etc/apt/sources.list.d/' deb.822 entries.
|
||||
# Globals:
|
||||
# TARGET
|
||||
# apt_contrib
|
||||
# apt_deb_sources
|
||||
# apt_mirror_directory
|
||||
# apt_mirror_hostname
|
||||
# apt_mirror_protocol
|
||||
# apt_non_free
|
||||
# apt_non_free_firmware
|
||||
# apt_sec
|
||||
# apt_updates_backports
|
||||
# apt_updates_release
|
||||
# apt_updates_security
|
||||
# architecture
|
||||
# distribution
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
generate_sources822() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare -a ary_components=() ary_types=()
|
||||
declare var_arch="" var_codename="" var_deb_src="" var_dir="" var_hostname="" var_hostsecure="" var_url="" var_surl=""
|
||||
|
||||
# shellcheck disable=SC2154 # "${architecture}"
|
||||
var_arch="${architecture,,}"
|
||||
# shellcheck disable=SC2154 # "${distribution}"
|
||||
var_codename="${distribution,,}"
|
||||
# shellcheck disable=SC2154 # "${apt_deb_sources}"
|
||||
var_deb_src="${apt_deb_sources,,}"
|
||||
# shellcheck disable=SC2154 # "${apt_mirror_directory}"
|
||||
var_dir="${apt_mirror_directory,,}"
|
||||
# shellcheck disable=SC2154 # "${apt_mirror_hostname}"
|
||||
var_hostname="${apt_mirror_hostname,,}"
|
||||
# shellcheck disable=SC2154 # "${apt_sec}"
|
||||
var_hostsecure="${apt_sec,,}"
|
||||
|
||||
ary_components=( "main" )
|
||||
[[ "${apt_contrib,,}" == "true" ]] && ary_components+=( "contrib" )
|
||||
[[ "${apt_non_free,,}" == "true" ]] && ary_components+=( "non-free" )
|
||||
[[ "${apt_non_free_firmware,,}" == "true" ]] && ary_components+=( "non-free-firmware" )
|
||||
|
||||
ary_types=( "deb" )
|
||||
[[ "${apt_deb_sources,,}" == "true" ]] && ary_types+=( "deb-src" )
|
||||
|
||||
if [[ "${apt_mirror_protocol,,}" == "https" ]]; then
|
||||
|
||||
var_url="https://${var_hostname}${var_dir}"
|
||||
var_surl="https://${var_hostsecure}/debian-security"
|
||||
|
||||
elif [[ "${apt_mirror_protocol,,}" == "http" ]]; then
|
||||
|
||||
var_url="http://${var_hostname}${var_dir}"
|
||||
var_surl="http://${var_hostsecure}/debian-security"
|
||||
|
||||
else
|
||||
|
||||
var_url="https://${var_hostname}${var_dir}"
|
||||
var_surl="https://${var_hostsecure}/debian-security"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
### Main Repository
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie.sources"
|
||||
inser_comments "${TARGET}/etc/apt/sources.list.d/trixie.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie.sources"
|
||||
Types: ${ary_types[*]}
|
||||
URIs: ${var_url}
|
||||
Suites: ${var_codename}
|
||||
Components: ${ary_components[*]}
|
||||
Enabled: yes
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
|
||||
### Security Repository
|
||||
if [[ "${apt_updates_security,,}" == "true" ]]; then
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
inser_comments "${TARGET}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
Types: ${ary_types[*]}
|
||||
URIs: ${var_surl}
|
||||
Suites: ${var_codename}-security
|
||||
Components: ${ary_components[*]}
|
||||
Enabled: yes
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
fi
|
||||
|
||||
### Updates Repository
|
||||
if [[ "${apt_updates_release,,}" == "true" ]]; then
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
inser_comments "${TARGET}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
Types: ${ary_types[*]}
|
||||
URIs: ${var_url}
|
||||
Suites: ${var_codename}-updates
|
||||
Components: ${ary_components[*]}
|
||||
Enabled: yes
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
### Backports Repository
|
||||
if [[ "${apt_updates_backports,,}" == "true" ]]; then
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
inser_comments "${TARGET}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
Types: ${ary_types[*]}
|
||||
URIs: ${var_url}
|
||||
Suites: ${var_codename}-backports
|
||||
Components: ${ary_components[*]}
|
||||
Enabled: yes
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
guard_dir && return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
Reference in New Issue
Block a user