@@ -57,9 +57,7 @@ cat > "$new_ksyms_file" << EOT
EOT
sed -ns -e '3s/ /\n/gp' "$MODVERDIR"/*.mod | sort -u |
while read sym; do
- if [ -n "$CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX" ]; then
- sym=$(sed 's/^_//' <<< "$sym")
- fi
+ [ -n "$CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX" ] && sym="${sym#_}"
echo "#define __KSYM_${sym} 1"
done >> "$new_ksyms_file"
@@ -72,16 +70,18 @@ fi
# dependency files.
# Note: sort -m doesn't work well with underscore prefixed symbols so we
# use 'cat ... | sort' instead.
-changed=0
+changed=$(
+count=0
+cat "$cur_ksyms_file" "$new_ksyms_file" | sort | uniq -u |
+sed -n 's/^#define __KSYM_\(.*\) 1/\1/p' | tr "A-Z_" "a-z/" |
while read sympath; do
[ -z "$sympath" ] && continue
depfile="include/config/ksym/${sympath}.h"
mkdir -p "$(dirname "$depfile")"
touch "$depfile"
- changed=$((changed + 1))
-done <<< "$(
- cat "$cur_ksyms_file" "$new_ksyms_file" | sort | uniq -u |
- sed -n 's/^#define __KSYM_\(.*\) 1/\1/p' | tr "A-Z_" "a-z/" )"
+ echo $((count += 1))
+done | tail -1 )
+changed=${changed:-0}
if [ $changed -gt 0 ]; then
# Replace the old list with tne new one