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