From 8abfcc9052cf9ed5c02a5df36626e4505d990e64 Mon Sep 17 00:00:00 2001 From: illiliti Date: Fri, 21 May 2021 22:24:08 +0300 Subject: [PATCH] tinyramfs: fix init* hooks not getting copied copy_file overwrites global _dir variable which lead to skipping copying init* hooks. --- tinyramfs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tinyramfs b/tinyramfs index 9ca0404..4b91ac9 100755 --- a/tinyramfs +++ b/tinyramfs @@ -227,22 +227,22 @@ copy_hook() { hook="$1" - for _dir in "$hksdir" /etc/tinyramfs/hooks /usr/share/tinyramfs/hooks; do - [ -f "${_dir}/${hook}/${hook}" ] && break + for hook_dir in "$hksdir" /etc/tinyramfs/hooks /usr/share/tinyramfs/hooks; do + [ -f "${hook_dir}/${hook}/${hook}" ] && break done || panic "could not find $hook hook" print "running $hook hook" # https://www.shellcheck.net/wiki/SC1090 # shellcheck disable=1090 - . "${_dir}/${hook}/${hook}" + . "${hook_dir}/${hook}/${hook}" for _type in init init.late; do - [ -f "${_dir}/${hook}/${hook}.${_type}" ] || continue + [ -f "${hook_dir}/${hook}/${hook}.${_type}" ] || continue print "copying ${hook}.${_type}" - copy_file "${_dir}/${hook}/${hook}.${_type}" \ + copy_file "${hook_dir}/${hook}/${hook}.${_type}" \ "/usr/share/tinyramfs/hooks/${hook}/${hook}.${_type}" 644 0 done }