From 4742868414357d39ad0a93297df0f76ebc80cd42 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sun, 8 Sep 2024 19:43:55 +0200 Subject: [PATCH] `Userspace`: Switch armbian-config to new generation. It has very small footprint, thus it will be installed by default --- .../artifacts/artifact-armbian-config.sh | 4 +-- .../packages/armbian-config-deb.sh | 35 +++++++++---------- lib/functions/main/build-packages.sh | 4 +-- lib/functions/rootfs/distro-agnostic.sh | 4 +-- 4 files changed, 20 insertions(+), 27 deletions(-) diff --git a/lib/functions/artifacts/artifact-armbian-config.sh b/lib/functions/artifacts/artifact-armbian-config.sh index 979daee13f55..aa5e03a4c2af 100644 --- a/lib/functions/artifacts/artifact-armbian-config.sh +++ b/lib/functions/artifacts/artifact-armbian-config.sh @@ -15,8 +15,8 @@ function artifact_armbian-config_prepare_version() { artifact_version="undetermined" # outer scope artifact_version_reason="undetermined" # outer scope - local ARMBIAN_CONFIG_SOURCE="${ARMBIAN_CONFIG_SOURCE:-"https://github.com/armbian/config"}" - local ARMBIAN_CONFIG_BRANCH="branch:${ARMBIAN_CONFIG_BRANCH:-"master"}" + local ARMBIAN_CONFIG_SOURCE="${ARMBIAN_CONFIG_SOURCE:-"https://github.com/armbian/configng"}" + local ARMBIAN_CONFIG_BRANCH="branch:${ARMBIAN_CONFIG_BRANCH:-"main"}" debug_var ARMBIAN_CONFIG_SOURCE debug_var ARMBIAN_CONFIG_BRANCH diff --git a/lib/functions/compilation/packages/armbian-config-deb.sh b/lib/functions/compilation/packages/armbian-config-deb.sh index 0922cbc26b4a..8f8061a804b5 100644 --- a/lib/functions/compilation/packages/armbian-config-deb.sh +++ b/lib/functions/compilation/packages/armbian-config-deb.sh @@ -18,12 +18,13 @@ compile_armbian-config() { declare armbian_config_dir="armbian-config" mkdir -p "${tmp_dir}/${armbian_config_dir}" - local ARMBIAN_CONFIG_GIT_SOURCE="${ARMBIAN_FIRMWARE_GIT_SOURCE:-"https://github.com/armbian/config"}" - local ARMBIAN_CONFIG_GIT_BRANCH="${ARMBIAN_FIRMWARE_GIT_BRANCH:-"master"}" + local ARMBIAN_CONFIG_GIT_SOURCE="${ARMBIAN_FIRMWARE_GIT_SOURCE:-"https://github.com/armbian/configng"}" + local ARMBIAN_CONFIG_GIT_BRANCH="${ARMBIAN_FIRMWARE_GIT_BRANCH:-"main"}" - fetch_from_repo "https://github.com/armbian/config" "armbian-config" "branch:master" # this is also not getting any updates - fetch_from_repo "https://github.com/dylanaraps/neofetch" "neofetch" "tag:7.1.0" + fetch_from_repo "$GITHUB_SOURCE/dylanaraps/neofetch" "neofetch" "tag:7.1.0" + fetch_from_repo "$GITHUB_SOURCE/armbian/configng" "armbian-config" "branch:main" + fetch_from_repo "$GITHUB_SOURCE/complexorganizations/wireguard-manager" "wireguard-manager" "branch:main" # Fetch Armbian config from git. declare fetched_revision @@ -33,7 +34,7 @@ compile_armbian-config() { # @TODO: move this to where it is actually used; not everyone needs to pull this in fetch_from_repo "$GITHUB_SOURCE/complexorganizations/wireguard-manager" "wireguard-manager" "branch:main" - mkdir -p "${tmp_dir}/${armbian_config_dir}"/{DEBIAN,usr/bin/,usr/sbin/,usr/lib/armbian-config/} + mkdir -p "${tmp_dir}/${armbian_config_dir}"/{DEBIAN,bin/,lib/armbian-configng/,usr/bin/} cd "${tmp_dir}/${armbian_config_dir}" || exit_with_error "can't change directory" @@ -43,31 +44,27 @@ compile_armbian-config() { Version: ${artifact_version} Architecture: all Maintainer: $MAINTAINER <$MAINTAINERMAIL> - Depends: bash, iperf3, psmisc, curl, bc, expect, dialog, pv, zip, debconf-utils, unzip, build-essential, html2text, html2text, dirmngr, software-properties-common, debconf, jq - Suggests: libpam-google-authenticator, qrencode, network-manager, sunxi-tools + Depends: whiptail, jq Section: utils Priority: optional - Description: Armbian configuration utility + Description: Armbian configuration utility New Generation END install -m 755 "${SRC}"/cache/sources/neofetch/neofetch "${tmp_dir}/${armbian_config_dir}"/usr/bin/neofetch cd "${tmp_dir}/${armbian_config_dir}"/usr/bin/ || exit_with_error "Failed to cd to ${tmp_dir}/${armbian_config_dir}/usr/bin/" process_patch_file "${SRC}/patch/misc/add-armbian-neofetch.patch" "applying" + # 3rd party utilities install -m 755 "${SRC}"/cache/sources/wireguard-manager/wireguard-manager.sh "${tmp_dir}/${armbian_config_dir}"/usr/bin/wireguard-manager - install -m 755 "${SRC}"/cache/sources/armbian-config/scripts/tv_grab_file "${tmp_dir}/${armbian_config_dir}"/usr/bin/tv_grab_file - install -m 755 "${SRC}"/cache/sources/armbian-config/debian-config "${tmp_dir}/${armbian_config_dir}"/usr/sbin/armbian-config - install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-jobs "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/jobs.sh - install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-submenu "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/submenu.sh - install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-functions "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/functions.sh - install -m 644 "${SRC}"/cache/sources/armbian-config/debian-config-functions-network "${tmp_dir}/${armbian_config_dir}"/usr/lib/armbian-config/functions-network.sh - install -m 755 "${SRC}"/cache/sources/armbian-config/softy "${tmp_dir}/${armbian_config_dir}"/usr/sbin/softy - # fallback to replace armbian-config in BSP - ln -sf /usr/sbin/armbian-config "${tmp_dir}/${armbian_config_dir}"/usr/bin/armbian-config - ln -sf /usr/sbin/softy "${tmp_dir}/${armbian_config_dir}"/usr/bin/softy - dpkg_deb_build "${tmp_dir}/${armbian_config_dir}" "armbian-config" + # Armbian config parts + install -m 755 "${SRC}"/cache/sources/armbian-config/bin/armbian-configng "${tmp_dir}/${armbian_config_dir}"/bin/armbian-configng + cp -R "${SRC}"/cache/sources/armbian-config/lib/armbian-configng/ "${tmp_dir}/${armbian_config_dir}"/lib/ + # Linking + ln -sf /bin/armbian-configng "${tmp_dir}/${armbian_config_dir}"/usr/bin/armbian-config + + dpkg_deb_build "${tmp_dir}/${armbian_config_dir}" "armbian-config" done_with_temp_dir "${cleanup_id}" # changes cwd to "${SRC}" and fires the cleanup function early } diff --git a/lib/functions/main/build-packages.sh b/lib/functions/main/build-packages.sh index e00b64f272e8..f3f0a6fde98b 100644 --- a/lib/functions/main/build-packages.sh +++ b/lib/functions/main/build-packages.sh @@ -32,9 +32,7 @@ function determine_artifacts_to_build_for_image() { fi if [[ "${PACKAGE_LIST_RM}" != *armbian-config* ]]; then - if [[ $BUILD_MINIMAL != yes ]]; then - artifacts_to_build+=("armbian-config") - fi + artifacts_to_build+=("armbian-config") fi if [[ "${PACKAGE_LIST_RM}" != *armbian-zsh* ]]; then diff --git a/lib/functions/rootfs/distro-agnostic.sh b/lib/functions/rootfs/distro-agnostic.sh index 64b17ea36cdd..273b27182ea0 100644 --- a/lib/functions/rootfs/distro-agnostic.sh +++ b/lib/functions/rootfs/distro-agnostic.sh @@ -335,9 +335,7 @@ function install_distribution_agnostic() { # install armbian-config if [[ "${PACKAGE_LIST_RM}" != *armbian-config* ]]; then - if [[ $BUILD_MINIMAL != yes ]]; then - install_artifact_deb_chroot "armbian-config" - fi + install_artifact_deb_chroot "armbian-config" fi # install armbian-zsh