jianhai / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
Pablo Greco d6c4c4
#!/bin/sh
Pablo Greco d6c4c4
Pablo Greco d6c4c4
# Adjusts the configuration options to build the variants correctly
Pablo Greco d6c4c4
#
Pablo Greco d6c4c4
# arg1: configuration to go in the primary variant
Pablo Greco d6c4c4
# arg2: are we only generating debug configs
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Pablo Greco d6c4c4
PRIMARY=$1
Pablo Greco d6c4c4
DEBUGBUILDSENABLED=$2
Pablo Greco d6c4c4
Pablo Greco d6c4c4
if [ -z $2 ]; then
Pablo Greco d6c4c4
	exit 1
Pablo Greco d6c4c4
fi
Pablo Greco d6c4c4
Pablo Greco d6c4c4
if [ $PRIMARY == "fedora" ]; then
Pablo Greco d6c4c4
	SECONDARY=rhel
Pablo Greco d6c4c4
else
Pablo Greco d6c4c4
	SECONDARY=fedora
Pablo Greco d6c4c4
fi
Pablo Greco d6c4c4
Pablo Greco d6c4c4
for i in kernel-*-$PRIMARY.config; do
Pablo Greco d6c4c4
	NEW=kernel-$VERSION-`echo $i | cut -d - -f2- | sed s/-$PRIMARY//`
Pablo Greco d6c4c4
	#echo $NEW
Pablo Greco d6c4c4
	mv $i $NEW
Pablo Greco d6c4c4
done
Pablo Greco d6c4c4
Pablo Greco d6c4c4
rm kernel-*-$SECONDARY.config
Pablo Greco d6c4c4
Pablo Greco d6c4c4
if [ $DEBUGBUILDSENABLED -eq 0 ]; then
Pablo Greco d6c4c4
	for i in kernel-*debug*.config; do
Pablo Greco d6c4c4
		base=`echo $i | sed -r s/-?debug//g`
Pablo Greco d6c4c4
		NEW=kernel-`echo $base | cut -d - -f2-`
Pablo Greco d6c4c4
		mv $i $NEW
Pablo Greco d6c4c4
	done
Pablo Greco d6c4c4
fi