xref: /openbmc/linux/scripts/modules-check.sh (revision e65e175b)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4set -e
5
6if [ $# != 1 ]; then
7	echo "Usage: $0 <modules.order>" >& 2
8	exit 1
9fi
10
11exit_code=0
12
13# Check uniqueness of module names
14check_same_name_modules()
15{
16	for m in $(sed 's:.*/::' "$1" | sort | uniq -d)
17	do
18		echo "error: the following would cause module name conflict:" >&2
19		sed -n "/\/$m/s:^\(.*\)\.o\$:  \1.ko:p" "$1" >&2
20		exit_code=1
21	done
22}
23
24check_same_name_modules "$1"
25
26exit $exit_code
27