summaryrefslogtreecommitdiff
path: root/archiso/initcpio/install
diff options
context:
space:
mode:
authorDavid Runge <dvzrv@archlinux.org>2020-07-11 18:13:20 +0200
committerDavid Runge <dvzrv@archlinux.org>2020-07-11 20:58:01 +0200
commite2032db4e74c66d3f8bcba97497ccb5fff88df4b (patch)
tree6b1fa957e952916ed34ff101cd277c11c3a9437b /archiso/initcpio/install
parent550aca712432c6708fc48db5e9a8aaba9ef1e0c1 (diff)
downloadarchiso32-e2032db4e74c66d3f8bcba97497ccb5fff88df4b.tar.xz
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
Diffstat (limited to 'archiso/initcpio/install')
-rw-r--r--archiso/initcpio/install/archiso8
-rw-r--r--archiso/initcpio/install/archiso_kms2
-rw-r--r--archiso/initcpio/install/archiso_loop_mnt4
-rw-r--r--archiso/initcpio/install/archiso_pxe_common14
-rw-r--r--archiso/initcpio/install/archiso_pxe_http6
-rw-r--r--archiso/initcpio/install/archiso_pxe_nbd4
-rw-r--r--archiso/initcpio/install/archiso_pxe_nfs4
-rw-r--r--archiso/initcpio/install/archiso_shutdown8
8 files changed, 18 insertions, 32 deletions
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<<HELPEOF
This hook loads the necessary modules for boot via loop device.
HELPEOF
}
-
-# vim: set ft=sh ts=4 sw=4 et:
diff --git a/archiso/initcpio/install/archiso_pxe_common b/archiso/initcpio/install/archiso_pxe_common
index eec9a7e..da5f6b6 100644
--- a/archiso/initcpio/install/archiso_pxe_common
+++ b/archiso/initcpio/install/archiso_pxe_common
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
build() {
add_checked_modules -f "(irda|phy|wimax|wireless|ppp_|plip|pppoe)" "/drivers/net/"
@@ -8,13 +8,13 @@ build() {
add_binary /usr/lib/initcpio/ipconfig /bin/ipconfig
# Add hosts support files+dns
- add_symlink /usr/lib/libnss_files.so.2 $(readlink /usr/lib/libnss_files.so.2)
- add_binary $(readlink -f /usr/lib/libnss_files.so.2)
- add_symlink /usr/lib/libnss_dns.so.2 $(readlink /usr/lib/libnss_dns.so.2)
- add_binary $(readlink -f /usr/lib/libnss_dns.so.2)
+ add_symlink /usr/lib/libnss_files.so.2 "$(readlink /usr/lib/libnss_files.so.2)"
+ add_binary "$(readlink -f /usr/lib/libnss_files.so.2)"
+ add_symlink /usr/lib/libnss_dns.so.2 "$(readlink /usr/lib/libnss_dns.so.2)"
+ add_binary "$(readlink -f /usr/lib/libnss_dns.so.2)"
add_dir /etc
- echo "hosts: files dns" > $BUILDROOT/etc/nsswitch.conf
+ echo "hosts: files dns" > "$BUILDROOT/etc/nsswitch.conf"
}
help() {
@@ -22,5 +22,3 @@ cat<<HELPEOF
This hook loads the necessary modules for boot via PXE.
HELPEOF
}
-
-# vim: set ft=sh ts=4 sw=4 et:
diff --git a/archiso/initcpio/install/archiso_pxe_http b/archiso/initcpio/install/archiso_pxe_http
index 9ce9726..3353eb7 100644
--- a/archiso/initcpio/install/archiso_pxe_http
+++ b/archiso/initcpio/install/archiso_pxe_http
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/usr/bin/env bash
build() {
add_runscript
add_binary curl
- add_file $(readlink -f /etc/ssl/certs/ca-certificates.crt) /etc/ssl/certs/ca-certificates.crt
+ add_file "$(readlink -f /etc/ssl/certs/ca-certificates.crt)" /etc/ssl/certs/ca-certificates.crt
}
help() {
@@ -13,5 +13,3 @@ cat<<HELPEOF
This hook loads the necessary modules for boot via PXE and HTTP.
HELPEOF
}
-
-# vim: set ft=sh ts=4 sw=4 et:
diff --git a/archiso/initcpio/install/archiso_pxe_nbd b/archiso/initcpio/install/archiso_pxe_nbd
index 47d98ce..9fe3fdd 100644
--- a/archiso/initcpio/install/archiso_pxe_nbd
+++ b/archiso/initcpio/install/archiso_pxe_nbd
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
build() {
add_module "nbd"
@@ -13,5 +13,3 @@ cat<<HELPEOF
This hook loads the necessary modules for boot via PXE and NBD.
HELPEOF
}
-
-# vim: set ft=sh ts=4 sw=4 et:
diff --git a/archiso/initcpio/install/archiso_pxe_nfs b/archiso/initcpio/install/archiso_pxe_nfs
index f8226e5..fa4e548 100644
--- a/archiso/initcpio/install/archiso_pxe_nfs
+++ b/archiso/initcpio/install/archiso_pxe_nfs
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
build() {
add_module "nfs"
@@ -13,5 +13,3 @@ help() {
This hook loads the necessary modules for boot via PXE and NFS.
HELPEOF
}
-
-# vim: set ft=sh ts=4 sw=4 et:
diff --git a/archiso/initcpio/install/archiso_shutdown b/archiso/initcpio/install/archiso_shutdown
index 5ae976a..1051d1b 100644
--- a/archiso/initcpio/install/archiso_shutdown
+++ b/archiso/initcpio/install/archiso_shutdown
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
build() {
add_binary cp
@@ -12,9 +12,7 @@ help() {
cat <<HELPEOF
This hook will create a shutdown initramfs in /run/initramfs
that we can pivot to on shutdown in order to unmount / and
-and others mount points, dm-snapshot devices and loopback devices.
-Mostly usefull for dm-snapshot persistent.
+and other mount points, dm-snapshot and loopback devices.
+Mostly useful for persistent dm-snapshot.
HELPEOF
}
-
-# vim: set ft=sh ts=4 sw=4 et: