xref: /kernel/linux/linux-5.10/scripts/modules-check.sh
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/scripts/
18c2ecf20Sopenharmony_ci#!/bin/sh
28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciset -e
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciif [ $# != 1 ]; then
78c2ecf20Sopenharmony_ci	echo "Usage: $0 <modules.order>" >& 2
88c2ecf20Sopenharmony_ci	exit 1
98c2ecf20Sopenharmony_cifi
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciexit_code=0
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci# Check uniqueness of module names
148c2ecf20Sopenharmony_cicheck_same_name_modules()
158c2ecf20Sopenharmony_ci{
168c2ecf20Sopenharmony_ci	for m in $(sed 's:.*/::' $1 | sort | uniq -d)
178c2ecf20Sopenharmony_ci	do
188c2ecf20Sopenharmony_ci		echo "error: the following would cause module name conflict:" >&2
198c2ecf20Sopenharmony_ci		sed -n "/\/$m/s:^:  :p" modules.order >&2
208c2ecf20Sopenharmony_ci		exit_code=1
218c2ecf20Sopenharmony_ci	done
228c2ecf20Sopenharmony_ci}
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cicheck_same_name_modules "$1"
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciexit $exit_code
27

Indexes created Thu Nov 07 10:32:03 CST 2024