Skip to content

Commit f2b2344

Browse files
committed
desktops: wire armbian-config module_desktops into rootfs creation
Interactive DE selection: clones configng, queries the Python parser for JSON DE list + tier menu (no host armbian-config needed). New DESKTOP_TIER variable replaces DESKTOP_ENVIRONMENT_CONFIG_NAME and DESKTOP_APPGROUPS_SELECTED. Desktop install in rootfs-create.sh (cached): chroot_sdcard "SUDO_USER= DEBIAN_FRONTEND=noninteractive DIALOG=read armbian-config --api module_desktops install de=$DE tier=$TIER mode=build" Plymouth artifact moved to rootfs-create (before cache). DM disable moved to distro-agnostic (after cache restore). Rootfs hash tracks configng desktops HEAD commit. Cleanup: artifacts registry, aggregation pipeline, Python tools, CLI commands, action.yml, templates, library-functions.sh sources.
1 parent 9d36a94 commit f2b2344

17 files changed

Lines changed: 168 additions & 275 deletions

action.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ runs:
185185
BUILD_DESKTOP="yes"
186186
BUILD_MINIMAL="no"
187187
DESKTOP_ENVIRONMENT="${{ inputs.armbian_ui }}"
188-
DESKTOP_APPGROUPS_SELECTED=""
189-
DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base"
188+
DESKTOP_TIER="mid"
190189
fi
191190
192191
# go to build folder
@@ -206,8 +205,7 @@ runs:
206205
BUILD_DESKTOP="${BUILD_DESKTOP}" \
207206
BUILD_MINIMAL="${BUILD_MINIMAL}" \
208207
DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \
209-
DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \
210-
DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \
208+
DESKTOP_TIER="${DESKTOP_TIER}" \
211209
ENABLE_EXTENSIONS="${{ inputs.armbian_extensions }}" \
212210
COMPRESS_OUTPUTIMAGE="${{ inputs.armbian_compress }}" \
213211
SHARE_LOG="yes" \

config/templates/targets-default.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ targets:
1111
BUILD_MINIMAL: "no"
1212
BUILD_DESKTOP: "yes"
1313
DESKTOP_ENVIRONMENT: "xfce"
14-
DESKTOP_ENVIRONMENT_CONFIG_NAME: "config_base"
14+
DESKTOP_TIER: "mid"
1515
RELEASE: "sid"
1616
items-from-inventory:
1717
not-eos-with-video: yes # not-eos boards, all branches, only those without HAS_VIDEO_OUTPUT="no"

