From c60ca42571dec74bdfaf73ceae854cadd247532b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Thu, 26 May 2022 23:16:13 +0200 Subject: [PATCH 1/2] kernel-install: actually ignore the last two arguments --- src/kernel-install/kernel-install.in | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in index 5f88ac2490..96c50ba633 100755 --- a/src/kernel-install/kernel-install.in +++ b/src/kernel-install/kernel-install.in @@ -80,12 +80,13 @@ fi if [ "${0##*/}" = "installkernel" ]; then COMMAND=add - # make install doesn't pass any initrds - no_initrds=1 + # kernel's install.sh invokes us as + # /sbin/installkernel + # We ignore the last two arguments. + set -- "$1" else COMMAND="$1" [ $# -ge 1 ] && shift - no_initrds=0 fi if [ "$COMMAND" = "inspect" ]; then @@ -323,16 +324,8 @@ case "$COMMAND" in fi for f in $PLUGINS; do - if [ "$no_initrds" = 1 ]; then - # kernel's install.sh invokes us as - # /sbin/installkernel - # We ignore the last two arguments. - [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS $1" - "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$1" - else - [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS $*" - "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$@" - fi + [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS $*" + "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$@" err=$? [ $err -eq $skip_remaining ] && break From 2f9f8b96d41bc0787f53dcc01c1488fcdc735e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Thu, 26 May 2022 23:18:07 +0200 Subject: [PATCH 2/2] kernel-install: don't log each initrd on its own line in verbose mode --- src/kernel-install/kernel-install.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in index 96c50ba633..3da233ef6e 100755 --- a/src/kernel-install/kernel-install.in +++ b/src/kernel-install/kernel-install.in @@ -324,7 +324,7 @@ case "$COMMAND" in fi for f in $PLUGINS; do - [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS $*" + [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS" "$@" "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$@" err=$? @@ -358,8 +358,8 @@ case "$COMMAND" in # Assert that ENTRY_DIR_ABS actually matches what we are printing here [ "${ENTRY_DIR_ABS%/*}" = "$KERNEL_INSTALL_BOOT_ROOT/$ENTRY_TOKEN" ] || { echo "Assertion didn't pass." >&2; exit 1; } - ;; + *) echo "Error: unknown command '$COMMAND'" >&2 exit 1