more robust, standardized kernel_cmdline variable detection

This commit is contained in:
Patrick Schleizer 2025-10-26 08:06:26 -04:00
parent 53db631964
commit cb70f19837
No known key found for this signature in database
GPG key ID: CB8D50BB77BB3C48

View file

@ -111,9 +111,11 @@ if [ "$PAM_USER" = 'sysmaint' ]; then
fi
fi
kernel_cmdline=""
if test -f /proc/cmdline; then
kernel_cmdline="$(cat -- /proc/cmdline)"
kernel_cmdline=''
if [ -f /proc/cmdline ]; then
kernel_cmdline="$(cat -- /proc/cmdline)" || true
elif [ -f /proc/1/cmdline ]; then
kernel_cmdline="$(cat -- /proc/1/cmdline)" || true
fi
if [ "$PAM_USER" != 'sysmaint' ]; then