linuxtorvalds / rpms / kernel

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