Re: [Fuego] [PATCH] Add function to get the status of module.

<[email protected]>
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>

> -----Original Message-----
> From: Wang Mingyu
> Sent: Monday, November 18, 2019 11:49 AM
> To: [email protected]
> Subject: [Fuego] [PATCH] Add function to get the status of module
Would have been nice to have a bit of description in the body
of the commit message, but this is short enough that I just
applied as is.

> 
> Signed-off-by: Wang Mingyu <[email protected]>
> ---
>  scripts/fuego_board_function_lib.sh | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/scripts/fuego_board_function_lib.sh
> b/scripts/fuego_board_function_lib.sh
> index a6cd842..115c615 100644
> --- a/scripts/fuego_board_function_lib.sh
> +++ b/scripts/fuego_board_function_lib.sh
> @@ -12,6 +12,7 @@
>  init_manager="init_manager-not-set"
>  logger_service="logger_service-not-set"
>  service_status="unknown"
> +module_status="unknown"
> 
>  # set_init_manager:
>  #   detects and sets the init_manager variable, which indicates which
> @@ -100,3 +101,16 @@ get_service_logfile() {
>      fi
>      echo $service_logfile
>  }
> +
> +# get_module_status:
> +# get status of module
> +# returns: status of module
> +get_module_status() {
> +    if lsmod | grep $1
> +    then
> +        module_status="loaded"
> +    else
> +        module_status="unloaded"
> +    fi
> +    echo $module_status
> +}
> --
> 2.17.1

Looks good.  Applied and pushed to master.

Thanks!
 -- Tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.