From 2529a8662e656410703102228c6ec007a6e8410b Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 11:36:20 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`rgblogo?= =?UTF-8?q?`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @igorpecovnik. * https://github.com/armbian/build/pull/8018#issuecomment-2761030989 The following files were modified: * `lib/functions/configuration/main-config.sh` --- lib/functions/configuration/main-config.sh | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/functions/configuration/main-config.sh b/lib/functions/configuration/main-config.sh index ed72e7235..5bdbde5ed 100644 --- a/lib/functions/configuration/main-config.sh +++ b/lib/functions/configuration/main-config.sh @@ -7,7 +7,39 @@ # This file is a part of the Armbian Build Framework # https://github.com/armbian/build/ -### Attention: we can't use any interactive programs, read from stdin, nor use non-coreutils utilities here. +# Initializes the main build configuration for generating Armbian images. +# +# This function sets up core environment variables, applies defaults for branding, +# network configuration, filesystem support, timezone settings, and build options. +# It determines the build revision from user or main version files, validates critical +# settings (e.g., ensuring the revision starts with a digit and that mandatory +# encryption parameters are defined when needed), and marks key variables as read-only. +# The function also invokes extension hooks for family- and branch-specific configuration. +# +# Globals: +# MOUNT_UUID - Identifier used in alert messages. +# REVISION - Build revision derived from version files; made read-only. +# VENDOR - Build image vendor, defaulting to "Armbian-unofficial" if unset. +# VENDORURL, VENDORSUPPORT, VENDORPRIVACY, VENDORBUGS, VENDORLOGO +# - Settings for image branding and support links. +# ROOTPWD, MAINTAINER, MAINTAINERMAIL +# - Default credentials and maintainer details. +# DEST_LANG - Target locale for the image, defaulting to "en_US.UTF-8". +# SKIP_EXTERNAL_TOOLCHAINS, USE_CCACHE +# - Build toolchain and caching options. +# NETWORKING_STACK - Selected networking configuration, inferred based on BUILD_MINIMAL. +# TZDATA - Timezone info taken from /etc/timezone or defaulted to "Etc/UTC". +# CHROOT_CACHE_VERSION - Version for chroot cache management. +# DEB_COMPRESS - Compression method for .deb packages, adjusted for CI environments. +# +# Outputs: +# Displays progress and debug alerts to STDOUT/STDERR and exits on configuration errors. +# +# Returns: +# None. Exits the script if critical configuration validations fail. +# +# Example: +# do_main_configuration function do_main_configuration() { display_alert "Starting main configuration" "${MOUNT_UUID}" "info"