Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/templates/targets-all-kernels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Target file for all kernel artifacts across all non-eos boards.

targets:
all-kernels:
pipeline:
only-artifacts: [ "kernel" ]
vars:
BUILD_MINIMAL: "yes"
BUILD_DESKTOP: "no"
RELEASE: "sid"
items-from-inventory:
not-eos: yes # not-eos boards, all branches
2 changes: 2 additions & 0 deletions lib/functions/artifacts/artifact-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
function artifact_kernel_config_dump() {
# BOARD is NOT included. See explanation below.
artifact_input_variables[LINUXFAMILY]="${LINUXFAMILY}"
artifact_input_variables[LINUXCONFIG]="${LINUXCONFIG}"
artifact_input_variables[ARMBIAN_KERNEL_DEB_NAME]="${LINUXFAMILY}-${BRANCH}"
artifact_input_variables[BRANCH]="${BRANCH}"
artifact_input_variables[KERNEL_MAJOR_MINOR]="${KERNEL_MAJOR_MINOR}"
artifact_input_variables[KERNELSOURCE]="${KERNELSOURCE}"
Expand Down
28 changes: 28 additions & 0 deletions lib/functions/cli/cli-jsoninfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ function cli_json_info_run() {

prep_conf_main_minimal_ni

# shellcheck disable=SC2317
function json_info_logged() { # logging wrapper
LOG_SECTION="json_info" do_with_logging json_info_only
}

# shellcheck disable=SC2317
function json_info_only() {
prepare_python_and_pip # requires HOSTRELEASE

Expand Down Expand Up @@ -113,6 +115,9 @@ function cli_json_info_run() {
declare IMAGE_INFO_CSV_FILE="${BASE_INFO_OUTPUT_DIR}/image-info.csv"
declare INVENTORY_BOARDS_CSV_FILE="${BASE_INFO_OUTPUT_DIR}/boards-inventory.csv"
declare REDUCED_ARTIFACTS_FILE="${BASE_INFO_OUTPUT_DIR}/artifacts-reduced.json"
declare REDUCED_KERNELS_FILE="${BASE_INFO_OUTPUT_DIR}/kernels.ndjson"
declare REDUCED_KERNELS_DUPLICATE_LINUXCONFIG_FILE="${BASE_INFO_OUTPUT_DIR}/kernels-duplicate-config.json"
declare REDUCED_UBOOTS_FILE="${BASE_INFO_OUTPUT_DIR}/uboots.ndjson"
declare ARTIFACTS_INFO_FILE="${BASE_INFO_OUTPUT_DIR}/artifacts-info.json"
declare ARTIFACTS_INFO_UPTODATE_FILE="${BASE_INFO_OUTPUT_DIR}/artifacts-info-uptodate.json"
declare OUTDATED_ARTIFACTS_IMAGES_FILE="${BASE_INFO_OUTPUT_DIR}/outdated-artifacts-images.json"
Expand Down Expand Up @@ -199,6 +204,29 @@ function cli_json_info_run() {
if [[ ! -f "${REDUCED_ARTIFACTS_FILE}" ]]; then
display_alert "Reducing info into artifacts" "artifact-reducer" "info"
run_host_command_logged "${PYTHON3_VARS[@]}" "${PYTHON3_INFO[BIN]}" "${INFO_TOOLS_DIR}"/artifact-reducer.py "${IMAGE_INFO_FILE}" ">" "${REDUCED_ARTIFACTS_FILE}"

# Simple jq to get reduced kernels, with board and branch coordinates and number of images for each; NDJSON (newline-delimited JSON) format.
jq -c '.[] | select(.artifact_name == "kernel") | {"vars": .original_inputs.vars,"kernel":.inputs.LINUXFAMILY,"needed_by":.needed_by,"ARMBIAN_KERNEL_DEB_NAME":.inputs.ARMBIAN_KERNEL_DEB_NAME,"LINUXCONFIG":.inputs.LINUXCONFIG,"KERNELSOURCE":.inputs.KERNELSOURCE,"KERNELBRANCH":.inputs.KERNELBRANCH} | {"BOARD":.vars.BOARD,"BRANCH":.vars.BRANCH,"kernel":.kernel,"needed_by":.needed_by,"ARMBIAN_KERNEL_DEB_NAME":.ARMBIAN_KERNEL_DEB_NAME,"LINUXCONFIG":.LINUXCONFIG,"KERNELSOURCE":.KERNELSOURCE,"KERNELBRANCH":.KERNELBRANCH}' < "${REDUCED_ARTIFACTS_FILE}" > "${REDUCED_KERNELS_FILE}"

# Similar, but for u-boot's.
jq -c '.[] | select(.artifact_name == "uboot") | {"vars": .original_inputs.vars,"needed_by":.needed_by} | {"BOARD":.vars.BOARD,"BRANCH":.vars.BRANCH,"needed_by":.needed_by}' < "${REDUCED_ARTIFACTS_FILE}" > "${REDUCED_UBOOTS_FILE}"

# Kernels: find duplicate LINUXCONFIG's across the kernels, which is a mistake. Each LINUXFAMILY should have its own LINUXCONFIG, otherwise rewrites will go insane.
display_alert "Checking for duplicate LINUXCONFIG's across kernels" "kernel-dup-linuxconfig-check" "info"
jq -s 'to_entries | map(.value) | group_by(.LINUXCONFIG) | map(select(length > 1)) | map({LINUXCONFIG: .[0].LINUXCONFIG,duplicates: map({BOARD, ARMBIAN_KERNEL_DEB_NAME, BRANCH, KERNELSOURCE, KERNELBRANCH})})' "${REDUCED_KERNELS_FILE}" > "${REDUCED_KERNELS_DUPLICATE_LINUXCONFIG_FILE}"

# if "${REDUCED_KERNELS_DUPLICATE_LINUXCONFIG_FILE}" is larger than 3 bytes, we have duplicates; spit an error (don't exit)
if [[ $(stat -c%s "${REDUCED_KERNELS_DUPLICATE_LINUXCONFIG_FILE}") -gt 3 ]]; then
display_alert "Duplicate LINUXCONFIG's found!" "See ${REDUCED_KERNELS_DUPLICATE_LINUXCONFIG_FILE} for details" "err"
run_host_command_logged jq -C '.' "${REDUCED_KERNELS_DUPLICATE_LINUXCONFIG_FILE}"
else
display_alert "No duplicate LINUXCONFIG's found" "all good" "info"
fi
fi

if [[ "${ARMBIAN_COMMAND}" == "inventory-artifacts" ]]; then
display_alert "Done with" "inventory-artifacts" "info"
return 0
fi

# The artifact info extractor.
Expand Down
20 changes: 11 additions & 9 deletions lib/functions/cli/commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ function armbian_register_commands() {
["config-dump-json"]="config_dump_json" # implemented in cli_config_dump_json_pre_run and cli_config_dump_json_run
["config-dump-no-json"]="config_dump_json" # implemented in cli_config_dump_json_pre_run and cli_config_dump_json_run

["inventory"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["targets"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["targets-dashboard"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["inventory-boards"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["targets-composed"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["debs-to-repo-json"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["gha-matrix"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["gha-workflow"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["gha-template"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["inventory"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["targets"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["targets-dashboard"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["inventory-boards"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["inventory-artifacts"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["targets-composed"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["debs-to-repo-json"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["gha-matrix"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["gha-workflow"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["gha-template"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run

# These probably should be in their own separate CLI commands file, but for now they're together in jsoninfo.
["debs-to-repo-download"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
Expand Down Expand Up @@ -118,6 +119,7 @@ function armbian_register_commands() {

# inventory
["inventory-boards"]="TARGETS_FILE='something_that_does_not_exist_so_defaults_are_used'"
["inventory-artifacts"]="TARGETS_FILE='something_that_does_not_exist_so_defaults_are_used'"

# patching
["rewrite-kernel-patches"]="REWRITE_PATCHES='yes'" # rewrite the patches after round-tripping to git: "rebase patches"
Expand Down