mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
📝 Add docstrings to wip-APA-canary-handle-GPG-keys
Docstrings generation was requested by @leggewie. * https://github.com/armbian/build/pull/8316#issuecomment-2994129599 The following files were modified: * `extensions/apa.sh` * `lib/functions/rootfs/distro-specific.sh`
This commit is contained in:
committed by
GitHub
parent
3844ef919f
commit
a3686900bd
@@ -1,9 +1,11 @@
|
|||||||
# Install armbian-common etc. from APA
|
# extension_prepare_config__apa displays an informational alert and marks the Armbian Package Archive (APA) as enabled for the target image.
|
||||||
|
|
||||||
function extension_prepare_config__apa() {
|
function extension_prepare_config__apa() {
|
||||||
display_alert "Target image will have Armbian Package Archive (APA) enabled by default" "${EXTENSION}" "info"
|
display_alert "Target image will have Armbian Package Archive (APA) enabled by default" "${EXTENSION}" "info"
|
||||||
|
export APA_IS_ACTIVE="true"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# custom_apt_repo__add_apa adds the Armbian Package Archive (APA) repository to the APT sources list on the target SD card.
|
||||||
function custom_apt_repo__add_apa() {
|
function custom_apt_repo__add_apa() {
|
||||||
run_host_command_logged echo "deb [signed-by=${APT_SIGNING_KEY_FILE}] http://github.armbian.com/apa current main" "|" tee "${SDCARD}"/etc/apt/sources.list.d/armbian-apa.list
|
run_host_command_logged echo "deb [signed-by=${APT_SIGNING_KEY_FILE}] http://github.armbian.com/apa current main" "|" tee "${SDCARD}"/etc/apt/sources.list.d/armbian-apa.list
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,9 @@ function install_distribution_specific() {
|
|||||||
# <when>: rootfs|image
|
# <when>: rootfs|image
|
||||||
# <release>: bullseye|bookworm|sid|focal|jammy|noble|oracular|plucky
|
# <release>: bullseye|bookworm|sid|focal|jammy|noble|oracular|plucky
|
||||||
# <basedir>: path to root directory
|
# <basedir>: path to root directory
|
||||||
|
# create_sources_list_and_deploy_repo_key configures APT sources and deploys repository keys for a specified release and root filesystem.
|
||||||
#
|
#
|
||||||
|
# Sets up upstream Debian or Ubuntu APT sources, adds the Armbian repository with appropriate components, and deploys the Armbian signing key unless APA is active. Handles special cases for different releases, architectures, and build stages, and invokes a customizable extension hook for further repository or key modifications. Exits with an error if the base directory is not provided.
|
||||||
function create_sources_list_and_deploy_repo_key() {
|
function create_sources_list_and_deploy_repo_key() {
|
||||||
declare when="${1}"
|
declare when="${1}"
|
||||||
declare release="${2}"
|
declare release="${2}"
|
||||||
@@ -80,6 +82,8 @@ function create_sources_list_and_deploy_repo_key() {
|
|||||||
|
|
||||||
declare distro=""
|
declare distro=""
|
||||||
|
|
||||||
|
APT_SIGNING_KEY_FILE="/usr/share/keyrings/armbian-archive-keyring.gpg"
|
||||||
|
|
||||||
# Drop deboostrap sources leftovers
|
# Drop deboostrap sources leftovers
|
||||||
rm -f "${basedir}/etc/apt/sources.list"
|
rm -f "${basedir}/etc/apt/sources.list"
|
||||||
|
|
||||||
@@ -157,11 +161,12 @@ function create_sources_list_and_deploy_repo_key() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# code to be made obsolete by making APA part of Armbian Core. #XXX
|
||||||
|
if [ ! $APA_IS_ACTIVE = "true" ]; then
|
||||||
# add armbian key
|
# add armbian key
|
||||||
display_alert "Adding Armbian repository and authentication key" "${when} :: /etc/apt/sources.list.d/armbian.sources" "info"
|
display_alert "Adding Armbian repository and authentication key" "${when} :: /etc/apt/sources.list.d/armbian.sources" "info"
|
||||||
mkdir -p "${basedir}"/usr/share/keyrings
|
mkdir -p "${basedir}"/usr/share/keyrings
|
||||||
# change to binary form
|
# change to binary form
|
||||||
APT_SIGNING_KEY_FILE="/usr/share/keyrings/armbian-archive-keyring.gpg"
|
|
||||||
gpg --dearmor < "${SRC}"/config/armbian.key > "${basedir}${APT_SIGNING_KEY_FILE}"
|
gpg --dearmor < "${SRC}"/config/armbian.key > "${basedir}${APT_SIGNING_KEY_FILE}"
|
||||||
|
|
||||||
# lets link to the old file as armbian-config uses it and we can't set there to new file
|
# lets link to the old file as armbian-config uses it and we can't set there to new file
|
||||||
@@ -173,6 +178,7 @@ function create_sources_list_and_deploy_repo_key() {
|
|||||||
cp "${SRC}"/config/armbian.key "${basedir}"
|
cp "${SRC}"/config/armbian.key "${basedir}"
|
||||||
chroot "${basedir}" /bin/bash -c "cat armbian.key | apt-key add - > /dev/null 2>&1"
|
chroot "${basedir}" /bin/bash -c "cat armbian.key | apt-key add - > /dev/null 2>&1"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Add Armbian APT repository
|
# Add Armbian APT repository
|
||||||
declare -a components=()
|
declare -a components=()
|
||||||
|
|||||||
Reference in New Issue
Block a user