If the prepare-kernel.sh script is executed with the --default option,
but no default patch can be found for the selected linux kernel
version, the script incorrectly tries to continue (and hangs executing
a malformed grep command)

If no default patch can be found, the $adeos_default_patch variable is
set /dev/null. This filename in this variable is later checked for
readability with 'test -r', which succeeds for /dev/null. This causes
the script to continue with an invalid patch, and subsequently hangs
on the following command:

adeos_version=`grep '^#define.*IPIPE_ARCH_STRING.*"' $asm_ipipe_h
2>/dev/null|head -n1|sed -e 's,.*"\(.*\)"$,\1,'`

2>/dev/null|head -n1

But since the patch failed, $asm_ipipe_h is also empty, the grep
command translates to:
grep  ^#define.*IPIPE_ARCH_STRING.*"
so grep waits for input since no files are given, and the
prepare-kernel.sh script is effectively blocked (without useful

Please find in attachment a patch that adds a check for /dev/null
instead of simply 'test -r', and adds some output in case no default
patch could be found.

Best regards,

Attachment: xenomai-05-improve-output-of-prepare-kernel-script.patch
Description: Binary data

Xenomai-core mailing list

Reply via email to