Re: [PATCH] resume/module-setup.sh: filter out empty resume= options in cmdline()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16.05.2014 19:12, Alexander Tsoy wrote:
> cmdline() prints empty "resume=" options for non-persistent swap
> devices, for example zram. Add a check for that.
> 
> This patch also fixes printf formatting and removes unused variables.
> ---
>  modules.d/95resume/module-setup.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
> index ceb7855..b1b4684 100755
> --- a/modules.d/95resume/module-setup.sh
> +++ b/modules.d/95resume/module-setup.sh
> @@ -17,12 +17,12 @@ check() {
>  
>  # called by dracut
>  cmdline() {
> -    local _activated
> -    declare -A _activated
> +    local _resume
>  
>      for dev in "${!host_fs_types[@]}"; do
>          [[ ${host_fs_types[$dev]} =~ ^(swap|swsuspend|swsupend)$ ]] || continue
> -        printf "resume=%s " "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
> +        _resume=$(shorten_persistent_dev "$(get_persistent_dev "$dev")")
> +        [[ -n ${_resume} ]] && printf " resume=%s" "${_resume}"
>      done
>  }
>  
> 

thanks!

http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=c4b529f50388474ceffa8c918d2722fc777eac0a
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux