diff mbox

kbuild: fix scripts/adjust_autoksyms.sh* for the no modules case

Message ID alpine.LFD.2.20.1612081410570.1657@knanqh.ubzr (mailing list archive)
State New, archived
Headers show

Commit Message

Nicolas Pitre Dec. 8, 2016, 7:17 p.m. UTC
When CONFIG_TRIM_UNUSED_KSYMS=y and no modules are actually selected,
the adjust_autoksyms.sh script fails with:

sed: can't read .tmp_versions/*.mod: No such file or directory

Let's cope with that case gracefully.

Signed-off-by: Nicolas Pitre <nico@linaro.org>

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Michal Marek Dec. 11, 2016, 9:37 p.m. UTC | #1
On Thu, Dec 08, 2016 at 02:17:03PM -0500, Nicolas Pitre wrote:
> When CONFIG_TRIM_UNUSED_KSYMS=y and no modules are actually selected,
> the adjust_autoksyms.sh script fails with:
> 
> sed: can't read .tmp_versions/*.mod: No such file or directory
> 
> Let's cope with that case gracefully.
> 
> Signed-off-by: Nicolas Pitre <nico@linaro.org>

Applied to kbuild.git#kbuild.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh
index 8dc1918b67..513da1a4a2 100755
--- a/scripts/adjust_autoksyms.sh
+++ b/scripts/adjust_autoksyms.sh
@@ -59,6 +59,7 @@  cat > "$new_ksyms_file" << EOT
  */
 
 EOT
+[ "$(ls -A "$MODVERDIR")" ] &&
 sed -ns -e '3{s/ /\n/g;/^$/!p;}' "$MODVERDIR"/*.mod | sort -u |
 while read sym; do
 	if [ -n "$CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX" ]; then