Commit 7e548e9a authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: deb-pkg: add CONFIG_ prefix to kernel config options

This might be a kind of bike-shed, but I personally prefer grep'able
code.

I often do 'git grep CONFIG_FOO' instead of 'git grep FOO' when I
want to know where that CONFIG option is used.

This makes code longer, but I hope this is acceptable level.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 2b50f7ab
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
set -e set -e
is_enabled() { is_enabled() {
grep -q "^CONFIG_$1=y" $KCONFIG_CONFIG grep -q "^$1=y" $KCONFIG_CONFIG
} }
if_enabled_echo() { if_enabled_echo() {
...@@ -31,23 +31,23 @@ set_debarch() { ...@@ -31,23 +31,23 @@ set_debarch() {
x86_64) x86_64)
debarch=amd64 ;; debarch=amd64 ;;
sparc*) sparc*)
debarch=sparc$(if_enabled_echo 64BIT 64) ;; debarch=sparc$(if_enabled_echo CONFIG_64BIT 64) ;;
s390*) s390*)
debarch=s390x ;; debarch=s390x ;;
ppc*) ppc*)
if is_enabled 64BIT; then if is_enabled CONFIG_64BIT; then
debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el) debarch=ppc64$(if_enabled_echo CONFIG_CPU_LITTLE_ENDIAN el)
else else
debarch=powerpc$(if_enabled_echo SPE spe) debarch=powerpc$(if_enabled_echo CONFIG_SPE spe)
fi fi
;; ;;
parisc*) parisc*)
debarch=hppa ;; debarch=hppa ;;
mips*) mips*)
if is_enabled CPU_LITTLE_ENDIAN; then if is_enabled CONFIG_CPU_LITTLE_ENDIAN; then
debarch=mips$(if_enabled_echo 64BIT 64)$(if_enabled_echo CPU_MIPSR6 r6)el debarch=mips$(if_enabled_echo CONFIG_64BIT 64)$(if_enabled_echo CONFIG_CPU_MIPSR6 r6)el
elif is_enabled CPU_MIPSR6; then elif is_enabled CONFIG_CPU_MIPSR6; then
debarch=mips$(if_enabled_echo 64BIT 64)r6 debarch=mips$(if_enabled_echo CONFIG_64BIT 64)r6
else else
debarch=mips debarch=mips
fi fi
...@@ -55,8 +55,8 @@ set_debarch() { ...@@ -55,8 +55,8 @@ set_debarch() {
aarch64|arm64) aarch64|arm64)
debarch=arm64 ;; debarch=arm64 ;;
arm*) arm*)
if is_enabled AEABI; then if is_enabled CONFIG_AEABI; then
debarch=arm$(if_enabled_echo VFP hf el) debarch=arm$(if_enabled_echo CONFIG_VFP hf el)
else else
debarch=arm debarch=arm
fi fi
...@@ -64,10 +64,10 @@ set_debarch() { ...@@ -64,10 +64,10 @@ set_debarch() {
openrisc) openrisc)
debarch=or1k ;; debarch=or1k ;;
sh) sh)
if is_enabled CPU_SH3; then if is_enabled CONFIG_CPU_SH3; then
debarch=sh3$(if_enabled_echo CPU_BIG_ENDIAN eb) debarch=sh3$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb)
elif is_enabled CPU_SH4; then elif is_enabled CONFIG_CPU_SH4; then
debarch=sh4$(if_enabled_echo CPU_BIG_ENDIAN eb) debarch=sh4$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb)
fi fi
;; ;;
esac esac
...@@ -134,8 +134,8 @@ fi ...@@ -134,8 +134,8 @@ fi
mkdir -p debian/ mkdir -p debian/
echo $debarch > debian/arch echo $debarch > debian/arch
extra_build_depends=", $(if_enabled_echo UNWINDER_ORC libelf-dev)" extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev)"
extra_build_depends="$extra_build_depends, $(if_enabled_echo SYSTEM_TRUSTED_KEYRING libssl-dev:native)" extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)"
# Generate a simple changelog template # Generate a simple changelog template
cat <<EOF > debian/changelog cat <<EOF > debian/changelog
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment