local _dev
local _ret=1
- [[ "${!host_fs_types[@]}" ]] || return 0
+ [[ "${#host_fs_types[@]}" ]] || return 0
for _dev in "${!host_fs_types[@]}"; do
$_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0
[[ "${host_devs[@]}" ]] || return 0
- for _dev in ${host_devs[@]}; do
+ for _dev in "${host_devs[@]}"; do
[[ -b "$_dev" ]] || continue
if check_block_and_slaves_all $_func $(get_maj_min $_dev); then
_ret=0
[[ "${host_devs[@]}" ]] || return 0
- for _dev in ${host_devs[@]}; do
+ for _dev in "${host_devs[@]}"; do
[[ -b "$_dev" ]] || continue
check_block_and_slaves $_func $(get_maj_min $_dev) && return 0
done
local _ret
local _moddep
- [ "${#host_fs_types[*]}" -le 0 ] && return 1
+ [ "${#host_fs_types[@]}" -le 0 ] && return 1
# If we are already scheduled to be loaded, no need to check again.
[[ " $mods_to_load " == *\ $_mod\ * ]] && return 0
return 1
}
-for dev in ${host_devs[@]}; do
+for dev in "${host_devs[@]}"; do
_get_fs_type "$dev"
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
done
fi
if [[ $kernel_only != yes ]]; then
- (( ${#install_items[@]} > 0 )) && inst_multiple ${install_items[@]}
- (( ${#install_optional_items[@]} > 0 )) && inst_multiple -o ${install_optional_items[@]}
+ (( ${#install_items[@]} > 0 )) && inst_multiple "${install_items[@]}"
+ (( ${#install_optional_items[@]} > 0 )) && inst_multiple -o "${install_optional_items[@]}"
[[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
extract_files()
{
(( ${#filenames[@]} == 1 )) && nofileinfo=1
- for f in ${!filenames[@]}; do
+ for f in "${!filenames[@]}"; do
[[ $nofileinfo ]] || echo "initramfs:/$f"
[[ $nofileinfo ]] || echo "========================================================================"
$CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
require_binaries btrfs || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for fs in ${host_fs_types[@]}; do
+ for fs in "${host_fs_types[@]}"; do
[[ "$fs" == "btrfs" ]] && return 0
done
return 255
instmods '=fs'
fi
else
- for i in $(host_fs_all); do
+ for i in "${host_fs_types[@]}"; do
hostonly='' instmods $i
done
fi
require_binaries mount.cifs || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for fs in ${host_fs_types[@]}; do
+ for fs in "${host_fs_types[@]}"; do
[[ "$fs" == "cifs" ]] && return 0
done
return 255
require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for fs in ${host_fs_types[@]}; do
+ for fs in "${host_fs_types[@]}"; do
[[ "$fs" == "nfs" ]] && return 0
[[ "$fs" == "nfs3" ]] && return 0
[[ "$fs" == "nfs4" ]] && return 0
# called by dracut
check() {
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for fs in ${host_fs_types[@]}; do
+ for fs in "${host_fs_types[@]}"; do
[[ "$fs" == "9p" ]] && return 0
done
return 255
. "$moddir/dracut-lib.sh"
- for _dev in ${host_devs[@]}; do
- for _dev2 in ${root_devs[@]}; do
+ for _dev in "${host_devs[@]}"; do
+ for _dev2 in "${root_devs[@]}"; do
[[ "$_dev" == "$_dev2" ]] && continue 2
done
# We only actually wait for real devs - swap is only needed
# for resume and udev rules generated when parsing resume=
# argument take care of the waiting for us
- for _dev2 in ${swap_devs[@]}; do
+ for _dev2 in "${swap_devs[@]}"; do
[[ "$_dev" == "$_dev2" ]] && continue 2
done