lib/functions/artifacts/artifact-rootfs.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,21 @@ function artifact_rootfs_config_dump() {
1313
artifact_input_variables[SELECTED_CONFIGURATION]="${SELECTED_CONFIGURATION}" # should be represented below anyway
1414
artifact_input_variables[BUILD_MINIMAL]="${BUILD_MINIMAL}"
1515
artifact_input_variables[DESKTOP_ENVIRONMENT]="${DESKTOP_ENVIRONMENT:-"no_DESKTOP_ENVIRONMENT_set"}"
16-
artifact_input_variables[DESKTOP_ENVIRONMENT_CONFIG_NAME]="${DESKTOP_ENVIRONMENT_CONFIG_NAME:-"no_DESKTOP_ENVIRONMENT_CONFIG_NAME_set"}"
17-
artifact_input_variables[DESKTOP_APPGROUPS_SELECTED]="${DESKTOP_APPGROUPS_SELECTED:-"no_DESKTOP_APPGROUPS_SELECTED_set"}"
16+
artifact_input_variables[DESKTOP_TIER]="${DESKTOP_TIER:-"no_DESKTOP_TIER_set"}"
17+
18+
# Track the latest commit touching configng's desktop definitions.
19+
# Any change to YAML, parser, or module code in tools/modules/desktops/
20+
# invalidates the desktop rootfs cache — the package list, browser
21+
# mapping, tier overrides, or branding may have changed.
22+
if [[ "${BUILD_DESKTOP}" == "yes" ]]; then
23+
declare configng_desktops_hash="undetermined"
24+
local configng_dir="${SRC}/cache/sources/armbian-configng"
25+
if [[ -d "${configng_dir}/.git" ]]; then
26+
configng_desktops_hash="$(git -C "${configng_dir}" log -1 --format=%H -- tools/modules/desktops/ 2>/dev/null || echo "unknown")"
27+
fi
28+
artifact_input_variables[CONFIGNG_DESKTOPS_HASH]="${configng_desktops_hash}"
29+
fi
30+
1831
# Hash of the packages added/removed by extensions
1932
declare pkgs_hash="undetermined"
2033
pkgs_hash="$(echo "${REMOVE_PACKAGES[*]} ${EXTRA_PACKAGES_ROOTFS[*]} ${PACKAGE_LIST_BOARD_REMOVE} ${PACKAGE_LIST_FAMILY_REMOVE}" | sha256sum | cut -d' ' -f1)"
@@ -43,8 +56,8 @@ function artifact_rootfs_prepare_version() {
4356
# add more reasons for desktop stuff
4457
if [[ "${DESKTOP_ENVIRONMENT}" != "" ]]; then
4558
reasons+=("desktop_environment \"${DESKTOP_ENVIRONMENT}\"")
46-
reasons+=("desktop_environment_config_name \"${DESKTOP_ENVIRONMENT_CONFIG_NAME}\"")
47-
reasons+=("desktop_appgroups_selected \"${DESKTOP_APPGROUPS_SELECTED}\"")
59+
reasons+=("desktop_tier \"${DESKTOP_TIER}\"")
60+
reasons+=("configng_desktops \"${artifact_input_variables[CONFIGNG_DESKTOPS_HASH]:-none}\"")
4861
fi
4962

5063
# we use YYYYMM to make a new rootfs cache version per-month, even if nothing else changes.

lib/functions/artifacts/artifacts-registry.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ function armbian_register_artifacts() {
2323
["armbian-plymouth-theme"]="armbian-plymouth-theme"
2424
["armbian-base-files"]="armbian-base-files"
2525
["armbian-bsp-cli"]="armbian-bsp-cli"
26-
["armbian-bsp-desktop"]="armbian-bsp-desktop"
27-
["armbian-desktop"]="armbian-desktop"
2826

2927
# tar.zst
3028
["rootfs"]="rootfs"

lib/functions/cli/commands.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ function armbian_register_commands() {
9090

9191
["armbian-base-files"]="artifact"
9292
["armbian-bsp-cli"]="artifact"
93-
["armbian-bsp-desktop"]="artifact"
94-
["armbian-desktop"]="artifact"
9593

9694
["undecided"]="undecided" # implemented in cli_undecided_pre_run and cli_undecided_run - relaunches either build or docker
9795
)
@@ -151,8 +149,6 @@ function armbian_register_commands() {
151149

152150
["armbian-base-files"]="WHAT='armbian-base-files' ${common_cli_artifact_vars}"
153151
["armbian-bsp-cli"]="WHAT='armbian-bsp-cli' ${common_cli_artifact_vars}"
154-
["armbian-bsp-desktop"]="WHAT='armbian-bsp-desktop' BUILD_DESKTOP='yes' ${common_cli_artifact_vars}"
155-
["armbian-desktop"]="WHAT='armbian-desktop' BUILD_DESKTOP='yes' ${common_cli_artifact_vars}"
156152

157153
["oras-upload"]="ORAS_OPERATION='upload'"
158154

lib/functions/configuration/aggregation.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ function aggregate_all_packages_python() {
8989
"EXTRA_PACKAGES_IMAGE=${EXTRA_PACKAGES_IMAGE[*]}"
9090
"EXTRA_PACKAGES_IMAGE_REFS=${EXTRA_PACKAGES_IMAGE_REFS[*]}"
9191

92-
# Desktop stuff; results are not mixed into main packages. Results in AGGREGATED_PACKAGES_DESKTOP.
92+
# Desktop: armbian-config owns package lists now; only the
93+
# flag and DE name are needed for cache-key computation.
9394
"BUILD_DESKTOP=${BUILD_DESKTOP}"
9495
"DESKTOP_ENVIRONMENT=${DESKTOP_ENVIRONMENT}"
95-
"DESKTOP_ENVIRONMENT_CONFIG_NAME=${DESKTOP_ENVIRONMENT_CONFIG_NAME}"
96-
"DESKTOP_APPGROUPS_SELECTED=${DESKTOP_APPGROUPS_SELECTED}"
96+
"DESKTOP_TIER=${DESKTOP_TIER}"
9797

9898
# Those are processed by Python, but not part of rootfs / main packages; results in AGGREGATED_PACKAGES_IMAGE_INSTALL
9999
# These two vars are made readonly after sourcing the board / family config, so can't be used in extensions and such.

lib/functions/configuration/config-desktop.sh

Lines changed: 78 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -7,146 +7,102 @@
77
# This file is a part of the Armbian Build Framework
88
# https://github.com/armbian/build/
99

10-
function desktop_element_available_for_arch() {
11-
local desktop_element_path="${1}"
12-
local targeted_arch="${2}"
13-
local arch_limitation_file="${1}/architectures"
14-
if [[ -f "${arch_limitation_file}" ]]; then
15-
if ! grep -- "${targeted_arch}" "${arch_limitation_file}" &> /dev/null; then
16-
return 1
17-
fi
18-
fi
19-
return 0
20-
}
21-
22-
function desktop_element_supported() {
23-
local desktop_element_path="${1}"
24-
local support_level_filepath="${desktop_element_path}/support"
25-
declare -g desktop_element_supported_result=0
26-
if [[ -f "${support_level_filepath}" ]]; then
27-
local support_level
28-
support_level="$(cat "${support_level_filepath}")"
29-
if [[ "${support_level}" != "supported" && "${EXPERT}" != "yes" ]]; then
30-
desktop_element_supported_result=65
31-
return 0
32-
fi
33-
if ! desktop_element_available_for_arch "${desktop_element_path}" "${ARCH}"; then
34-
desktop_element_supported_result=66
35-
return 0
36-
fi
37-
else
38-
desktop_element_supported_result=64
39-
return 0
40-
fi
41-
return 0
42-
}
10+
# Interactive desktop configuration: DE selection + tier selection.
11+
# Desktop packages are installed by armbian-config's module_desktops
12+
# at image-build time (see distro-agnostic.sh). This file collects
13+
# the two user-facing choices: which DE and which tier.
14+
#
15+
# The available DEs are queried from armbian-config's YAML-driven
16+
# desktop definitions. The configng repo is cloned into cache/sources/
17+
# via the build framework's standard fetch_from_repo, then the
18+
# standalone Python parser runs on the host (no chroot, no root).
19+
#
20+
# Variables set:
21+
# DESKTOP_ENVIRONMENT — xfce, gnome, kde-plasma, mate, cinnamon, ...
22+
# DESKTOP_TIER — minimal, mid, full
23+
#
24+
# Legacy variables (removed — armbian-config YAML tiers subsume them):
25+
# DESKTOP_ENVIRONMENT_CONFIG_NAME
26+
# DESKTOP_APPGROUPS_SELECTED
4327

44-
function desktop_environments_prepare_menu() {
45-
for desktop_env_dir in "${DESKTOP_CONFIGS_DIR}/"*; do
46-
local desktop_env_name expert_infos="" desktop_element_supported_result=0
47-
desktop_env_name="$(basename "${desktop_env_dir}")"
48-
[[ "${EXPERT}" == "yes" ]] && expert_infos="[$(cat "${desktop_env_dir}/support" 2> /dev/null)]"
49-
desktop_element_supported "${desktop_env_dir}" "${ARCH}"
50-
[[ ${desktop_element_supported_result} == 0 ]] && options+=("${desktop_env_name}" "${desktop_env_name^} desktop environment ${expert_infos}")
51-
done
52-
return 0
53-
}
28+
function interactive_desktop_main_configuration() {
29+
[[ $BUILD_DESKTOP != "yes" ]] && return 0
5430

55-
function desktop_environment_check_if_valid() {
56-
local error_msg="" desktop_element_supported_result=0
57-
desktop_element_supported "${DESKTOP_ENVIRONMENT_DIRPATH}" "${ARCH}"
58-
59-
if [[ ${desktop_element_supported_result} == 0 ]]; then
60-
return
61-
elif [[ ${desktop_element_supported_result} == 64 ]]; then
62-
error_msg+="Either the desktop environment ${DESKTOP_ENVIRONMENT} does not exist "
63-
error_msg+="or the file ${DESKTOP_ENVIRONMENT_DIRPATH}/support is missing"
64-
elif [[ ${desktop_element_supported_result} == 65 ]]; then
65-
error_msg+="Only experts can build an image with the desktop environment \"${DESKTOP_ENVIRONMENT}\", since the Armbian team won't offer any support for it (EXPERT=${EXPERT})"
66-
elif [[ ${desktop_element_supported_result} == 66 ]]; then
67-
error_msg+="The desktop environment \"${DESKTOP_ENVIRONMENT}\" has no packages for your targeted board architecture (BOARD=${BOARD} ARCH=${ARCH}). "
68-
error_msg+="The supported boards architectures are : "
69-
error_msg+="$(cat "${DESKTOP_ENVIRONMENT_DIRPATH}/architectures")"
70-
fi
31+
display_alert "desktop-config" "DESKTOP_ENVIRONMENT entry: ${DESKTOP_ENVIRONMENT}" "debug"
7132

72-
# supress error when cache is rebuilding
73-
[[ -n "$ROOT_FS_CREATE_ONLY" ]] && exit 0
33+
# --- DE selection ---
34+
if [[ -z $DESKTOP_ENVIRONMENT ]]; then
7435

75-
exit_with_error "${error_msg}"
76-
}
36+
# Fetch armbian-config (configng) to get the YAML desktop
37+
# definitions and the standalone Python parser.
38+
fetch_from_repo "https://github.com/armbian/configng" "armbian-configng" "branch:main"
7739

78-
function interactive_desktop_main_configuration() {
79-
[[ $BUILD_DESKTOP != "yes" ]] && return 0 # Only for desktops.
40+
local configng_dir="${SRC}/cache/sources/armbian-configng"
41+
local yaml_dir="${configng_dir}/tools/modules/desktops/yaml"
42+
local parser="${configng_dir}/tools/modules/desktops/scripts/parse_desktop_yaml.py"
8043

81-
DESKTOP_ELEMENTS_DIR="${SRC}/config/desktop/${RELEASE}"
82-
DESKTOP_CONFIGS_DIR="${DESKTOP_ELEMENTS_DIR}/environments"
83-
DESKTOP_CONFIG_PREFIX="config_"
84-
DESKTOP_APPGROUPS_DIR="${DESKTOP_ELEMENTS_DIR}/appgroups"
44+
if [[ ! -f "${parser}" ]]; then
45+
exit_with_error "Desktop parser not found at ${parser}" \
46+
"armbian-config clone may be incomplete"
47+
fi
8548

86-
display_alert "desktop-config" "DESKTOP_ENVIRONMENT entry: ${DESKTOP_ENVIRONMENT}" "debug"
49+
local de_json
50+
de_json=$(python3 "${parser}" "${yaml_dir}" --list-json "${RELEASE}" "${ARCH}" 2>/dev/null)
51+
if [[ -z "${de_json}" ]]; then
52+
exit_with_error "No desktop environments available for ${RELEASE}/${ARCH}" \
53+
"Parser returned an empty list"
54+
fi
8755

88-
if [[ -z $DESKTOP_ENVIRONMENT ]]; then
89-
options=()
90-
desktop_environments_prepare_menu
91-
if [[ "${options[0]}" == "" ]]; then
92-
exit_with_error "No desktop environment seems to be available for your board ${BOARD} (ARCH : ${ARCH} - EXPERT : ${EXPERT})"
56+
# Build dialog options from the JSON output. Only show
57+
# `status: supported` DEs unless EXPERT mode is on.
58+
local -a options=()
59+
while IFS=$'\t' read -r de_name de_desc de_status; do
60+
[[ -z "${de_name}" ]] && continue
61+
if [[ "${de_status}" != "supported" && "${EXPERT}" != "yes" ]]; then
62+
continue
63+
fi
64+
local label="${de_desc}"
65+
[[ "${de_status}" != "supported" ]] && label="${de_desc} [${de_status}]"
66+
options+=("${de_name}" "${label}")
67+
done < <(echo "${de_json}" | python3 -c "
68+
import sys, json
69+
for de in json.load(sys.stdin):
70+
if de.get('supported'):
71+
print(de.get('name','') + '\t' + de.get('description','') + '\t' + de.get('status',''))
72+
" 2>/dev/null)
73+
74+
if [[ "${#options[@]}" -eq 0 ]]; then
75+
exit_with_error "No desktop environments available for ${RELEASE}/${ARCH}"
9376
fi
9477

95-
display_alert "Desktops available" "${options[*]}" "debug"
96-
dialog_menu "Choose a desktop environment" "$backtitle" "Select the default desktop environment to bundle with this image" "${options[@]}"
78+
dialog_menu "Choose a desktop environment" "$backtitle" \
79+
"Select the default desktop environment to bundle with this image" \
80+
"${options[@]}"
9781
set_interactive_config_value DESKTOP_ENVIRONMENT "${DIALOG_MENU_RESULT}"
9882

99-
unset options
10083
if [[ -z "${DESKTOP_ENVIRONMENT}" ]]; then
101-
exit_with_error "No desktop environment selected..."
84+
exit_with_error "No desktop environment selected"
10285
fi
10386
fi
10487

10588
display_alert "desktop-config" "DESKTOP_ENVIRONMENT selected: ${DESKTOP_ENVIRONMENT}" "debug"
10689

107-
DESKTOP_ENVIRONMENT_DIRPATH="${DESKTOP_CONFIGS_DIR}/${DESKTOP_ENVIRONMENT}"
108-
desktop_environment_check_if_valid # Make sure desktop config is sane.
109-
110-
display_alert "desktop-config" "DESKTOP_ENVIRONMENT_CONFIG_NAME entry: ${DESKTOP_ENVIRONMENT_CONFIG_NAME}" "debug"
111-
112-
if [[ -z $DESKTOP_ENVIRONMENT_CONFIG_NAME ]]; then
113-
# @FIXME: Myy: Check for empty folders, just in case the current maintainer messed up
114-
# Note, we could also ignore it and don't show anything in the previous menu, but that hides information and make debugging harder, which I
115-
# don't like. Adding desktop environments as a maintainer is not a trivial nor common task.
116-
options=()
117-
for configuration in "${DESKTOP_ENVIRONMENT_DIRPATH}/${DESKTOP_CONFIG_PREFIX}"*; do
118-
config_filename=$(basename ${configuration})
119-
config_name=${config_filename#"${DESKTOP_CONFIG_PREFIX}"}
120-
options+=("${config_filename}" "${config_name} configuration")
121-
done
122-
123-
dialog_menu "Choose the desktop environment config" "$backtitle" "Select the configuration for this environment." "${options[@]}"
124-
set_interactive_config_value DESKTOP_ENVIRONMENT_CONFIG_NAME "${DIALOG_MENU_RESULT}"
125-
unset options
126-
127-
if [[ -z $DESKTOP_ENVIRONMENT_CONFIG_NAME ]]; then
128-
exit_with_error "No desktop configuration selected... Do you really want a desktop environment ?"
90+
# --- Tier selection ---
91+
if [[ -z $DESKTOP_TIER ]]; then
92+
local -a options=(
93+
"minimal" "DE + display manager (~500 MB)"
94+
"mid" "Browser, file manager, media apps (~1 GB)"
95+
"full" "Office, creative, dev tools (~2.5 GB)"
96+
)
97+
dialog_menu "Choose desktop tier" "$backtitle" \
98+
"Select which package set to install with this desktop.\nTiers can be upgraded or downgraded at any time\nusing armbian-config on the running system." \
99+
"${options[@]}"
100+
set_interactive_config_value DESKTOP_TIER "${DIALOG_MENU_RESULT}"
101+
102+
if [[ -z "${DESKTOP_TIER}" ]]; then
103+
DESKTOP_TIER="mid"
129104
fi
130105
fi
131-
display_alert "desktop-config" "DESKTOP_ENVIRONMENT_CONFIG_NAME exit: ${DESKTOP_ENVIRONMENT_CONFIG_NAME}" "debug"
132-
133-
declare -g DESKTOP_ENVIRONMENT_PACKAGE_LIST_DIRPATH="${DESKTOP_ENVIRONMENT_DIRPATH}/${DESKTOP_ENVIRONMENT_CONFIG_NAME}"
134-
declare -g DESKTOP_ENVIRONMENT_PACKAGE_LIST_FILEPATH="${DESKTOP_ENVIRONMENT_PACKAGE_LIST_DIRPATH}/packages"
135-
136-
display_alert "desktop-config" "DESKTOP_APPGROUPS_SELECTED+x entry: ${DESKTOP_APPGROUPS_SELECTED+x}" "debug"
137-
# "-z ${VAR+x}" allows to check for unset variable
138-
# Technically, someone might want to build a desktop with no additional
139-
# appgroups.
140-
if [[ -z ${DESKTOP_APPGROUPS_SELECTED+x} ]]; then
141-
options=()
142-
for appgroup_path in "${DESKTOP_APPGROUPS_DIR}/"*; do
143-
appgroup="$(basename "${appgroup_path}")"
144-
options+=("${appgroup}" "${appgroup^}" off)
145-
done
146-
147-
dialog_checklist "Choose desktop softwares to add" "$backtitle" "Select which kind of softwares you'd like to add to your build" "${options[@]}"
148-
set_interactive_config_value DESKTOP_APPGROUPS_SELECTED "${DIALOG_CHECKLIST_RESULT}"
149-
unset options
150-
fi
151-
display_alert "desktop-config" "DESKTOP_APPGROUPS_SELECTED exit: ${DESKTOP_APPGROUPS_SELECTED}" "debug"
106+
107+
display_alert "desktop-config" "DESKTOP_TIER selected: ${DESKTOP_TIER}" "debug"
152108
}

lib/functions/configuration/main-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ function write_config_summary_output_file() {
518518
Minimal: $BUILD_MINIMAL
519519
Desktop: $BUILD_DESKTOP
520520
Desktop Environment: $DESKTOP_ENVIRONMENT
521-
Software groups: $DESKTOP_APPGROUPS_SELECTED
521+
Desktop Tier: $DESKTOP_TIER
522522
523523
Kernel configuration:
524524
Repository: $KERNELSOURCE

lib/functions/main/build-packages.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,8 @@ function determine_artifacts_to_build_for_image() {
4444
# Userspace, BOARD+BRANCH specific (not RELEASE)
4545
artifacts_to_build+=("armbian-bsp-cli")
4646

47-
# Userspace, RELEASE-specific artifacts.
48-
if [[ -n "${RELEASE}" ]]; then
49-
if [[ -n "${DESKTOP_ENVIRONMENT}" ]]; then
50-
artifacts_to_build+=("armbian-desktop")
51-
artifacts_to_build+=("armbian-bsp-desktop")
52-
fi
53-
fi
47+
# Desktop packages are now installed by armbian-config (module_desktops)
48+
# during rootfs creation in distro-agnostic.sh. No per-DE artifact to build.
5449

5550
# If we're only dumping the config, include the rootfs artifact.
5651
# In a "real" build, this artifact is built/consumed by get_or_create_rootfs_cache_chroot_sdcard(), not here.

lib/functions/main/config-prepare.sh

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -357,30 +357,15 @@ function check_config_userspace_release_and_desktop() {
357357
exit_with_target_not_supported_error "RELEASE '${RELEASE}' does not support ARCH '${ARCH}'; see ${release_distro_arches_file}"
358358
fi
359359

360-
# Desktop sanity checks, in the same vein.
360+
# Desktop sanity checks.
361361
if [[ "${DESKTOP_ENVIRONMENT}" != "" ]]; then
362-
363-
# If DESKTOP_ENVIRONMENT is set, but BUILD_DESKTOP is not, then we have a problem.
364362
if [[ "${BUILD_DESKTOP}" != "yes" ]]; then
365363
exit_with_error "DESKTOP_ENVIRONMENT is set, but BUILD_DESKTOP is not ==yes - please fix your parameters."
366364
fi
367-
368-
declare desktop_release_distro_dir="${SRC}/config/desktop/${RELEASE}/environments/${DESKTOP_ENVIRONMENT}"
369-
declare desktop_release_distro_arches_file="${release_distro_dir}/architectures"
370-
371-
if [[ ! -d "${desktop_release_distro_dir}" ]]; then
372-
exit_with_target_not_supported_error "RELEASE '${RELEASE}' and Desktop Environment '${DESKTOP_ENVIRONMENT}' combination is not supported; there is no '${desktop_release_distro_dir}' directory."
373-
fi
374-
375-
if [[ ! -f "${desktop_release_distro_arches_file}" ]]; then
376-
exit_with_target_not_supported_error "RELEASE '${RELEASE}' and Desktop Environment '${DESKTOP_ENVIRONMENT}' combination is not supported; there is no '${desktop_release_distro_arches_file}' file."
377-
fi
378-
379-
if grep -q "${ARCH}" "${desktop_release_distro_arches_file}"; then
380-
display_alert "RELEASE '${RELEASE}' and Desktop Environment '${DESKTOP_ENVIRONMENT}' combination is supported" "RELEASE=${RELEASE} ARCH=${ARCH}; see ${desktop_release_distro_arches_file}" "debug"
381-
else
382-
exit_with_target_not_supported_error "RELEASE '${RELEASE}' and Desktop Environment '${DESKTOP_ENVIRONMENT}' combination is not supported; see ${desktop_release_distro_arches_file}"
383-
fi
365+
# Validation of (RELEASE, ARCH, DESKTOP_ENVIRONMENT) support is
366+
# deferred to armbian-config's module_desktops install call in
367+
# distro-agnostic.sh — it checks the YAML definitions and
368+
# fails with a clear message if the combo isn't covered.
384369
fi
385370
fi
386371

0 commit comments

Comments
 (0)