[PATCH] binman: Avoid requiring a home directory on startup

Mark Kettenis mark.kettenis at xs4all.nl
Fri Feb 10 22:23:12 CET 2023


> From: Simon Glass <sjg at chromium.org>
> Date: Fri, 10 Feb 2023 13:59:46 -0700
> 
> This is needed to download tools, but we may not need to do this. At
> present binman fails to start if HOME is not set.
> 
> Use the current directory as a default to avoid this.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>

Not new, but $HOME/bin seems like an *extremely* poor choice for a
directory to download random binaries from the internet into as this
directory is often part of a user's $PATH.


> ---
> 
>  tools/binman/bintool.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py
> index 8fda13ff012..f460243e796 100644
> --- a/tools/binman/bintool.py
> +++ b/tools/binman/bintool.py
> @@ -43,7 +43,7 @@ FETCH_NAMES = {
>  # Status of tool fetching
>  FETCHED, FAIL, PRESENT, STATUS_COUNT = range(4)
>  
> -DOWNLOAD_DESTDIR = os.path.join(os.getenv('HOME'), 'bin')
> +DOWNLOAD_DESTDIR = os.path.expanduser('~/bin')
>  
>  class Bintool:
>      """Tool which operates on binaries to help produce entry contents
> -- 
> 2.39.1.581.gbfd45094c4-goog
> 
> 


More information about the U-Boot mailing list