cleanup copy_hook

This commit is contained in:
illiliti 2020-09-06 16:46:46 +03:00
parent 0de5103945
commit fbbeecf193

View File

@ -235,22 +235,24 @@ copy_hook()
{
hook="$1"
# false positive
# shellcheck disable=1090
for _dir in "$hksdir" /etc/tinyramfs/hooks "${srcdir}/hooks"; do
[ -f "${_dir}/${hook}/${hook}" ] || ! continue
done || panic "could not find $hook hook"
print "running $hook hook"; . "${_dir}/${hook}/${hook}"
print "running $hook hook"
# false positive
# shellcheck disable=1090
. "${_dir}/${hook}/${hook}"
for _file in init init.late; do
[ -f "${_dir}/${hook}/${hook}.${_file}" ] || continue
print "copying ${hook}.${_file}"
copy_file "${_dir}/${hook}/${hook}.${_file}" \
"/usr/share/tinyramfs/hooks/${hook##*/}" 644 0
done
break
done || panic "could not run $hook hook"
}
copy_modules()