Skip to content

Commit

Permalink
Add shebangs for shellcheck (armbian#4493)
Browse files Browse the repository at this point in the history
* Add shebangs for shellcheck

See #AR-1406

* Add shebangs for shellcheck

Also for `extensions` scripts
  • Loading branch information
ashthespy authored Nov 27, 2022
1 parent e5f234c commit 408bc67
Show file tree
Hide file tree
Showing 58 changed files with 58 additions and 1 deletion.
1 change: 1 addition & 0 deletions extensions/detect-unused-extensions.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
## Configuration
export LOG_ALL_HOOK_TRACES=no # Should we log all hook function traces to stdout? (no, or level: wrn info)

Expand Down
1 change: 1 addition & 0 deletions extensions/flash-kernel.sh
Original file line number Diff line number Diff line change
@@ -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.
function extension_prepare_config__prepare_flash_kernel() {
# Configuration defaults, or lack thereof.
Expand Down
1 change: 1 addition & 0 deletions extensions/gen-sample-extension-docs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
## Hooks
function extension_metadata_ready__499_display_docs_generation_start_info() {
display_alert "Generating hook documentation and sample extension"
Expand Down
1 change: 1 addition & 0 deletions extensions/grub-riscv64.sh
Original file line number Diff line number Diff line change
@@ -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.
function extension_prepare_config__prepare_grub-riscv64() {
display_alert "Prepare config" "${EXTENSION}" "info"
Expand Down
1 change: 1 addition & 0 deletions extensions/grub-sbc-media.sh
Original file line number Diff line number Diff line change
@@ -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.
function extension_prepare_config__prepare_grub-sbc-media() {
display_alert "Prepare config" "${EXTENSION}" "info"
Expand Down
1 change: 1 addition & 0 deletions extensions/grub.sh
Original file line number Diff line number Diff line change
@@ -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.
function extension_prepare_config__prepare_flash_kernel() {
# Extension configuration defaults.
Expand Down
1 change: 1 addition & 0 deletions extensions/marvell-tools.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
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/mv-ddr-marvell.git" "marvell-ddr" "branch:master"
Expand Down
1 change: 1 addition & 0 deletions extensions/nvidia.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
function pre_install_kernel_debs__build_nvidia_kernel_module() {

export INSTALL_HEADERS="yes"
Expand Down
1 change: 1 addition & 0 deletions extensions/rkbin-tools.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
function fetch_sources_tools__rkbin_tools() {
fetch_from_repo "https://github.com/armbian/rkbin" "rkbin-tools" "branch:master"
}
Expand Down
1 change: 1 addition & 0 deletions extensions/sunxi-tools.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
function fetch_sources_tools__sunxi_tools() {
fetch_from_repo "https://github.com/linux-sunxi/sunxi-tools" "sunxi-tools" "branch:master"
}
Expand Down
1 change: 1 addition & 0 deletions lib/extensions.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# 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 -i initialize_extension_manager_counter=0 # how many times has the extension manager initialized?
Expand Down
1 change: 1 addition & 0 deletions lib/functions/bsp/bsp-cli.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
create_board_package() {
display_alert "Creating board support package for CLI" "$CHOSEN_ROOTFS" "info"

Expand Down
1 change: 1 addition & 0 deletions lib/functions/bsp/bsp-desktop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
create_desktop_package() {

echo "Showing PACKAGE_LIST_DESKTOP before postprocessing" >> "${DEST}"/${LOG_SUBPATH}/output.log
Expand Down
1 change: 1 addition & 0 deletions lib/functions/bsp/utils-bsp.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# copy_all_packages_files_for <folder> to package
#
copy_all_packages_files_for() {
Expand Down
1 change: 1 addition & 0 deletions lib/functions/cli/cli-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
function cli_entrypoint() {
if [[ "${ARMBIAN_ENABLE_CALL_TRACING}" == "yes" ]]; then
set -T # inherit return/debug traps
Expand Down
1 change: 1 addition & 0 deletions lib/functions/cli/utils-cli.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Add the variables needed at the beginning of the path
check_args() {

Expand Down
1 change: 1 addition & 0 deletions lib/functions/compilation/atf.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
compile_atf() {
if [[ $CLEAN_LEVEL == *make* ]]; then
display_alert "Cleaning" "$ATFSOURCEDIR" "info"
Expand Down
1 change: 1 addition & 0 deletions lib/functions/compilation/debs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
compile_firmware() {
display_alert "Merging and packaging linux firmware" "@host" "info"

Expand Down
1 change: 1 addition & 0 deletions lib/functions/compilation/kernel-debs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
create_linux-source_package() {
ts=$(date +%s)
local sources_pkg_dir tmp_src_dir
Expand Down
1 change: 1 addition & 0 deletions lib/functions/compilation/kernel.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
compile_kernel() {
if [[ $CLEAN_LEVEL == *make* ]]; then
display_alert "Cleaning" "$LINUXSOURCEDIR" "info"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
compilation_prepare() {

# Packaging patch for modern kernels should be one for all.
Expand Down
1 change: 1 addition & 0 deletions lib/functions/compilation/patch/patching.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# advanced_patch <dest> <family> <board> <target> <branch> <description>
#
# parameters:
Expand Down
1 change: 1 addition & 0 deletions lib/functions/compilation/uboot.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
compile_uboot() {
# not optimal, but extra cleaning before overlayfs_wrapper should keep sources directory clean
if [[ $CLEAN_LEVEL == *make* ]]; then
Expand Down
1 change: 1 addition & 0 deletions lib/functions/compilation/utils-compilation.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
grab_version() {
local ver=()
ver[0]=$(grep "^VERSION" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+')
Expand Down
1 change: 1 addition & 0 deletions lib/functions/configuration/aggregation.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Expected variables
# - aggregated_content
# - potential_paths
Expand Down
1 change: 1 addition & 0 deletions lib/functions/configuration/config-desktop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
desktop_element_available_for_arch() {
local desktop_element_path="${1}"
local targeted_arch="${2}"
Expand Down
1 change: 1 addition & 0 deletions lib/functions/configuration/interactive.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
function interactive_config_prepare_terminal() {
if [[ -z $ROOT_FS_CREATE_ONLY ]]; then
# override stty size
Expand Down
1 change: 1 addition & 0 deletions lib/functions/configuration/menu.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Myy : Menu configuration for choosing desktop configurations
show_menu() {
provided_title=$1
Expand Down
1 change: 1 addition & 0 deletions lib/functions/extras/buildpkg.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# create_chroot <target_dir> <release> <arch>
#
create_chroot() {
Expand Down
1 change: 1 addition & 0 deletions lib/functions/extras/installpkg.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# Installing debian packages or package files in the armbian build system.
# The function accepts four optional parameters:
# autoupdate - If the installation list is not empty then update first.
Expand Down
1 change: 1 addition & 0 deletions lib/functions/general/chroot-helpers.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# mount_chroot <target>
#
# helper to reduce code duplication
Expand Down
1 change: 1 addition & 0 deletions lib/functions/general/downloads.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
function get_urls() {
local catalog=$1
local filename=$2
Expand Down
1 change: 1 addition & 0 deletions lib/functions/general/git.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
#
# 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.
Expand Down
1 change: 1 addition & 0 deletions lib/functions/general/repo.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
adding_packages() {
# add deb files to repository if they are not already there

Expand Down
1 change: 1 addition & 0 deletions lib/functions/host/basic-deps.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# prepare_host_basic
#
# * installs only basic packages
Expand Down
1 change: 1 addition & 0 deletions lib/functions/host/host-utils.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# wait_for_package_manager
#
# * installation will break if we try to install when package manager is running
Expand Down
1 change: 1 addition & 0 deletions lib/functions/host/prepare-host.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# prepare_host
#
# * checks and installs necessary packages
Expand Down
1 change: 1 addition & 0 deletions lib/functions/image/fingerprint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
#--------------------------------------------------------------------------------------------------------------------------------
# fingerprint_image <out_txt_file> [image_filename]
# Saving build summary to the image
Expand Down
1 change: 1 addition & 0 deletions lib/functions/image/initrd.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# update_initramfs
#
# this should be invoked as late as possible for any modifications by
Expand Down
1 change: 1 addition & 0 deletions lib/functions/image/loop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# check_loop_device <device_node>
#
check_loop_device() {
Expand Down
1 change: 1 addition & 0 deletions lib/functions/image/partitioning.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# prepare_partitions
#
# creates image file, partitions and fs
Expand Down
1 change: 1 addition & 0 deletions lib/functions/image/rootfs-to-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# create_image
#
# finishes creation of image from cached rootfs
Expand Down
1 change: 1 addition & 0 deletions lib/functions/logging/logging.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
#--------------------------------------------------------------------------------------------------------------------------------
# Let's have unique way of displaying alerts
#--------------------------------------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions lib/functions/logging/runners.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
run_on_sdcard() {

# Lack of quotes allows for redirections and pipes easily.
Expand Down
1 change: 1 addition & 0 deletions lib/functions/logging/traps.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# exit_with_error <message> <highlight>
#
# a way to terminate build process
Expand Down
1 change: 1 addition & 0 deletions lib/functions/main/build-tasks.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
###############################################################################
#
# build_task_is_enabled()
Expand Down
1 change: 1 addition & 0 deletions lib/functions/main/config-prepare.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
DISTRIBUTIONS_DESC_DIR="config/distributions"

function prepare_and_config_main_build_single() {
Expand Down
1 change: 1 addition & 0 deletions lib/functions/main/rootfs-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# unmount_on_exit
#
unmount_on_exit() {
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/apt-install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
install_deb_chroot() {

local package=$1
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/apt-sources.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
install_ppa_prerequisites() {

# Myy : So... The whole idea is that, a good bunch of external sources
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/boot_logo.sh
Original file line number Diff line number Diff line change
@@ -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)
# and place to the file /lib/firmware/bootsplash
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/create-cache.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# get_package_list_hash
#
# returns md5 hash for current package list and rootfs cache version
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/customize.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
customize_image() {

# for users that need to prepare files at host
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/distro-agnostic.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
install_common() {
display_alert "Applying common tweaks" "" "info"

Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/distro-specific.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
install_distribution_specific() {

display_alert "Applying distribution specific tweaks for" "$RELEASE" "info"
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/post-tweaks.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
post_debootstrap_tweaks() {

# remove service start blockers and QEMU binary
Expand Down
1 change: 1 addition & 0 deletions lib/functions/rootfs/rootfs-desktop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
desktop_postinstall() {

# disable display manager for the first run
Expand Down
2 changes: 1 addition & 1 deletion lib/import-functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

while read -r file; do
# shellcheck source=/dev/null
Expand Down

0 comments on commit 408bc67

Please sign in to comment.