Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM architecture support to manage-config #146

Merged
merged 2 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :

# Optionally add/remove kernel options
if [ -f ../manage-config ]; then
../manage-config amd64
../manage-config $(CONFIGURED_ARCH)
fi

# Building a custom kernel from Debian kernel source
Expand Down
54 changes: 54 additions & 0 deletions manage-config
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,50 @@ case "$ARCH" in
amd64)
CONFIG_FILE_LOC=debian/build/build_amd64_none_amd64
;;
arm64)
CONFIG_FILE_LOC=debian/build/build_arm64_none_arm64
;;
armhf)
CONFIG_FILE_LOC=debian/build/build_armhf_none_armmp
;;
*)
CONFIG_FILE_LOC=debian/build/build_amd64_none_amd64
;;
esac
CONFIG_FILE=${CONFIG_FILE_LOC}/.config

# Add multi-architecture support
#
# To remove the option for specify architecture from the kernel,
# add the arch tag such as [amd64] or [arm64] or [armhf] and options into the
# flat text file patch/kconfig-exclusions.
# if no tag appears, it is in effect for all architectures.
#
# Example:
# [amd64]CONFIG_SOUND
# [arm64]CONFIG_ISDN
# [armhf]CONFIG_ISDN
#
# To add the options for specify architecture into the kernel,
# add the arch tag such as [amd64] or [arm64] or [armhf] options into the
# flat text file patch/kconfig-inclusions.
# if no tag appears, it is in effect for all architectures.
#
# Example:
# [amd64]CONFIG_AD5064=y
lguohan marked this conversation as resolved.
Show resolved Hide resolved

function match_arch(){
opt=$1
assigned_arch=$(expr $opt : '.*\[\(.*\)\]')
if [ ! -z "$assigned_arch" ]; then
if [ ! "$assigned_arch" = "$ARCH" ]; then
return 1
else
opt=${opt#*]}
fi
fi
}

ret=0
if [ -e ../patch/kconfig-exclusions -o -e ../patch/kconfig-inclusions ];
then
Expand All @@ -43,6 +81,10 @@ then
if [ -f ../patch/kconfig-exclusions ]; then
while read -r opt; do
if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then
match_arch $opt
if [ $? = 1 ]; then
continue
fi
scripts/config --file ${CONFIG_FILE} -d $opt
fi
done < ../patch/kconfig-exclusions;
Expand All @@ -52,6 +94,10 @@ then
if [ -f ../patch/kconfig-inclusions ]; then
while read -r opt; do
if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then
match_arch $opt
if [ $? = 1 ]; then
continue
fi
echo $opt >> ${CONFIG_FILE}
fi
done < ../patch/kconfig-inclusions;
Expand All @@ -66,6 +112,10 @@ then
echo "Checking removed kernel options..."
while read -r opt; do
if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then
match_arch $opt
if [ $? = 1 ]; then
continue
fi
s=$(scripts/config --file ${CONFIG_FILE} -k --state $opt)
if [ ! "$s" = "undef" -a ! "$s" = "n" ]; then
ret=1
Expand All @@ -84,6 +134,10 @@ then
echo "Checking added kernel options..."
while read -r opt; do
if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then
match_arch $opt
if [ $? = 1 ]; then
continue
fi
n=${opt%=*}
v="${opt#*=}"
s=$(scripts/config --file ${CONFIG_FILE} -k --state $n)
Expand Down
20 changes: 10 additions & 10 deletions patch/kconfig-inclusions
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CONFIG_SENSORS_MAX6697=m
CONFIG_SENSORS_DPS1900=m
# For cig-cs6436
CONFIG_SERIAL_8250_LPSS=m
[amd64]CONFIG_SERIAL_8250_LPSS=m
# SFF_8436
CONFIG_EEPROM_SFF_8436=m
# For Dell S6000
Expand All @@ -12,14 +12,14 @@ CONFIG_SENSORS_PMBUS=m
CONFIG_SENSORS_DNI_DPS460=m
CONFIG_I2C_MUX_GPIO=m
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_SCH=m
[amd64]CONFIG_GPIO_SCH=m
# For Dell Z9100
CONFIG_I2C_MUX_PCA954x=m
# For Ingrasys S9100
CONFIG_I2C_GPIO=m
CONFIG_GPIO_PCA953X=m
# For Inventec d7032
CONFIG_GPIO_ICH=m
[amd64]CONFIG_GPIO_ICH=m
# For mitac ly1200
CONFIG_SENSORS_MAX31790=m
# For optoe
Expand All @@ -33,19 +33,19 @@ CONFIG_MLXSW_I2C=m
CONFIG_MLXSW_MINIMAL=m
CONFIG_I2C_MUX_REG=m
CONFIG_I2C_MUX_MLXCPLD=m
CONFIG_I2C_MLXCPLD=m
[amd64]CONFIG_I2C_MLXCPLD=m
CONFIG_SENSORS_IIO_HWMON=m
CONFIG_SENSORS_MLXREG_FAN=m
[amd64]CONFIG_SENSORS_MLXREG_FAN=m
CONFIG_SENSORS_LM25066=m
CONFIG_SENSORS_TPS53679=m
CONFIG_SENSORS_UCD9000=m
CONFIG_SENSORS_UCD9200=m
CONFIG_SENSORS_XDPE122=m
CONFIG_MLX_WDT=y
[amd64]CONFIG_MLX_WDT=y
CONFIG_LEDS_MLXREG=m
CONFIG_DW_DMAC_PCI=m
CONFIG_MLX_PLATFORM=m
CONFIG_MELLANOX_PLATFORM=y
CONFIG_MLXREG_HOTPLUG=m
CONFIG_MLXREG_IO=m
[amd64]CONFIG_MLX_PLATFORM=m
[amd64]CONFIG_MELLANOX_PLATFORM=y
[amd64]CONFIG_MLXREG_HOTPLUG=m
[amd64]CONFIG_MLXREG_IO=m
CONFIG_MAX1363=m