2017-01-18 16:21:43 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
[ "$LEDE_TARGET" ] || exit 1
|
|
|
|
|
2017-09-07 01:21:42 +00:00
|
|
|
target="$1"
|
|
|
|
packages=$2
|
|
|
|
|
2017-01-18 16:21:43 +00:00
|
|
|
|
|
|
|
output=
|
|
|
|
profile=
|
|
|
|
default_packages=
|
|
|
|
profile_packages=
|
|
|
|
|
|
|
|
|
|
|
|
LEDE_CONFIG_TARGET="${LEDE_TARGET//-/_}"
|
|
|
|
|
|
|
|
|
|
|
|
emit() {
|
|
|
|
[ "${output}" ] || return 0
|
|
|
|
want_device "${output}" || return 0
|
|
|
|
|
2017-01-19 17:00:46 +00:00
|
|
|
profile_packages="${profile_packages} $(site_packages "$output")"
|
|
|
|
|
2017-01-18 16:21:43 +00:00
|
|
|
for package in $profile_packages; do
|
|
|
|
[ "${package:0:1}" = '-' ] || echo "CONFIG_PACKAGE_${package}=m"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "CONFIG_TARGET_DEVICE_${LEDE_CONFIG_TARGET}_DEVICE_${profile}=y"
|
|
|
|
echo "CONFIG_TARGET_DEVICE_PACKAGES_${LEDE_CONFIG_TARGET}_DEVICE_${profile}=\"${profile_packages}\""
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-05-15 21:23:02 +00:00
|
|
|
. scripts/target_config.inc.sh
|
2017-01-18 16:21:43 +00:00
|
|
|
|
|
|
|
config() {
|
|
|
|
echo "$1"
|
|
|
|
}
|
|
|
|
|
2017-09-06 22:17:57 +00:00
|
|
|
try_config() {
|
|
|
|
echo "$1"
|
|
|
|
}
|
|
|
|
|
2017-01-18 16:21:43 +00:00
|
|
|
device() {
|
|
|
|
emit
|
|
|
|
|
|
|
|
output="$1"
|
|
|
|
profile="$3"
|
|
|
|
if [ -z "$profile" ]; then
|
|
|
|
profile="$2"
|
|
|
|
fi
|
|
|
|
|
2017-01-19 17:00:46 +00:00
|
|
|
profile_packages="${default_packages}"
|
2017-01-18 16:21:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
packages() {
|
|
|
|
if [ "${output}" ]; then
|
|
|
|
profile_packages="${profile_packages} $@"
|
|
|
|
else
|
|
|
|
default_packages="${default_packages} $@"
|
|
|
|
|
|
|
|
for package in "$@"; do
|
|
|
|
if [ "${package:0:1}" = '-' ]; then
|
2017-09-07 01:21:42 +00:00
|
|
|
echo "# CONFIG_PACKAGE_${package:1} is not set"
|
2017-01-18 16:21:43 +00:00
|
|
|
else
|
|
|
|
echo "CONFIG_PACKAGE_${package}=y"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# The sort will not only remove duplicate entries,
|
|
|
|
# but also magically make =y entries override =m ones
|
2017-09-07 01:21:42 +00:00
|
|
|
(
|
|
|
|
. targets/generic
|
|
|
|
packages $packages
|
|
|
|
|
|
|
|
. targets/"$target"
|
|
|
|
emit
|
|
|
|
) | sort -u
|