aboutsummaryrefslogtreecommitdiffstats
path: root/classes/module_strip.bbclass
blob: 9c17e4cddc8ddcb95a0fd79926d8b90df399d466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
PACKAGESTRIPFUNCS += "do_strip_modules"

# inherit to get get_kernelmajorversion();
inherit linux-kernel-base

# may be inherited by kernel.bbclass which sets KERNEL_MAJOR_VERSION
KERNEL_MAJOR_VERSION ?= "${@get_kernelmajorversion('${KERNEL_VERSION}')}"

do_strip_modules () {
	if test -e ${PKGD}/lib/modules; then
		if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then
			modules="`find ${PKGD}/lib/modules -name \*.ko`"
		else
			modules="`find ${PKGD}/lib/modules -name \*.o`"
		fi
		if [ -n "$modules" ]; then
			for module in $modules ; do
				if ! [ -d "$module"  ] ; then
					${STRIP} -v -g $module
				fi
			done	
		fi
	fi
}