mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Add shebangs for shellcheck (#4493)
* Add shebangs for shellcheck See #AR-1406 * Add shebangs for shellcheck Also for `extensions` scripts
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
## Configuration
|
## Configuration
|
||||||
export LOG_ALL_HOOK_TRACES=no # Should we log all hook function traces to stdout? (no, or level: wrn info)
|
export LOG_ALL_HOOK_TRACES=no # Should we log all hook function traces to stdout? (no, or level: wrn info)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
||||||
function extension_prepare_config__prepare_flash_kernel() {
|
function extension_prepare_config__prepare_flash_kernel() {
|
||||||
# Configuration defaults, or lack thereof.
|
# Configuration defaults, or lack thereof.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
## Hooks
|
## Hooks
|
||||||
function extension_metadata_ready__499_display_docs_generation_start_info() {
|
function extension_metadata_ready__499_display_docs_generation_start_info() {
|
||||||
display_alert "Generating hook documentation and sample extension"
|
display_alert "Generating hook documentation and sample extension"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
||||||
function extension_prepare_config__prepare_grub-riscv64() {
|
function extension_prepare_config__prepare_grub-riscv64() {
|
||||||
display_alert "Prepare config" "${EXTENSION}" "info"
|
display_alert "Prepare config" "${EXTENSION}" "info"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
||||||
function extension_prepare_config__prepare_grub-sbc-media() {
|
function extension_prepare_config__prepare_grub-sbc-media() {
|
||||||
display_alert "Prepare config" "${EXTENSION}" "info"
|
display_alert "Prepare config" "${EXTENSION}" "info"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
# This runs *after* user_config. Don't change anything not coming from other variables or meant to be configured by the user.
|
||||||
function extension_prepare_config__prepare_flash_kernel() {
|
function extension_prepare_config__prepare_flash_kernel() {
|
||||||
# Extension configuration defaults.
|
# Extension configuration defaults.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
function fetch_sources_tools__marvell_tools() {
|
function fetch_sources_tools__marvell_tools() {
|
||||||
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell" "marvell-tools" "branch:master"
|
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell" "marvell-tools" "branch:master"
|
||||||
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git" "marvell-ddr" "branch:master"
|
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git" "marvell-ddr" "branch:master"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
function pre_install_kernel_debs__build_nvidia_kernel_module() {
|
function pre_install_kernel_debs__build_nvidia_kernel_module() {
|
||||||
|
|
||||||
export INSTALL_HEADERS="yes"
|
export INSTALL_HEADERS="yes"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
function fetch_sources_tools__rkbin_tools() {
|
function fetch_sources_tools__rkbin_tools() {
|
||||||
fetch_from_repo "https://github.com/armbian/rkbin" "rkbin-tools" "branch:master"
|
fetch_from_repo "https://github.com/armbian/rkbin" "rkbin-tools" "branch:master"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
function fetch_sources_tools__sunxi_tools() {
|
function fetch_sources_tools__sunxi_tools() {
|
||||||
fetch_from_repo "https://github.com/linux-sunxi/sunxi-tools" "sunxi-tools" "branch:master"
|
fetch_from_repo "https://github.com/linux-sunxi/sunxi-tools" "sunxi-tools" "branch:master"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# global variables managing the state of the extension manager. treat as private.
|
# global variables managing the state of the extension manager. treat as private.
|
||||||
declare -A extension_function_info # maps a function name to a string with KEY=VALUEs information about the defining extension
|
declare -A extension_function_info # maps a function name to a string with KEY=VALUEs information about the defining extension
|
||||||
declare -i initialize_extension_manager_counter=0 # how many times has the extension manager initialized?
|
declare -i initialize_extension_manager_counter=0 # how many times has the extension manager initialized?
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
create_board_package() {
|
create_board_package() {
|
||||||
display_alert "Creating board support package for CLI" "$CHOSEN_ROOTFS" "info"
|
display_alert "Creating board support package for CLI" "$CHOSEN_ROOTFS" "info"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
create_desktop_package() {
|
create_desktop_package() {
|
||||||
|
|
||||||
echo "Showing PACKAGE_LIST_DESKTOP before postprocessing" >> "${DEST}"/${LOG_SUBPATH}/output.log
|
echo "Showing PACKAGE_LIST_DESKTOP before postprocessing" >> "${DEST}"/${LOG_SUBPATH}/output.log
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# copy_all_packages_files_for <folder> to package
|
# copy_all_packages_files_for <folder> to package
|
||||||
#
|
#
|
||||||
copy_all_packages_files_for() {
|
copy_all_packages_files_for() {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
function cli_entrypoint() {
|
function cli_entrypoint() {
|
||||||
if [[ "${ARMBIAN_ENABLE_CALL_TRACING}" == "yes" ]]; then
|
if [[ "${ARMBIAN_ENABLE_CALL_TRACING}" == "yes" ]]; then
|
||||||
set -T # inherit return/debug traps
|
set -T # inherit return/debug traps
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# Add the variables needed at the beginning of the path
|
# Add the variables needed at the beginning of the path
|
||||||
check_args() {
|
check_args() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
compile_atf() {
|
compile_atf() {
|
||||||
if [[ $CLEAN_LEVEL == *make* ]]; then
|
if [[ $CLEAN_LEVEL == *make* ]]; then
|
||||||
display_alert "Cleaning" "$ATFSOURCEDIR" "info"
|
display_alert "Cleaning" "$ATFSOURCEDIR" "info"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
compile_firmware() {
|
compile_firmware() {
|
||||||
display_alert "Merging and packaging linux firmware" "@host" "info"
|
display_alert "Merging and packaging linux firmware" "@host" "info"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
create_linux-source_package() {
|
create_linux-source_package() {
|
||||||
ts=$(date +%s)
|
ts=$(date +%s)
|
||||||
local sources_pkg_dir tmp_src_dir
|
local sources_pkg_dir tmp_src_dir
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
compile_kernel() {
|
compile_kernel() {
|
||||||
if [[ $CLEAN_LEVEL == *make* ]]; then
|
if [[ $CLEAN_LEVEL == *make* ]]; then
|
||||||
display_alert "Cleaning" "$LINUXSOURCEDIR" "info"
|
display_alert "Cleaning" "$LINUXSOURCEDIR" "info"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
compilation_prepare() {
|
compilation_prepare() {
|
||||||
|
|
||||||
# Packaging patch for modern kernels should be one for all.
|
# Packaging patch for modern kernels should be one for all.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# advanced_patch <dest> <family> <board> <target> <branch> <description>
|
# advanced_patch <dest> <family> <board> <target> <branch> <description>
|
||||||
#
|
#
|
||||||
# parameters:
|
# parameters:
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
compile_uboot() {
|
compile_uboot() {
|
||||||
# not optimal, but extra cleaning before overlayfs_wrapper should keep sources directory clean
|
# not optimal, but extra cleaning before overlayfs_wrapper should keep sources directory clean
|
||||||
if [[ $CLEAN_LEVEL == *make* ]]; then
|
if [[ $CLEAN_LEVEL == *make* ]]; then
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
grab_version() {
|
grab_version() {
|
||||||
local ver=()
|
local ver=()
|
||||||
ver[0]=$(grep "^VERSION" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+')
|
ver[0]=$(grep "^VERSION" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+')
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# Expected variables
|
# Expected variables
|
||||||
# - aggregated_content
|
# - aggregated_content
|
||||||
# - potential_paths
|
# - potential_paths
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
desktop_element_available_for_arch() {
|
desktop_element_available_for_arch() {
|
||||||
local desktop_element_path="${1}"
|
local desktop_element_path="${1}"
|
||||||
local targeted_arch="${2}"
|
local targeted_arch="${2}"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
function interactive_config_prepare_terminal() {
|
function interactive_config_prepare_terminal() {
|
||||||
if [[ -z $ROOT_FS_CREATE_ONLY ]]; then
|
if [[ -z $ROOT_FS_CREATE_ONLY ]]; then
|
||||||
# override stty size
|
# override stty size
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# Myy : Menu configuration for choosing desktop configurations
|
# Myy : Menu configuration for choosing desktop configurations
|
||||||
show_menu() {
|
show_menu() {
|
||||||
provided_title=$1
|
provided_title=$1
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# create_chroot <target_dir> <release> <arch>
|
# create_chroot <target_dir> <release> <arch>
|
||||||
#
|
#
|
||||||
create_chroot() {
|
create_chroot() {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# Installing debian packages or package files in the armbian build system.
|
# Installing debian packages or package files in the armbian build system.
|
||||||
# The function accepts four optional parameters:
|
# The function accepts four optional parameters:
|
||||||
# autoupdate - If the installation list is not empty then update first.
|
# autoupdate - If the installation list is not empty then update first.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# mount_chroot <target>
|
# mount_chroot <target>
|
||||||
#
|
#
|
||||||
# helper to reduce code duplication
|
# helper to reduce code duplication
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
function get_urls() {
|
function get_urls() {
|
||||||
local catalog=$1
|
local catalog=$1
|
||||||
local filename=$2
|
local filename=$2
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# This function retries Git operations to avoid failure in case remote is borked
|
# This function retries Git operations to avoid failure in case remote is borked
|
||||||
# If the git team needs to call a remote server, use this function.
|
# If the git team needs to call a remote server, use this function.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
adding_packages() {
|
adding_packages() {
|
||||||
# add deb files to repository if they are not already there
|
# add deb files to repository if they are not already there
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# prepare_host_basic
|
# prepare_host_basic
|
||||||
#
|
#
|
||||||
# * installs only basic packages
|
# * installs only basic packages
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# wait_for_package_manager
|
# wait_for_package_manager
|
||||||
#
|
#
|
||||||
# * installation will break if we try to install when package manager is running
|
# * installation will break if we try to install when package manager is running
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# prepare_host
|
# prepare_host
|
||||||
#
|
#
|
||||||
# * checks and installs necessary packages
|
# * checks and installs necessary packages
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
#--------------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------------
|
||||||
# fingerprint_image <out_txt_file> [image_filename]
|
# fingerprint_image <out_txt_file> [image_filename]
|
||||||
# Saving build summary to the image
|
# Saving build summary to the image
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# update_initramfs
|
# update_initramfs
|
||||||
#
|
#
|
||||||
# this should be invoked as late as possible for any modifications by
|
# this should be invoked as late as possible for any modifications by
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# check_loop_device <device_node>
|
# check_loop_device <device_node>
|
||||||
#
|
#
|
||||||
check_loop_device() {
|
check_loop_device() {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# prepare_partitions
|
# prepare_partitions
|
||||||
#
|
#
|
||||||
# creates image file, partitions and fs
|
# creates image file, partitions and fs
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# create_image
|
# create_image
|
||||||
#
|
#
|
||||||
# finishes creation of image from cached rootfs
|
# finishes creation of image from cached rootfs
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
#--------------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------------
|
||||||
# Let's have unique way of displaying alerts
|
# Let's have unique way of displaying alerts
|
||||||
#--------------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
run_on_sdcard() {
|
run_on_sdcard() {
|
||||||
|
|
||||||
# Lack of quotes allows for redirections and pipes easily.
|
# Lack of quotes allows for redirections and pipes easily.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# exit_with_error <message> <highlight>
|
# exit_with_error <message> <highlight>
|
||||||
#
|
#
|
||||||
# a way to terminate build process
|
# a way to terminate build process
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# build_task_is_enabled()
|
# build_task_is_enabled()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
DISTRIBUTIONS_DESC_DIR="config/distributions"
|
DISTRIBUTIONS_DESC_DIR="config/distributions"
|
||||||
|
|
||||||
function prepare_and_config_main_build_single() {
|
function prepare_and_config_main_build_single() {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# unmount_on_exit
|
# unmount_on_exit
|
||||||
#
|
#
|
||||||
unmount_on_exit() {
|
unmount_on_exit() {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
install_deb_chroot() {
|
install_deb_chroot() {
|
||||||
|
|
||||||
local package=$1
|
local package=$1
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
install_ppa_prerequisites() {
|
install_ppa_prerequisites() {
|
||||||
|
|
||||||
# Myy : So... The whole idea is that, a good bunch of external sources
|
# Myy : So... The whole idea is that, a good bunch of external sources
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
#--------------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------------
|
||||||
# Create kernel boot logo from packages/blobs/splash/logo.png and packages/blobs/splash/spinner.gif (animated)
|
# Create kernel boot logo from packages/blobs/splash/logo.png and packages/blobs/splash/spinner.gif (animated)
|
||||||
# and place to the file /lib/firmware/bootsplash
|
# and place to the file /lib/firmware/bootsplash
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
# get_package_list_hash
|
# get_package_list_hash
|
||||||
#
|
#
|
||||||
# returns md5 hash for current package list and rootfs cache version
|
# returns md5 hash for current package list and rootfs cache version
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
customize_image() {
|
customize_image() {
|
||||||
|
|
||||||
# for users that need to prepare files at host
|
# for users that need to prepare files at host
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
install_common() {
|
install_common() {
|
||||||
display_alert "Applying common tweaks" "" "info"
|
display_alert "Applying common tweaks" "" "info"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
install_distribution_specific() {
|
install_distribution_specific() {
|
||||||
|
|
||||||
display_alert "Applying distribution specific tweaks for" "$RELEASE" "info"
|
display_alert "Applying distribution specific tweaks for" "$RELEASE" "info"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
post_debootstrap_tweaks() {
|
post_debootstrap_tweaks() {
|
||||||
|
|
||||||
# remove service start blockers and QEMU binary
|
# remove service start blockers and QEMU binary
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
desktop_postinstall() {
|
desktop_postinstall() {
|
||||||
|
|
||||||
# disable display manager for the first run
|
# disable display manager for the first run
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
while read -r file; do
|
while read -r file; do
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user