Skip to content
Snippets Groups Projects
Verified Commit 76dc51bb authored by Karel Koci's avatar Karel Koci :metal:
Browse files

compile_pkgs: verify generated config against our preferences

This checks generated config after Kconfig pass if it still contains
preferences we have in files in configs directory.

This also drops some of the options in our config that are obsolete or
invalid.

CONFIG_VERSION_REPO is overwritten by setting pushed dynamically in
config by compile_pkgs so it makes no sense to have it here.

CONFIG_BUSYBOX_DEFAULT_CROND seems to be impossible to change and is
also default value that we later override with
CONFIG_BUSYBOX_CONFIG_CROND.

All PACKAGE options are not necessary. They are all enabled to 'm' but
getting them to 'y' would require a lot of works with gain that build
would in some cases failed instead of passed without that package. Not
worth it.

CONFIG_DEFAULT_TARGET_OPTIMIZATION is not applies so it is dropped here
without replacement. Same as one occurrence of CONFIG_CPU_TYPE.
parent e7357384
Branches
Tags
2 merge requests!123Turris OS 5.0 (HBK),!116compile_pkgs: verify generated config against our preferences
......@@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
shopt -s nullglob
# Step list that is run when no commands are specified
DEFAULT_STEPS=( "prepare" "compile" "sign" "store_hash" "pkgsrepo" "stats" "gen_junit" )
......@@ -189,6 +190,25 @@ configure() {
echo "CONFIG_VERSION_CODE=\"$(_git_remote_hash)\""
} >> .config
_make defconfig diffconfig
# Verify config
for config in "${src_dir}/configs/common"/* "${src_dir}/configs/${TARGET_BOARD}"/*; do
while IFS="=" read -r name value; do
[ -z "$value" ] && continue
[ "${value:0:1}" = "#" ] && continue
if [ "$value" = "n" ]; then
# No options can be ommited in the result so instead check it
# they are not enabled by any chance.
if grep -qE "^$name=y" ./.config; then
die "Config option that is forced to 'n' is set to 'y': $name=$value"
fi
else
if ! grep -qE "^$name=$value$" ./.config; then
die "Config option is not present in generated config: $name=$value"
fi
fi
done < "$config"
done
}
available_commands+=( ["update_mirror"]="Updates all local mirrors" )
......
......@@ -4,7 +4,6 @@ CONFIG_VERSIONOPT=y
CONFIG_VERSION_MANUFACTURER="CZ.NIC"
CONFIG_VERSION_MANUFACTURER_URL="https://www.turris.cz/"
CONFIG_VERSION_DIST="TurrisOS"
CONFIG_VERSION_REPO="https://repo.turris.cz/"
CONFIG_VERSION_HOME_URL="https://www.turris.cz/"
CONFIG_VERSION_BUG_URL="https://gitlab.labs.nic.cz/groups/turris/-/issues/"
CONFIG_VERSION_SUPPORT_URL="https://www.turris.cz/support/"
# Enable most of the applets available
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_DEFAULT_CROND=n
CONFIG_BUSYBOX_CONFIG_CRONTAB=n
CONFIG_BUSYBOX_CONFIG_CROND=n
CONFIG_BUSYBOX_CONFIG_SYSLOGD=n
......@@ -36,7 +35,6 @@ CONFIG_BUSYBOX_CONFIG_USE_BB_CRYPT_SHA=y
CONFIG_BUSYBOX_CONFIG_EJECT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EJECT_SCSI=y
CONFIG_BUSYBOX_CONFIG_COMM=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP=y
CONFIG_BUSYBOX_CONFIG_WATCHDOG=y
CONFIG_BUSYBOX_CONFIG_DIFF=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DIFF_LONG_OPTIONS=y
......
......@@ -5,17 +5,10 @@ CONFIG_PACKAGE_cznic-repo-keys-test=y
CONFIG_PACKAGE_c-rehash=y
CONFIG_PACKAGE_cert-backup=y
CONFIG_PACKAGE_create_notification=y
CONFIG_PACKAGE_oneshot=y
CONFIG_PACKAGE_thermometer=y
CONFIG_PACKAGE_nethist=y
CONFIG_PACKAGE_server-uplink=y
CONFIG_PACKAGE_update_mac=y
CONFIG_PACKAGE_libatsha204=y
CONFIG_PACKAGE_user_notify=y
CONFIG_PACKAGE_watchdog_adjust=y
CONFIG_PACKAGE_userspace_time_sync=y
CONFIG_PACKAGE_start-indicator=y
CONFIG_PACKAGE_vixie-cron=y
# Turris packages
CONFIG_PACKAGE_schnapps=y
......@@ -23,18 +16,9 @@ CONFIG_PACKAGE_sentinel-certgen=y
CONFIG_PACKAGE_dnssec-rootkey=y
CONFIG_PACKAGE_resolver-conf=y
CONFIG_PACKAGE_turris-utils=y
CONFIG_PACKAGE_turris-maintain=y
CONFIG_PACKAGE_turris-webapps=y
CONFIG_PACKAGE_turris-version=y
# Foris packages
CONFIG_PACKAGE_foris=y
CONFIG_PACKAGE_foris-client=y
CONFIG_PACKAGE_foris-controller=y
CONFIG_PACKAGE_foris-diagnostics-plugin=y
CONFIG_PACKAGE_foris-l10n-cs=y
CONFIG_PACKAGE_foris-ws=y
# Updater packages
CONFIG_PACKAGE_updater-ng=y
CONFIG_PACKAGE_updater-supervisor=y
......@@ -74,7 +58,6 @@ CONFIG_PACKAGE_kmod-ledtrig-heartbeat=y
# LuCI
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-lighttpd=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-rpc=y
CONFIG_PACKAGE_luci-app-firewall=y
......@@ -91,15 +74,6 @@ CONFIG_PACKAGE_openssh-moduli=y
CONFIG_PACKAGE_openssh-server=y
CONFIG_PACKAGE_openssh-sftp-server=y
# Lighttpd packages
CONFIG_PACKAGE_lighttpd=y
CONFIG_PACKAGE_lighttpd-luci=y
CONFIG_PACKAGE_lighttpd-https-cert=y
CONFIG_PACKAGE_lighttpd-mod-fastcgi=y
CONFIG_PACKAGE_lighttpd-mod-openssl=y
CONFIG_PACKAGE_lighttpd-mod-proxy=y
CONFIG_PACKAGE_lighttpd-mod-redirect=y
# Wireless packages
CONFIG_PACKAGE_hostapd-common=y
CONFIG_PACKAGE_iw-full=y
......
CONFIG_TARGET_mvebu=y
CONFIG_TARGET_mvebu_cortexa53=y
CONFIG_TARGET_mvebu_cortexa53_DEVICE_cznic-mox=y
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-O2 -pipe -mcpu=cortex-a53"
CONFIG_TARGET_mvebu=y
CONFIG_TARGET_mvebu_cortexa9=y
CONFIG_TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia=y
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-O2 -pipe -mcpu=cortex-a9 -mfpu=vfpv3-d16"
CONFIG_CPU_TYPE="cortex-a9+vfpv3"
CONFIG_TARGET_mpc85xx=y
CONFIG_TARGET_mpc85xx_p2020=y
CONFIG_TARGET_mpc85xx_p2020_DEVICE_turris1x=y
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-O2 -pipe -mcpu=8540"
CONFIG_SOFT_FLOAT=y
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