From 69b80343ddba88ec9b6610a21977586f5b388040 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 30 Sep 2024 13:41:28 +0200 Subject: [PATCH 1/6] Add action for generation documentation --- .github/workflows/docs.yml | 39 ++++++++++++++++++++++++++ lib/armbian-configng/config.ng.docs.sh | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..7ca0ceb8 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,39 @@ +name: "Regenerate documentation" + +on: + push: + workflow_dispatch: + +jobs: + + Build: + name: Make docs + runs-on: ubuntu-latest + #if: ${{ github.repository_owner == 'armbian' }} + steps: + + - name: Checkout build repo + uses: actions/checkout@v4 + - name: Make docs + run: | + bin/armbian-configng --doc + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: '`Automatic` documentation update' + signoff: false + branch: update-docs + delete-branch: true + title: '`Automatic` documentation update' + body: | + Generate documentation. + + labels: | + Needs review + #assignees: igorpecovnik + #reviewers: Must be org collaborator + draft: false + diff --git a/lib/armbian-configng/config.ng.docs.sh b/lib/armbian-configng/config.ng.docs.sh index cf3bb46d..194f2863 100644 --- a/lib/armbian-configng/config.ng.docs.sh +++ b/lib/armbian-configng/config.ng.docs.sh @@ -23,7 +23,7 @@ function generate_readme() { echo -e "Sorting data\nUpdating documentation" # current_date ; - cat << EOF > "$script_dir/../README.md" + cat << EOF > "$script_dir/../DOCUMENTATION.md" # Armbian Configuration Utility Updated: $current_date From 24ebbfff8b1b069a6c402e10c3f55c81215ce1e4 Mon Sep 17 00:00:00 2001 From: igorpecovnik <6281704+igorpecovnik@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:06:25 +0000 Subject: [PATCH 2/6] `Automatic` documentation update --- DOCUMENTATION.md | 671 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 671 insertions(+) create mode 100644 DOCUMENTATION.md diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md new file mode 100644 index 00000000..fe65f58d --- /dev/null +++ b/DOCUMENTATION.md @@ -0,0 +1,671 @@ + +# Armbian Configuration Utility +Updated: Mon Sep 30 12:06:20 UTC 2024 + +Utility for configuring your board, adjusting services, and installing applications. It comes with Armbian by default. + +To start the Armbian configuration utility, use the following command: +~~~ +sudo armbian-config +~~~ + +- ## **System** + - **S01** - Enable Armbian kernel/firmware upgrades + - **S02** - Disable Armbian kernel upgrades + - **S03** - Edit the boot environment + - **S04** - Install Linux headers + - **S05** - Remove Linux headers + - **S06** - Install to internal storage + - **S07.1** - Manage SSH login options + - **S17** - Change shell system wide to BASH + - **S18** - Change shell system wide to ZSH + - **S19** - Switch to rolling release + - **S20** - Switch to stable release + - **S21** - Enable read only filesystem + - **S22** - Disable read only filesystem + - **S23** - Adjust welcome screen (motd) + - **S24** - Install alternative kernels + + +- ## **Network** + - **N01** - Configure network interfaces + - **N15** - Install Bluetooth support + - **N16** - Remove Bluetooth support + - **N17** - Bluetooth Discover + - **N18** - Toggle system IPv6/IPv4 internet protocol + + +- ## **Localisation** + - **L00** - Change Global timezone (WIP) + - **L01** - Change Locales reconfigure the language and character set + - **L02** - Change Keyboard layout + - **L03** - Change APT mirrors + + +- ## **Software** + - **Desktops** - Install Desktop Environments + - **Netconfig** - Network tools + - **DevTools** - Development + - **Benchy** - System benchmaking and diagnostics + - **Containers** - Containerlization and Virtual Machines + - **Media** - Media Servers and Editors + - **Management** - Remote Management tools + + +- ## **Help** + - **H00** - About This system. (WIP) + - **H02** - List of Config function(WIP) + +## Install +Armbian installation +~~~ +sudo apt install armbian-config +~~~ + +3rd party Debian based distributions +~~~ +{ + sudo wget https://apt.armbian.com/armbian.key -O key + sudo gpg --dearmor < key | sudo tee /usr/share/keyrings/armbian.gpg > /dev/null + sudo chmod go+r /usr/share/keyrings/armbian.gpg + sudo echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/armbian.gpg] http://apt.armbian.com $(lsb_release -cs) main $(lsb_release -cs)-utils $(lsb_release -cs)-desktop" | sudo tee /etc/apt/sources.list.d/armbian.list + sudo apt update + sudo apt install armbian-config +} +~~~ + +*** + +## CLI options +Command line options. + +Use: +~~~ +armbian-config --help +~~~ + +Outputs: +~~~ + + System - System wide and admin settings (x86_64) + --cmd S01 - Enable Armbian kernel/firmware upgrades + --cmd S02 - Disable Armbian kernel upgrades + --cmd S03 - Edit the boot environment + --cmd S04 - Install Linux headers + --cmd S05 - Remove Linux headers + --cmd S06 - Install to internal storage + S07.1 - Manage SSH login options + --cmd S07 - Disable root login + --cmd S08 - Enable root login + --cmd S09 - Disable password login + --cmd S10 - Enable password login + --cmd S11 - Disable Public key authentication login + --cmd S12 - Enable Public key authentication login + --cmd S13 - Disable OTP authentication + --cmd S14 - Enable OTP authentication + --cmd S15 - Generate new OTP authentication QR code + --cmd S16 - Show OTP authentication QR code + --cmd S30 - Disable last login banner + --cmd S31 - Enable last login banner + --cmd S17 - Change shell system wide to BASH + --cmd S18 - Change shell system wide to ZSH + --cmd S19 - Switch to rolling release + --cmd S20 - Switch to stable release + --cmd S21 - Enable read only filesystem + --cmd S22 - Disable read only filesystem + --cmd S23 - Adjust welcome screen (motd) + --cmd S24 - Install alternative kernels + + Network - Fixed and wireless network settings (eth0) + N01 - Configure network interfaces + --cmd N02 - Add interface + --cmd N03 - Revert to defaults + --cmd N04 - Show draft configuration + --cmd N05 - Apply changes + --cmd N06 - Show active status + --cmd N15 - Install Bluetooth support + --cmd N16 - Remove Bluetooth support + --cmd N17 - Bluetooth Discover + --cmd N18 - Toggle system IPv6/IPv4 internet protocol + + Localisation - Localisation (C.UTF-8) + --cmd L00 - Change Global timezone (WIP) + --cmd L01 - Change Locales reconfigure the language and character set + --cmd L02 - Change Keyboard layout + --cmd L03 - Change APT mirrors + + Software - Run/Install 3rd party applications (Update the package lists.) + Desktops - Install Desktop Environments + --cmd SW02 - Install XFCE desktop + --cmd SW03 - Install Gnome desktop + --cmd SW04 - Install i3-wm desktop + --cmd SW05 - Install Cinnamon desktop + --cmd SW06 - Install kde-neon desktop + Netconfig - Network tools + --cmd SW08 - Install realtime console network usage monitor (nload) + --cmd SW09 - Remove realtime console network usage monitor (nload) + --cmd SW10 - Install bandwidth measuring tool (iperf3) + --cmd SW11 - Remove bandwidth measuring tool (iperf3) + --cmd SW12 - Install IP LAN monitor (iptraf-ng) + --cmd SW13 - Remove IP LAN monitor (iptraf-ng) + --cmd SW14 - Install hostname broadcast via mDNS (avahi-daemon) + --cmd SW15 - Remove hostname broadcast via mDNS (avahi-daemon) + DevTools - Development + --cmd SW17 - Install tools for cloning and managing repositories (git) + --cmd SW18 - Remove tools for cloning and managing repositories (git) + --cmd Benchy - System benchmaking and diagnostics + Containers - Containerlization and Virtual Machines + --cmd SW25 - Install Docker Minimal + --cmd SW26 - Install Docker Engine + --cmd SW27 - Remove Docker + --cmd SW28 - Purge all Docker images, containers, and volumes + Media - Media Servers and Editors + --cmd SW21 - Install Plex Media server + --cmd SW22 - Remove Plex Media server + --cmd SW23 - Install Emby server + --cmd SW24 - Remove Emby server + Management - Remote Management tools + --cmd M00 - Install Cockpit web-based management tool + --cmd M01 - Purge Cockpit web-based management tool + --cmd M02 - Start Cockpit Service + --cmd M03 - Stop Cockpit Service + + Help - About this app + --cmd H00 - About This system. (WIP) + --cmd H02 - List of Config function(WIP) +~~~ + +## Legacy options +Backward Compatible options. + +Use: +~~~ +armbian-config main=Help +~~~ + +Outputs: +~~~ +Legacy Options (Backward Compatible) +Please use 'armbian-config --help' for more information. + +Usage: armbian-configng main=[arguments] selection=[options] + + armbian-configng main=System selection=Headers - Install headers: + armbian-configng main=System selection=Headers_remove - Remove headers: +~~~ + +*** + +## Development + +Development is divided into three sections: + +Click for more info: + +
+Jobs / JSON Object + +A list of the jobs defined in the Jobs file. +~~~ +### S01 + +Enable Armbian kernel/firmware upgrades + +Jobs: + +~~~ +armbian_fw_manipulate unhold +~~~ + +### S02 + +Disable Armbian kernel upgrades + +Jobs: + +~~~ +armbian_fw_manipulate hold +~~~ + +### S03 + +Edit the boot environment + +Jobs: + +~~~ +nano /boot/armbianEnv.txt +~~~ + +### S04 + +Install Linux headers + +Jobs: + +~~~ +Headers_install +~~~ + +### S05 + +Remove Linux headers + +Jobs: + +~~~ +Headers_remove +~~~ + +### S06 + +Install to internal storage + +Jobs: + +~~~ +armbian-install +~~~ + +### S07.1 + +Manage SSH login options + +Jobs: + +~~~ +No commands available +~~~ + +### S17 + +Change shell system wide to BASH + +Jobs: + +~~~ +export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1) +sed -i "s|^SHELL=.*|SHELL=${BASHLOCATION}|" /etc/default/useradd +sed -i "s|^DSHELL=.*|DSHELL=${BASHLOCATION}|" /etc/adduser.conf +apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux +update_skel +awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1) +~~~ + +### S18 + +Change shell system wide to ZSH + +Jobs: + +~~~ +export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1) +sed -i "s|^SHELL=.*|SHELL=${ZSHLOCATION}|" /etc/default/useradd +sed -i "s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|" /etc/adduser.conf +apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux +update_skel +awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1) +~~~ + +### S19 + +Switch to rolling release + +Jobs: + +~~~ +set_rolling +~~~ + +### S20 + +Switch to stable release + +Jobs: + +~~~ +set_stable +~~~ + +### S21 + +Enable read only filesystem + +Jobs: + +~~~ +manage_overlayfs enable +~~~ + +### S22 + +Disable read only filesystem + +Jobs: + +~~~ +manage_overlayfs disable +~~~ + +### S23 + +Adjust welcome screen (motd) + +Jobs: + +~~~ +adjust_motd +~~~ + +### S24 + +Install alternative kernels + +Jobs: + +~~~ +switch_kernels +~~~ + +### N01 + +Configure network interfaces + +Jobs: + +~~~ +No commands available +~~~ + +### N15 + +Install Bluetooth support + +Jobs: + +~~~ +see_current_apt +debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools +check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman +~~~ + +### N16 + +Remove Bluetooth support + +Jobs: + +~~~ +see_current_apt +debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools +check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman +debconf-apt-progress -- apt -y -qq autoremove +~~~ + +### N17 + +Bluetooth Discover + +Jobs: + +~~~ +connect_bt_interface +~~~ + +### N18 + +Toggle system IPv6/IPv4 internet protocol + +Jobs: + +~~~ +toggle_ipv6 | show_infobox +~~~ + +### L00 + +Change Global timezone (WIP) + +Jobs: + +~~~ +dpkg-reconfigure tzdata +~~~ + +### L01 + +Change Locales reconfigure the language and character set + +Jobs: + +~~~ +dpkg-reconfigure locales +source /etc/default/locale ; sed -i "s/^LANGUAGE=.*/LANGUAGE=$LANG/" /etc/default/locale +export LANGUAGE=$LANG +~~~ + +### L02 + +Change Keyboard layout + +Jobs: + +~~~ +dpkg-reconfigure keyboard-configuration ; setupcon +update-initramfs -u +~~~ + +### L03 + +Change APT mirrors + +Jobs: + +~~~ +get_user_continue "This is only a frontend test" process_input +~~~ + +### Desktops + +Install Desktop Environments + +Jobs: + +~~~ +No commands available +~~~ + +### Netconfig + +Network tools + +Jobs: + +~~~ +No commands available +~~~ + +### DevTools + +Development + +Jobs: + +~~~ +No commands available +~~~ + +### Benchy + +System benchmaking and diagnostics + +Jobs: + +~~~ +see_monitoring +~~~ + +### Containers + +Containerlization and Virtual Machines + +Jobs: + +~~~ +No commands available +~~~ + +### Media + +Media Servers and Editors + +Jobs: + +~~~ +No commands available +~~~ + +### Management + +Remote Management tools + +Jobs: + +~~~ +No commands available +~~~ + +### H00 + +About This system. (WIP) + +Jobs: + +~~~ +show_message <<< "This app is to help execute procedures to configure your system + +Some options may not work on manually modified systems" +~~~ + +### H02 + +List of Config function(WIP) + +Jobs: + +~~~ +show_message <<< see_use +~~~ +~~~ +
+ + +
+Jobs API / Helper Functions + +These helper functions facilitate various operations related to job management, such as creation, updating, deletion, and listing of jobs, acting as a practical API for developers. + +| Description | Example | Credit | +|:----------- | ------- |:------:| +| Generate a Help message legacy cli commands. | see_cli_legacy | Joey Turner +| Run time variables Migrated procedures from Armbian config. | set_runtime_variables | Igor Pecovnik +| Toggle SSH lastlog | toggle_ssh_lastlog | tearran +| Set Armbian to rolling release | set_rolling | Tearran +| Generate this markdown table of all module_options | see_function_table_md | Joey Turner +| Switching to alternative kernels | | Igor +| Set Armbian root filesystem to read only | manage_overlayfs enable|disable | igorpecovnik +| Display a menu from pipe | show_menu <<< armbianmonitor -h ; | Joey Turner +| Build the main menu from a object | generate_top_menu 'json_data' | Joey Turner +| Migrated procedures from Armbian config. | is_package_manager_running | Igor Pecovnik +| Migrated procedures from Armbian config. | check_desktop | Igor Pecovnik +| Generate Document files. | generate_readme | Joey Turner +| Needed by generate_menu | | Joey Turner +| Display a Yes/No dialog box and process continue/exit | get_user_continue 'Do you wish to continue?' process_input | Joey Turner +| Display a message box | show_message <<< 'hello world' | Joey Turner +| Migrated procedures from Armbian config. | connect_bt_interface | Igor Pecovnik +| Menu for armbianmonitor features | see_monitoring | Joey Turner +| Show or generate QR code for Google OTP | qr_code generate | Igor Pecovnik +| Check if kernel headers are installed | are_headers_installed | Gunjan Gupta +| Check when apt list was last updated and suggest updating or update | see_current_apt || see_current_apt update | Joey Turner +| Migrated procedures from Armbian config. | check_if_installed nano | Igor Pecovnik +| Generate 'Armbian CPU logo' SVG for document file. | generate_svg | Joey Turner +| Remove Linux headers | Headers_remove | Joey Turner +| Update submenu descriptions based on conditions | update_submenu_data | Joey Turner +| sanitize input cli | sanitize_input | +| Check if a domain is reachable via IPv4 and IPv6 | check_ip_version google.com | Joey Turner +| Migrated procedures from Armbian config. | set_header_remove | Igor Pecovnik +| Generate a submenu from a parent_id | generate_menu 'parent_id' | Joey Turner +| Generate a markdown list json objects using jq. | see_jq_menu_list | Joey Turner +| Generate jobs from JSON file. | generate_jobs_from_json | Joey Turner +| Install kernel headers | is_package_manager_running | Joey Turner +| Toggle IPv6 on or off | toggle_ipv6 | Joey Turner +| Adjust welcome screen (motd) | | igorpecovnik +| Generate JSON-like object file. | generate_json | Joey Turner +| Install DE | install_de | Igor Pecovnik +| Install wrapper | apt_install_wrapper apt-get -y purge armbian-zsh | igorpecovnik +| Netplan wrapper | network_config | Igor Pecovnik +| Change the background color of the terminal or dialog box | set_colors 0-7 | Joey Turner +| Serve the edit and debug server. | serve_doc | Joey Turner +| Update JSON data with system information | update_json_data | Joey Turner +| pipeline strings to an infobox | show_infobox <<< 'hello world' ; | Joey Turner +| Parse json to get list of desired menu or submenu items | parse_menu_items 'menu_options_array' | Gunjan Gupta +| Show the usage of the functions. | see_use | Joey Turner +| Generate a Help message for cli commands. | see_cmd_list [catagory] | Joey Turner +| Revert network config back to Armbian defaults | default_network_config | Igor Pecovnik +| freeze/unhold/reinstall armbian related packages. | armbian_fw_manipulate unhold|freeze|reinstall | Igor Pecovnik +| Check the internet connection with fallback DNS | see_ping | Joey Turner +| Install docker from a repo using apt | install_docker engine | Kat Schwarz +| Set Armbian to stable release | set_stable | Tearran +| Secure version of get_user_continue | get_user_continue_secure 'Do you wish to continue?' process_input | Joey Turner + + +
+ + +
+Runtime / Board Statuses + +(WIP) + +This section outlines the runtime environment to check configurations and statuses for dynamically managing jobs based on JSON data. + +(WIP) + +
+ + +## Testing and contributing + +
+Get Development + +Install the dependencies: +~~~ +sudo apt install git jq whiptail +~~~ + +Get Development and contribute: +~~~ +{ +git clone https://github.com/armbian/configng +cd configng +./armbian-configng --help +} +~~~ + +Install and test Development deb: +~~~ +{ + sudo apt install whiptail + latest_release=$(curl -s https://api.github.com/repos/armbian/configng/releases/latest) + deb_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith(".deb")) | .browser_download_url') + curl -LO "$deb_url" + deb_file=$(echo "$deb_url" | awk -F"/" '{print $NF}') + sudo dpkg -i "$deb_file" + sudo dpkg --configure -a + sudo apt --fix-broken install +} +~~~ + +
+ From e343f04db247bb8394d62baf330f58a7560edc10 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 30 Sep 2024 14:22:36 +0200 Subject: [PATCH 3/6] Remove `updated` section as will keep opening new pull requests We don't need this property here. --- lib/armbian-configng/config.ng.docs.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/armbian-configng/config.ng.docs.sh b/lib/armbian-configng/config.ng.docs.sh index 194f2863..d86595bc 100644 --- a/lib/armbian-configng/config.ng.docs.sh +++ b/lib/armbian-configng/config.ng.docs.sh @@ -26,7 +26,6 @@ function generate_readme() { cat << EOF > "$script_dir/../DOCUMENTATION.md" # Armbian Configuration Utility -Updated: $current_date Utility for configuring your board, adjusting services, and installing applications. It comes with Armbian by default. From 565223146e618fde61913fda3b41fd109ef55b6c Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Thu, 26 Sep 2024 21:49:02 +0200 Subject: [PATCH 4/6] Bugfix: firmware switch function was not working correctly --- lib/armbian-configng/config.ng.functions.sh | 33 ++++++++++++++------- lib/armbian-configng/config.ng.system.sh | 5 +++- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/lib/armbian-configng/config.ng.functions.sh b/lib/armbian-configng/config.ng.functions.sh index 4b82589d..b083e3b8 100644 --- a/lib/armbian-configng/config.ng.functions.sh +++ b/lib/armbian-configng/config.ng.functions.sh @@ -257,15 +257,16 @@ armbian_fw_manipulate() { [[ -n $version ]] && local version="=${version}" # fallback to $BRANCH - [[ -z $branch ]] && branch="${BRANCH}" + [[ -z "${branch}" ]] && branch="${BRANCH}" + [[ -z "${branch}" ]] && branch="current" # fallback in case we switch to very old BSP that have no such info # packages to install local armbian_packages=( "linux-u-boot-${BOARD}-${branch}" "linux-image-${branch}-${LINUXFAMILY}" "linux-dtb-${branch}-${LINUXFAMILY}" - "armbian-config" "armbian-zsh" + "armbian-bsp-cli-${BOARD}-${branch}" ) # reinstall headers only if they were previously installed @@ -276,26 +277,36 @@ armbian_fw_manipulate() { local packages="" for pkg in "${armbian_packages[@]}"; do if [[ "${function}" == reinstall ]]; then - apt search "$pkg" 2> /dev/null | grep "^$pkg" > /dev/null - if [[ $? -eq 0 ]]; then packages+="$pkg${version} "; fi + local pkg_search=$(apt search "$pkg" 2> /dev/null | grep "^$pkg") + if [[ $? -eq 0 && -n "${pkg_search}" ]]; then + if [[ "${pkg_search}" == *$version* ]] ; then + packages+="$pkg${version} "; + else + packages+="$pkg "; + fi + fi else if check_if_installed $pkg; then packages+="$pkg${version} " fi fi done - for pkg in "${packages[@]}"; do - local pkg_uninstall=${pkg/=*/} # removing numbers case $function in unhold) apt-mark unhold ${pkg} | show_infobox ;; hold) apt-mark hold ${pkg} | show_infobox ;; reinstall) - apt_install_wrapper apt-get -y --download-only --allow-change-held-packages --allow-downgrades install "${pkg}" - apt_install_wrapper apt-get -y purge "${pkg_uninstall/${branch}/*}" # remove all branches - apt_install_wrapper apt-get -y --allow-change-held-packages --allow-downgrades install "${pkg}" - apt_install_wrapper apt-get -y autoremove - apt_install_wrapper apt-get -y clean + apt_install_wrapper apt-get -y --simulate --download-only --allow-change-held-packages --allow-downgrades install ${pkg} + if [[ $? == 0 ]]; then + apt_install_wrapper apt-get -y purge "linux-u-boot-*" "linux-image-*" "linux-dtb-*" "linux-headers-*" "armbian-zsh-*" "armbian-bsp-cli-*" # remove all branches + apt_install_wrapper apt-get -y --allow-change-held-packages install ${pkg} + apt_install_wrapper apt-get -y autoremove + apt_install_wrapper apt-get -y clean + else + exit 1 + fi + + ;; *) return ;; esac diff --git a/lib/armbian-configng/config.ng.system.sh b/lib/armbian-configng/config.ng.system.sh index 4fffcc4f..66be03a1 100644 --- a/lib/armbian-configng/config.ng.system.sh +++ b/lib/armbian-configng/config.ng.system.sh @@ -12,11 +12,12 @@ module_options+=( # @description Use TUI / GUI for apt install if exists # function apt_install_wrapper() { + if [ -t 0 ]; then debconf-apt-progress -- "$@" else # Terminal not defined - proceed without TUI - "$@" + DEBIAN_FRONTEND=noninteractive "$@" fi } @@ -145,6 +146,7 @@ function set_stable() { if ! grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list; then sed -i "s/http:\/\/[^ ]*/http:\/\/apt.armbian.com/" /etc/apt/sources.list.d/armbian.list + apt_install_wrapper apt-get update armbian_fw_manipulate "reinstall" fi } @@ -164,6 +166,7 @@ function set_rolling() { if ! grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list; then sed -i "s/http:\/\/[^ ]*/http:\/\/beta.armbian.com/" /etc/apt/sources.list.d/armbian.list + apt_install_wrapper apt-get update armbian_fw_manipulate "reinstall" fi } From 93f4dc25ed76f5c80185b0430a626c7d28122891 Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 30 Sep 2024 20:22:35 +0200 Subject: [PATCH 5/6] Populate README.md with generic Armbian branding and tl;dr; info (#131) --- README.md | 596 ++++-------------------------------------------------- 1 file changed, 38 insertions(+), 558 deletions(-) diff --git a/README.md b/README.md index 140719a7..eac15db1 100644 --- a/README.md +++ b/README.md @@ -1,574 +1,54 @@ +

+ + Armbian Config NG Logo +
+ Armbian Config: The Next Generation
+
+GitHub Workflow Status GitHub Workflow Status GitHub Workflow Status +

-# Armbian Configuration Utility -Updated: Tue Sep 10 08:13:32 PM CDT 2024 -Utility for configuring your board, adjusting services, and installing applications. It comes with Armbian by default. +> Note: Some references may still use the old name during the transition period. -To start the Armbian configuration utility, use the following command: -~~~ -sudo armbian-config -~~~ +armbian-configng provides configuration scripts for customizing and automating tasks within Armbian environments. These scripts help streamline setup processes for various configurations and use cases. -- ## **System** - - **S01** - Enable Armbian kernel/firmware upgrades - - **S02** - Disable Armbian kernel upgrades - - **S03** - Edit the boot environment - - **S04** - Install Linux headers - - **S05** - Remove Linux headers - - **S06** - Install to internal storage - - **S07** - Manage SSH login options - - **S08** - Change shell system wide to BASH - - **S09** - Change shell system wide to ZSH - - **S10** - Switch to rolling release - - **S11** - Switch to stable release +## Features +- **System Configuration**: Automate system-level settings, including hardware configuration and performance tuning. +- **Network Management**: Manage network settings such as IP configuration, Wi-Fi, and other connectivity options. +- **Localization Settings**: Configure time zone, language, and other localization preferences. +- **Software Installation/Uninstallation**: Simplify software management, including installing or removing packages as needed. -- ## **Network** - - **N01** - Configure network interfaces - - **N13** - Install Bluetooth support - - **N14** - Remove Bluetooth support - - **N15** - Bluetooth Discover - - **N16** - Toggle system IPv6/IPv4 internet protocol - - **N17** - Announce system in the network (Avahi) - - **N18** - Disable system announce in the network (Avahi) +## Key Advantages +- **Extremely Lightweight**: Minimal dependencies for optimal performance. +- **Redesigned from Scratch**: A fresh approach to configuration. +- **Flexible Menu Structure**: Supports JSON, TUI, CLI, and API interfaces. +## Getting Started +We expect to deploy this tool in production with the upcoming release. Your help with testing and completion is invaluable! -- ## **Localisation** - - **L00** - Change Global timezone (WIP) - - **L01** - Change Locales reconfigure the language and character set - - **L02** - Change Keyboard layout - - **L03** - Change APT mirrors +### Add / Install from Development Repository +Run the following commands in your terminal: +```bash +echo “deb [signed-by=/usr/share/keyrings/armbian.gpg] https://armbian.github.io/configng stable main” | sudo tee /etc/apt/sources.list.d/armbian-development.list > /dev/null +sudo apt update +sudo apt install armbian-configng +``` -- ## **Software** - - **I00** - Update Application Repository - - **I01** - System benchmaking and diagnostics +## Contributing +Contributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/armbian/build/blob/main/CONTRIBUTING.md) for guidelines. -- ## **Help** - - **H00** - About This system. (WIP) - - **H02** - List of Config function(WIP) +## Support Us -## Install -Armbian installation -~~~ -sudo apt install armbian-config -~~~ +Join the community and be a part of Armbian userspace testing and development. -3rd party Debian based distributions -~~~ -{ - sudo wget https://apt.armbian.com/armbian.key -O key - sudo gpg --dearmor < key | sudo tee /usr/share/keyrings/armbian.gpg > /dev/null - sudo chmod go+r /usr/share/keyrings/armbian.gpg - sudo echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/armbian.gpg] http://apt.armbian.com $(lsb_release -cs) main $(lsb_release -cs)-utils $(lsb_release -cs)-desktop" | sudo tee /etc/apt/sources.list.d/armbian.list - sudo apt update - sudo apt install armbian-config -} -~~~ +- **Discord**: [invite](https://discord.com/invite/armbian) +- **Forums**: [Join us](https://forum.armbian.com/) +- **IRC**: [how to](https://docs.armbian.com/Community_IRC/) -*** - -## CLI options -Command line options. - -Use: -~~~ -armbian-config --help -~~~ - -Outputs: -~~~ -Usage: armbian-configng [option] [arguments] - - --help [catagory] - Display this help message. - Use [catagory] to filter specific menu options. - -System - System wide and admin settings - --cmd S01 - Enable Armbian kernel/firmware upgrades - --cmd S02 - Disable Armbian kernel upgrades - --cmd S03 - Edit the boot environment - --cmd S04 - Install Linux headers - --cmd S05 - Remove Linux headers - --cmd S06 - Install to internal storage - --cmd S07 - Manage SSH login options - --cmd SS01 - Disable root login - --cmd SS02 - Enable root login - --cmd SS03 - Disable password login - --cmd SS04 - Enable password login - --cmd SS05 - Disable Public key authentication login - --cmd SS06 - Enable Public key authentication login - --cmd SS07 - Disable OTP authentication - --cmd SS08 - Enable OTP authentication - --cmd SS09 - Generate new OTP authentication QR code - --cmd SS10 - Show OTP authentication QR code - --cmd S08 - Change shell system wide to BASH - --cmd S09 - Change shell system wide to ZSH - --cmd S10 - Switch to rolling release - --cmd S11 - Switch to stable release - -Network - Fixed and wireless network settings - --cmd N01 - Configure network interfaces - --cmd N02 - Wired - --cmd N06 - Show configuration - --cmd N07 - Enable DHCP on all interfaces - --cmd N08 - Set fixed IP address - --cmd N09 - Disable IPV6 - --cmd N10 - Enable IPV6 - --cmd N11 - Disable wired networking - --cmd N03 - Wireless - --cmd N25 - Show configuration - --cmd N26 - Disable wireless networking - --cmd N27 - Disable IPV6 - --cmd N28 - Enable IPV6 - --cmd N29 - Enable DHCP on wireless network interface - --cmd N04 - Show common configs - --cmd N05 - Apply common configs - --cmd N13 - Install Bluetooth support - --cmd N14 - Remove Bluetooth support - --cmd N15 - Bluetooth Discover - --cmd N16 - Toggle system IPv6/IPv4 internet protocol - --cmd N17 - Announce system in the network (Avahi) - --cmd N18 - Disable system announce in the network (Avahi) - -Localisation - Localisation - --cmd L00 - Change Global timezone (WIP) - --cmd L01 - Change Locales reconfigure the language and character set - --cmd L02 - Change Keyboard layout - --cmd L03 - Change APT mirrors - -Software - Run/Install 3rd party applications - --cmd I00 - Update Application Repository - --cmd I01 - System benchmaking and diagnostics - -Help - About this app - --cmd H00 - About This system. (WIP) - --cmd H02 - List of Config function(WIP) -~~~ - -## Legacy options -Backward Compatible options. - -Use: -~~~ -armbian-config main=Help -~~~ - -Outputs: -~~~ -Legacy Options (Backward Compatible) -Please use 'armbian-config --help' for more information. - -Usage: armbian-configng main=[arguments] selection=[options] - - armbian-configng main=System selection=Headers - Install headers: - armbian-configng main=System selection=Headers_remove - Remove headers: -~~~ - -*** - -## Development - -Development is divided into three sections: - -Click for more info: - -
-Jobs / JSON Object - -A list of the jobs defined in the Jobs file. - - ### S01 - -Enable Armbian kernel/firmware upgrades - -Jobs: - -~~~ -armbian_fw_manipulate unhold -~~~ - -### S02 - -Disable Armbian kernel upgrades - -Jobs: - -~~~ -armbian_fw_manipulate hold -~~~ - -### S03 - -Edit the boot environment - -Jobs: - -~~~ -nano /boot/armbianEnv.txt -~~~ - -### S04 - -Install Linux headers - -Jobs: - -~~~ -Headers_install -~~~ - -### S05 - -Remove Linux headers - -Jobs: - -~~~ -Headers_remove -~~~ - -### S06 - -Install to internal storage - -Jobs: - -~~~ -armbian-install -~~~ - -### S07 - -Manage SSH login options - -Jobs: - -~~~ -No commands available -~~~ - -### S08 - -Change shell system wide to BASH - -Jobs: - -~~~ -export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1) -sed -i "s|^SHELL=.*|SHELL=${BASHLOCATION}|" /etc/default/useradd -sed -i "s|^DSHELL=.*|DSHELL=${BASHLOCATION}|" /etc/adduser.conf -debconf-apt-progress -- apt-get -y purge armbian-zsh -update_skel -awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1) -~~~ - -### S09 - -Change shell system wide to ZSH - -Jobs: - -~~~ -export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1) -sed -i "s|^SHELL=.*|SHELL=${ZSHLOCATION}|" /etc/default/useradd -sed -i "s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|" /etc/adduser.conf -debconf-apt-progress -- apt-get -y install armbian-zsh -update_skel -awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1) -~~~ - -### S10 - -Switch to rolling release - -Jobs: - -~~~ -set_rolling -~~~ - -### S11 - -Switch to stable release - -Jobs: - -~~~ -set_stable -~~~ - -### N01 - -Configure network interfaces - -Jobs: - -~~~ -No commands available -~~~ - -### N13 - -Install Bluetooth support - -Jobs: - -~~~ -see_current_apt -debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools -check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman -~~~ - -### N14 - -Remove Bluetooth support - -Jobs: - -~~~ -see_current_apt -debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools -check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman -debconf-apt-progress -- apt -y -qq autoremove -~~~ - -### N15 - -Bluetooth Discover - -Jobs: - -~~~ -connect_bt_interface -~~~ - -### N16 - -Toggle system IPv6/IPv4 internet protocol - -Jobs: - -~~~ -toggle_ipv6 | show_infobox -~~~ - -### N17 - -Announce system in the network (Avahi) - -Jobs: - -~~~ -check_if_installed avahi-daemon -debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns -cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/ -cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/ -service avahi-daemon restart -~~~ - -### N18 - -Disable system announce in the network (Avahi) - -Jobs: - -~~~ -check_if_installed avahi-daemon -systemctl stop avahi-daemon avahi-daemon.socket -debconf-apt-progress -- apt-get -y purge avahi-daemon -~~~ - -### L00 - -Change Global timezone (WIP) - -Jobs: - -~~~ -dpkg-reconfigure tzdata -~~~ - -### L01 - -Change Locales reconfigure the language and character set - -Jobs: - -~~~ -dpkg-reconfigure locales -source /etc/default/locale ; sed -i "s/^LANGUAGE=.*/LANGUAGE=$LANG/" /etc/default/locale -export LANGUAGE=$LANG -~~~ - -### L02 - -Change Keyboard layout - -Jobs: - -~~~ -dpkg-reconfigure keyboard-configuration ; setupcon -update-initramfs -u -~~~ - -### L03 - -Change APT mirrors - -Jobs: - -~~~ -get_user_continue "This is only a frontend test" process_input -~~~ - -### I00 - -Update Application Repository - -Jobs: - -~~~ -debconf-apt-progress -- apt update -~~~ - -### I01 - -System benchmaking and diagnostics - -Jobs: - -~~~ -see_monitoring -~~~ - -### H00 - -About This system. (WIP) - -Jobs: - -~~~ -show_message <<< "This app is to help execute procedures to configure your system - -Some options may not work on manually modified systems" -~~~ - -### H02 - -List of Config function(WIP) - -Jobs: - -~~~ -show_message <<< see_use -~~~ - -
- - -
-Jobs API / Helper Functions - -These helper functions facilitate various operations related to job management, such as creation, updating, deletion, and listing of jobs, acting as a practical API for developers. - -| Description | Example | Credit | -|:----------- | ------- |:------:| -| Wrapping Netplan commands | netplan_wrapper | Igor Pecovnik -| Generate a Help message legacy cli commands. | see_cli_legacy | Joey Turner -| Run time variables Migrated procedures from Armbian config. | set_runtime_variables | Igor Pecovnik -| Set Armbian to rolling release | set_rolling | Tearran -| Generate this markdown table of all module_options | see_function_table_md | Joey Turner -| Display a menu from pipe | show_menu <<< armbianmonitor -h ; | Joey Turner -| Build the main menu from a object | generate_top_menu 'json_data' | Joey Turner -| Migrated procedures from Armbian config. | is_package_manager_running | Igor Pecovnik -| Migrated procedures from Armbian config. | check_desktop | Igor Pecovnik -| Generate Document files. | generate_readme | Joey Turner -| Needed by generate_menu | | Joey Turner -| Display a Yes/No dialog box and process continue/exit | get_user_continue 'Do you wish to continue?' process_input | Joey Turner -| Display a message box | show_message <<< 'hello world' | Joey Turner -| Migrated procedures from Armbian config. | connect_bt_interface | Igor Pecovnik -| Menu for armbianmonitor features | see_monitoring | Joey Turner -| Show or generate QR code for Google OTP | qr_code generate | Igor Pecovnik -| Check if kernel headers are installed | are_headers_installed | Gunjan Gupta -| Check when apt list was last updated | see_current_apt | Joey Turner -| Migrated procedures from Armbian config. | check_if_installed nano | Igor Pecovnik -| Generate 'Armbian CPU logo' SVG for document file. | generate_svg | Joey Turner -| Remove Linux headers | Headers_remove | Joey Turner -| Displays available adapters | choose_adapter | Igor Pecovnik -| Update submenu descriptions based on conditions | update_submenu_data | Joey Turner -| sanitize input cli | sanitize_input | -| Check if a domain is reachable via IPv4 and IPv6 | check_ip_version google.com | Joey Turner -| Migrated procedures from Armbian config. | set_header_remove | Igor Pecovnik -| Generate a submenu from a parent_id | generate_menu 'parent_id' | Joey Turner -| Generate a markdown list json objects using jq. | see_jq_menu_list | Joey Turner -| Generate jobs from JSON file. | generate_jobs_from_json | Joey Turner -| Install kernel headers | is_package_manager_running | Joey Turner -| Set up a WiFi hotspot on the device | hotspot_setup | Joey Turner -| Toggle IPv6 on or off | toggle_ipv6 | Joey Turner -| Generate JSON-like object file. | generate_json | Joey Turner -| Change the background color of the terminal or dialog box | set_colors 0-7 | Joey Turner -| Serve the edit and debug server. | serve_doc | Joey Turner -| Update JSON data with system information | update_json_data | Joey Turner -| pipeline strings to an infobox | show_infobox <<< 'hello world' ; | Joey Turner -| Parse json to get list of desired menu or submenu items | parse_menu_items 'menu_options_array' | Gunjan Gupta -| Show the usage of the functions. | see_use | Joey Turner -| List and connect to wireless network | wifi_connect | Igor Pecovnik -| Generate a Help message for cli commands. | see_cmd_list [catagory] | Joey Turner -| freeze/unhold/reinstall armbian related packages. | armbian_fw_manipulate unhold|freeze|reinstall | Igor Pecovnik -| Check the internet connection with fallback DNS | see_ping | Joey Turner -| Update the /etc/skel files in users directories | update_skel | Igor Pecovnik -| Set Armbian to stable release | set_stable | Tearran -| Secure version of get_user_continue | get_user_continue_secure 'Do you wish to continue?' process_input | Joey Turner - - -
- - -
-Runtime / Board Statuses - -(WIP) - -This section outlines the runtime environment to check configurations and statuses for dynamically managing jobs based on JSON data. - -(WIP) - -
- - -## Testing and contributing - -
-Get Development - -Install the dependencies: -~~~ -sudo apt install git jq whiptail -~~~ - -Get Development and contribute: -~~~ -{ - git clone https://github.com/armbian/configng - cd configng - ./armbian-configng --help -} -~~~ - -Install and test Development deb: -~~~ -{ - sudo apt install whiptail - latest_release=$(curl -s https://api.github.com/repos/armbian/configng/releases/latest) - deb_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith(".deb")) | .browser_download_url') - curl -LO "$deb_url" - deb_file=$(echo "$deb_url" | awk -F"/" '{print $NF}') - sudo dpkg -i "$deb_file" - sudo dpkg --configure -a - sudo apt --fix-broken install -} -~~~ - -
+- **Donate**: [Armbian](https://www.armbian.com/donate/) +- **Sponsor**: [Sponsor Armbian](https://github.com/sponsors/armbian) +- **Subscribe**: [Armbian Forum Subscriptions](https://forum.armbian.com/subscriptions/) From b379f804d8159be5a9a07e4783d7b91bd7038afa Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 30 Sep 2024 20:23:47 +0200 Subject: [PATCH 6/6] Enable distro upgrades procedure (#123) --- .github/workflows/unit-tests.yml | 6 ++- lib/armbian-configng/config.ng.jobs.json | 31 ++++++++++++- lib/armbian-configng/config.ng.software.sh | 2 + lib/armbian-configng/config.ng.system.sh | 51 +++++++++++++++++++++- tests/README.md | 2 +- tests/S26.conf | 2 + tests/S27.conf | 2 + 7 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 tests/S26.conf create mode 100644 tests/S27.conf diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7471260c..996e3497 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -110,14 +110,16 @@ jobs: apt -y install wget gpg # add armbian repository - URL=apt.armbian.com + URL=beta.armbian.com wget https://${URL}/armbian.key -O key gpg --dearmor < key | tee /usr/share/keyrings/armbian.gpg > /dev/null chmod go+r /usr/share/keyrings/armbian.gpg echo "deb [signed-by=/usr/share/keyrings/armbian.gpg] http://${URL} $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" | tee /etc/apt/sources.list.d/armbian.list apt update -y apt upgrade -y - apt -y install sudo procps systemd whiptail jq lsb-release iproute2 + apt -y -o Dpkg::Options::="--force-confold" install sudo procps systemd whiptail jq lsb-release iproute2 armbian-bsp-cli-wsl2-x86-current-grub + sudo -b unshare --pid --fork --mount-proc /lib/systemd/systemd --system-unit=basic.target + cat /etc/armbian-distribution-status # install packages / except howdy as its too large export DEBIAN_FRONTEND=noninteractive diff --git a/lib/armbian-configng/config.ng.jobs.json b/lib/armbian-configng/config.ng.jobs.json index c2c59a43..28a8aa4c 100644 --- a/lib/armbian-configng/config.ng.jobs.json +++ b/lib/armbian-configng/config.ng.jobs.json @@ -355,8 +355,37 @@ "src_reference": "", "author": "Igor Pecovnik", "condition": "" + }, + { + "id": "S25", + "description": "Distribution upgrades", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", + "sub": [ + { + "id": "S26", + "description": "Upgrade to latest stable / LTS", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade stable" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" + }, + { + "id": "S27", + "description": "Upgrade to rolling unstable", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade rolling" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" + } + ] } - ] + ] }, { "id": "Network", diff --git a/lib/armbian-configng/config.ng.software.sh b/lib/armbian-configng/config.ng.software.sh index 84ff09b2..162e9668 100644 --- a/lib/armbian-configng/config.ng.software.sh +++ b/lib/armbian-configng/config.ng.software.sh @@ -106,3 +106,5 @@ install_docker() { whiptail --msgbox "ERROR ! ${DISTRO} $DISTROID distribution not found in repository!" 7 70 fi } + + diff --git a/lib/armbian-configng/config.ng.system.sh b/lib/armbian-configng/config.ng.system.sh index 66be03a1..6b18a863 100644 --- a/lib/armbian-configng/config.ng.system.sh +++ b/lib/armbian-configng/config.ng.system.sh @@ -14,13 +14,62 @@ module_options+=( function apt_install_wrapper() { if [ -t 0 ]; then - debconf-apt-progress -- "$@" + DEBIAN_FRONTEND=noninteractive debconf-apt-progress -- "$@" else # Terminal not defined - proceed without TUI DEBIAN_FRONTEND=noninteractive "$@" fi } +module_options+=( + ["release_upgrade,author"]="Igor Pecovnik" + ["release_upgrade,ref_link"]="" + ["release_upgrade,feature"]="Upgrade upstream distribution release" + ["release_upgrade,desc"]="Upgrade to next stable or rolling release" + ["release_upgrade,example"]="release_upgrade stable verify" + ["release_upgrade,status"]="Active" +) +# +# Upgrade distribution +# +release_upgrade(){ + + local upgrade_type=$1 + local verify=$2 + + local distroid=${DISTROID} + + if [[ "${upgrade_type}" == stable ]]; then + local filter=$(grep "supported" /etc/armbian-distribution-status | cut -d"=" -f1) + elif [[ "${upgrade_type}" == rolling ]]; then + local filter=$(grep "eos\|csc" /etc/armbian-distribution-status | cut -d"=" -f1 | sed "s/sid/testing/g") + else + local filter=$(cat /etc/armbian-distribution-status | cut -d"=" -f1) + fi + + local upgrade=$(for j in $filter; do + for i in $(grep "^${distroid}" /etc/armbian-distribution-status | cut -d";" -f2 | cut -d"=" -f2 | sed "s/,/ /g"); do + if [[ $i == $j ]]; then + echo $i + fi + done + done | tail -1) + + if [[ -z "${upgrade}" ]]; then + return 1; + elif [[ -z "${verify}" ]]; then + [[ -f /etc/apt/sources.list.d/ubuntu.sources ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/ubuntu.sources + [[ -f /etc/apt/sources.list.d/debian.sources ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/debian.sources + [[ -f /etc/apt/sources.list ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list + [[ "${upgrade}" == "testing" ]] && upgrade="sid" # our repo and everything is tied to sid + [[ -f /etc/apt/sources.list.d/armbian.list ]] && sed -i "s/$distroid/$upgrade/g" /etc/apt/sources.list.d/armbian.list + apt_install_wrapper apt-get -y update + apt_install_wrapper apt-get -y -o Dpkg::Options::="--force-confold" upgrade --without-new-pkgs + apt_install_wrapper apt-get -y -o Dpkg::Options::="--force-confold" full-upgrade + apt_install_wrapper apt-get -y --purge autoremove + fi +} + module_options+=( ["install_de,author"]="Igor Pecovnik" ["install_de,ref_link"]="" diff --git a/tests/README.md b/tests/README.md index 8ece3c85..01217f85 100644 --- a/tests/README.md +++ b/tests/README.md @@ -4,4 +4,4 @@ - ENABLED=false|true - PREINSTALL="cmd" in order to satisfy test case - CONDITION must return 0 for test success - +- RELEASE="bookworm:jammy:noble" run on specific or leave empty to run on all diff --git a/tests/S26.conf b/tests/S26.conf new file mode 100644 index 00000000..6c6ecbea --- /dev/null +++ b/tests/S26.conf @@ -0,0 +1,2 @@ +ENABLED=true +RELEASE="jammy:bullseye" diff --git a/tests/S27.conf b/tests/S27.conf new file mode 100644 index 00000000..f1b50ac9 --- /dev/null +++ b/tests/S27.conf @@ -0,0 +1,2 @@ +ENABLED=true +RELEASE="bullseye:bookworm:trixie:jammy:noble"