add some fixes for shellcheck. fix if else
This commit is contained in:
parent
2e1b75d3c6
commit
ef1165de3c
@ -2,6 +2,8 @@
|
|||||||
#
|
#
|
||||||
# tiny initramfs
|
# tiny initramfs
|
||||||
#
|
#
|
||||||
|
# false positive
|
||||||
|
# shellcheck disable=2154
|
||||||
|
|
||||||
print()
|
print()
|
||||||
{
|
{
|
||||||
@ -82,6 +84,8 @@ prepare_environment()
|
|||||||
|
|
||||||
print "preparing environment"
|
print "preparing environment"
|
||||||
|
|
||||||
|
# false positive
|
||||||
|
# shellcheck disable=1090
|
||||||
. "${config:-/etc/tinyramfs/config}"
|
. "${config:-/etc/tinyramfs/config}"
|
||||||
|
|
||||||
: "${kernel:=$(uname -r)}"
|
: "${kernel:=$(uname -r)}"
|
||||||
@ -92,7 +96,7 @@ prepare_environment()
|
|||||||
mkdir -p "${tmpdir:=${TMPDIR:-/tmp}/tinyramfs.$$}"
|
mkdir -p "${tmpdir:=${TMPDIR:-/tmp}/tinyramfs.$$}"
|
||||||
|
|
||||||
# false positive
|
# false positive
|
||||||
# shellcheck disable=2015
|
# shellcheck disable=2015,2064
|
||||||
[ "$debug" = 1 ] && set -x || trap "rm -rf $tmpdir" EXIT INT
|
[ "$debug" = 1 ] && set -x || trap "rm -rf $tmpdir" EXIT INT
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,8 +258,9 @@ copy_hook()
|
|||||||
mkdir -p "${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
mkdir -p "${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
||||||
cp "${_dir}/${hook}/${hook}.init" \
|
cp "${_dir}/${hook}/${hook}.init" \
|
||||||
"${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
"${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
||||||
|
fi
|
||||||
|
|
||||||
elif [ -f "${_dir}/${hook}/${hook}.init.early" ]; then
|
if [ -f "${_dir}/${hook}/${hook}.init.early" ]; then
|
||||||
mkdir -p "${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
mkdir -p "${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
||||||
cp "${_dir}/${hook}/${hook}.init.early" \
|
cp "${_dir}/${hook}/${hook}.init.early" \
|
||||||
"${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
"${tmpdir}/usr/share/tinyramfs/hooks/${hook##*/}"
|
||||||
|
Loading…
Reference in New Issue
Block a user