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:
Ash
2022-11-27 21:44:50 +01:00
committed by GitHub
parent e5f234c324
commit 408bc67619
58 changed files with 58 additions and 1 deletions

View File

@@ -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)

View File

@@ -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.

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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.

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
} }

View File

@@ -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"
} }

View File

@@ -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?

View File

@@ -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"

View File

@@ -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

View File

@@ -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() {

View File

@@ -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

View File

@@ -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() {

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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.

View File

@@ -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:

View File

@@ -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

View File

@@ -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:]]+')

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Expected variables # Expected variables
# - aggregated_content # - aggregated_content
# - potential_paths # - potential_paths

View File

@@ -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}"

View File

@@ -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

View File

@@ -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

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# create_chroot <target_dir> <release> <arch> # create_chroot <target_dir> <release> <arch>
# #
create_chroot() { create_chroot() {

View File

@@ -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.

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# mount_chroot <target> # mount_chroot <target>
# #
# helper to reduce code duplication # helper to reduce code duplication

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# prepare_host_basic # prepare_host_basic
# #
# * installs only basic packages # * installs only basic packages

View File

@@ -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

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# prepare_host # prepare_host
# #
# * checks and installs necessary packages # * checks and installs necessary packages

View File

@@ -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

View File

@@ -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

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# check_loop_device <device_node> # check_loop_device <device_node>
# #
check_loop_device() { check_loop_device() {

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# prepare_partitions # prepare_partitions
# #
# creates image file, partitions and fs # creates image file, partitions and fs

View File

@@ -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

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------------------------
# Let's have unique way of displaying alerts # Let's have unique way of displaying alerts
#-------------------------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------------------------

View File

@@ -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.

View File

@@ -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

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
############################################################################### ###############################################################################
# #
# build_task_is_enabled() # build_task_is_enabled()

View File

@@ -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() {

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# unmount_on_exit # unmount_on_exit
# #
unmount_on_exit() { unmount_on_exit() {

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
install_deb_chroot() { install_deb_chroot() {
local package=$1 local package=$1

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env bash
install_common() { install_common() {
display_alert "Applying common tweaks" "" "info" display_alert "Applying common tweaks" "" "info"

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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