UBUNTU: [Packaging] Drop support of old config handling

All kernels and their derivatives have been migrated to the new annotations
scheme by now so clean up the tree and drop the support of the old config
handling.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
Juerg Haefliger
2023-05-09 16:29:51 +02:00
committed by Paolo Pisati
parent d739a08a84
commit c66e49e483
5 changed files with 2 additions and 446 deletions
-35
View File
@@ -1,35 +0,0 @@
#!/bin/bash
. debian/debian.env
# We have to be in the top level kernel source directory
if [ ! -f MAINTAINERS ] || [ ! -f Makefile ]; then
echo "This does not appear to be the kernel source directory." 1>&2
exit 1
fi
. ${DEBIAN}/etc/kernelconfig
ARCH=$(echo $archs | tr " " "\n" | sort -u)
FLAVOUR=$(for arch in ${ARCH}; do
flavours=$(sed -ne 's/^flavours\s*=\s*\(.*\)$/\1/p' ${DEBIAN}/rules.d/${arch}.mk)
for flavour in ${flavours}; do
echo ${arch}-${flavour}
done
done | tr " " "\n" | sort -u)
while read line; do
(echo $line | grep -q '^#') || break
done
cat << EOF
# Menu: HEADER
# FORMAT: 4
# ARCH: $(echo ${ARCH})
# FLAVOUR: $(echo ${FLAVOUR})
EOF
while read line; do
echo ${line}
done
-218
View File
@@ -1,218 +0,0 @@
#!/bin/bash
. debian/debian.env
# Script to merge all configs and run 'make syncconfig' on it to wade out bad juju.
# Then split the configs into distro-commmon and flavour-specific parts
# We have to be in the top level kernel source directory
if [ ! -f MAINTAINERS ] || [ ! -f Makefile ]; then
echo "This does not appear to be the kernel source directory." 1>&2
exit 1
fi
mode=${1:?"Usage: $0 (oldconfig|editconfig) [do_enforce_all]"}
do_enforce_all=${2:-0}
yes=0
case "$mode" in
update*configs) mode='syncconfig' ;;
default*configs) mode='oldconfig'; yes=1 ;;
edit*configs) ;; # All is good
gen*configs) mode='genconfigs' ;; # All is good
dump*configs) mode='config'; yes=1 ;;
*) echo "$0 called with invalid mode" 1>&2
exit 1 ;;
esac
if [ -z "$gcc" ]; then
echo "ERROR: gcc environment variable must be set"
exit 1
fi
kerneldir="`pwd`"
confdir="$kerneldir/${DEBIAN}/config"
variant="$2"
. $DEBIAN/etc/kernelconfig
bindir="`pwd`/${DROOT}/scripts/misc"
common_conf="$confdir/config.common.ubuntu"
tmpdir=`mktemp -d`
mkdir "$tmpdir/CONFIGS"
if [ "$mode" = "genconfigs" ]; then
keep=1
mode="oldconfig"
test -d CONFIGS || mkdir CONFIGS
fi
warning_partial=
for arch in $archs; do
rm -rf build
mkdir build
# Map debian archs to kernel archs
case "$arch" in
ppc64|ppc64el) kernarch="powerpc" ;;
amd64) kernarch="x86_64" ;;
lpia) kernarch="x86" ;;
sparc) kernarch="sparc64" ;;
armel|armhf) kernarch="arm" ;;
s390x) kernarch="s390" ;;
riscv64) kernarch="riscv" ;;
*) kernarch="$arch" ;;
esac
# Determine cross toolchain to use for Kconfig compiler tests
cross_compile="$(dpkg-architecture -qDEB_HOST_GNU_TYPE -a$arch 2>/dev/null)-"
# Arch-specific compiler, if any
archgcc=$(echo -e "show-%:\n\t@echo \$(\$*)\ninclude $DEBIAN/rules.d/$arch.mk" | make -s -f - show-gcc)
# Environment variables for 'make *config'. We omit CROSS_COMPILE
# for i386 since it is no longer supported after 19.04, however
# we maintain the configs for hwe.
modify_config=true
env="ARCH=$kernarch DEB_ARCH=$arch"
compiler_path=$(which "${cross_compile}${archgcc:-$gcc}" || true)
if [ "$compiler_path" != '' ]; then
env="$env CROSS_COMPILE=$cross_compile CC=$compiler_path"
else
echo "WARNING: ${cross_compile}gcc not installed"
modify_config=
warning_partial="$warning_partial $arch"
fi
archconfdir=$confdir/$arch
flavourconfigs=$(cd $archconfdir && ls config.flavour.*)
# Merge configs
# We merge config.common.ubuntu + config.common.<arch> +
# config.flavour.<flavour>
for config in $flavourconfigs; do
fullconf="$tmpdir/$arch-$config-full"
case $config in
*)
: >"$fullconf"
if [ -f $common_conf ]; then
cat $common_conf >> "$fullconf"
fi
if [ -f $archconfdir/config.common.$arch ]; then
cat $archconfdir/config.common.$arch >> "$fullconf"
fi
cat "$archconfdir/$config" >>"$fullconf"
if [ -f $confdir/OVERRIDES ]; then
cat $confdir/OVERRIDES >> "$fullconf"
fi
;;
esac
done
for config in $flavourconfigs; do
if [ -f $archconfdir/$config ]; then
fullconf="$tmpdir/$arch-$config-full"
cat "$fullconf" > build/.config
# Call oldconfig or menuconfig
if [ "$modify_config" ]; then
case "$mode" in
editconfigs)
# Interactively edit config parameters
while : ; do
echo -n "Do you want to edit config: $arch/$config? [Y/n] "
read choice
case "$choice" in
y* | Y* | "" )
make O=`pwd`/build $conc_level $env menuconfig
break ;;
n* | N* )
# 'syncconfig' prevents
# errors for '-' options set
# in common config fragments
make O=`pwd`/build $conc_level $env syncconfig
break ;;
*)
echo "Entry not valid"
esac
done
;;
*)
echo "* Run $mode (yes=$yes) on $arch/$config ..."
if [ "$yes" -eq 1 ]; then
yes "" | make O=`pwd`/build $conc_level $env "$mode"
else
make O=`pwd`/build $conc_level $env "$mode"
fi ;;
esac
fi
cat build/.config > $archconfdir/$config
[ "$modify_config" ] && cat build/.config >"$tmpdir/CONFIGS/$arch-$config"
if [ "$keep" = "1" ]; then
cat build/.config > CONFIGS/$arch-$config
fi
else
echo "!! Config not found $archconfdir/$config..."
fi
done
echo "Running splitconfig.pl for $arch"
echo
# Can we make this more robust by avoiding $tmpdir completely?
# This approach was used for now because I didn't want to change
# splitconfig.pl
(cd $archconfdir; $bindir/splitconfig.pl config.flavour.*; mv config.common \
config.common.$arch; cp config.common.$arch $tmpdir)
done
rm -f $common_conf
# Now run splitconfig.pl on all the config.common.<arch> copied to
# $tmpdir
(cd $tmpdir; $bindir/splitconfig.pl *)
(
cd $confdir;
rm -f *-full
grep -v 'is UNMERGABLE' <$tmpdir/config.common >$common_conf
for arch in $archs; do
grep -v 'is UNMERGABLE' <$tmpdir/config.common.$arch \
>$arch/config.common.$arch
done
)
echo ""
echo "Running config-check for all configurations ..."
echo ""
fail=0
for arch in $archs; do
archconfdir=$confdir/$arch
flavourconfigs=$(cd $archconfdir && ls config.flavour.*)
for config in $flavourconfigs; do
flavour="${config##*.}"
if [ -f $archconfdir/$config ]; then
fullconf="$tmpdir/CONFIGS/$arch-$config"
[ ! -f "$fullconf" ] && continue
"$bindir/../checks/config-check" "$fullconf" "$arch" "$flavour" "$confdir" "0" "$do_enforce_all" || let "fail=$fail+1"
fi
done
done
rc=0
if [ "$fail" != 0 ]; then
rc=1
echo ""
echo "*** ERROR: $fail config-check failures detected"
echo ""
fi
rm -rf build
if [ "$warning_partial" ]; then
rc=1
echo ""
echo "WARNING: configuration operation applied only to a subset of architectures (skipped$warning_partial)" 1>&2
echo ""
fi
exit "${rc}"