From e2032db4e74c66d3f8bcba97497ccb5fff88df4b Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 11 Jul 2020 18:13:20 +0200 Subject: Adding linting for initcpio scripts archiso/initcpio/install/*: Setting bash shebang for all scripts and making them comform with shellcheck. archiso/initcpio/{hooks,script}/*: Setting ash shebang for all scripts and making them comform with shellcheck (for dash, as shellcheck has no ash specific ruleset). Essentially the ash based scripts should be POSIX compliant as much as possible to have an easier time writing, debugging and maintaining them. Ensuring that variables are not treated as options and introducing variable quoting. .gitlab-ci.yml: Integrating shellcheck for initcpio scripts. Closes #32 --- archiso/initcpio/install/archiso | 8 +++----- archiso/initcpio/install/archiso_kms | 2 +- archiso/initcpio/install/archiso_loop_mnt | 4 +--- archiso/initcpio/install/archiso_pxe_common | 14 ++++++-------- archiso/initcpio/install/archiso_pxe_http | 6 ++---- archiso/initcpio/install/archiso_pxe_nbd | 4 +--- archiso/initcpio/install/archiso_pxe_nfs | 4 +--- archiso/initcpio/install/archiso_shutdown | 8 +++----- 8 files changed, 18 insertions(+), 32 deletions(-) (limited to 'archiso/initcpio/install') diff --git a/archiso/initcpio/install/archiso b/archiso/initcpio/install/archiso index 30728ef..a12104e 100644 --- a/archiso/initcpio/install/archiso +++ b/archiso/initcpio/install/archiso @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash build() { add_module "cdrom" @@ -22,9 +22,7 @@ build() { add_file /usr/lib/udev/rules.d/95-dm-notify.rules add_file /usr/lib/initcpio/udev/11-dm-initramfs.rules /usr/lib/udev/rules.d/11-dm-initramfs.rules if [[ $ARCHISO_GNUPG_FD ]]; then - mkdir -p "$BUILDROOT$dest"/gpg - gpg --homedir "$BUILDROOT$dest"/gpg --import <&$ARCHISO_GNUPG_FD + mkdir -p "$BUILDROOT/gpg" + gpg --homedir "$BUILDROOT/gpg" --import <& "$ARCHISO_GNUPG_FD" fi } - -# vim: set ft=sh ts=4 sw=4 et: diff --git a/archiso/initcpio/install/archiso_kms b/archiso/initcpio/install/archiso_kms index bfb2d48..48832ff 100644 --- a/archiso/initcpio/install/archiso_kms +++ b/archiso/initcpio/install/archiso_kms @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash build() { add_module "amdgpu" diff --git a/archiso/initcpio/install/archiso_loop_mnt b/archiso/initcpio/install/archiso_loop_mnt index 59f1d94..4a5824d 100644 --- a/archiso/initcpio/install/archiso_loop_mnt +++ b/archiso/initcpio/install/archiso_loop_mnt @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash build() { add_runscript @@ -9,5 +9,3 @@ cat< $BUILDROOT/etc/nsswitch.conf + echo "hosts: files dns" > "$BUILDROOT/etc/nsswitch.conf" } help() { @@ -22,5 +22,3 @@ cat<