From 4c9383ec63c98808ee4501b8b17ca1359c386e4c Mon Sep 17 00:00:00 2001 From: Patrick Talbert Date: Tue, 2 Apr 2024 13:24:07 +0200 Subject: [PATCH] profile.d: don't try to source non-existent os-release file When /etc/os-release does not exist we directly try to source /usr/lib/os-release. This causes a 'No such file or directory' error when entering a toolbox which has neither. Fix this by checking for the presence of /usr/lib/os-release before sourcing it, just like what is done for /etc/os-release. Signed-off-by: Patrick Talbert --- profile.d/toolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile.d/toolbox.sh b/profile.d/toolbox.sh index d2e16cbd7..075569e1f 100644 --- a/profile.d/toolbox.sh +++ b/profile.d/toolbox.sh @@ -13,7 +13,7 @@ toolbox_welcome_stub="$toolbox_config/toolbox-welcome-shown" eval $( if [ -f /etc/os-release ]; then . /etc/os-release - else + elif [ -f /usr/lib/os-release ]; then . /usr/lib/os-release fi