2019-05-17 19:07:15 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-05-11 07:21:49 +03:00
|
|
|
if [ $# != 1 ]; then
|
|
|
|
echo "Usage: $0 <modules.order>" >& 2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit_code=0
|
|
|
|
|
2019-05-17 19:07:15 +03:00
|
|
|
# Check uniqueness of module names
|
|
|
|
check_same_name_modules()
|
|
|
|
{
|
2021-03-31 16:38:05 +03:00
|
|
|
for m in $(sed 's:.*/::' "$1" | sort | uniq -d)
|
2019-05-17 19:07:15 +03:00
|
|
|
do
|
2020-05-11 07:21:49 +03:00
|
|
|
echo "error: the following would cause module name conflict:" >&2
|
2022-12-11 16:04:07 +03:00
|
|
|
sed -n "/\/$m/s:^\(.*\)\.o\$: \1.ko:p" "$1" >&2
|
2020-05-11 07:21:49 +03:00
|
|
|
exit_code=1
|
2019-05-17 19:07:15 +03:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-05-11 07:21:49 +03:00
|
|
|
check_same_name_modules "$1"
|
|
|
|
|
|
|
|
exit $exit_code
|