scripts: sync-fragment.sh: support nested

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I37605b2c65c0908aeda20e8a5551c2e630a49732
This commit is contained in:
Joseph Chen 2020-07-10 10:38:47 +08:00
parent 1df865f3f3
commit d07fced289
1 changed files with 8 additions and 6 deletions

View File

@ -25,23 +25,25 @@ if [ ! -f .config ]; then
exit 1
fi
BASE_DEFCONFIG=`sed -n "/CONFIG_BASE_DEFCONFIG=/s/CONFIG_BASE_DEFCONFIG=//p" .config | tr -d '\r' | tr -d '"'`
if [ -z "${BASE_DEFCONFIG}" ]; then
echo "ERROR: No base defconfig assigned by BASE_DEFCONFIG=..."
BASE_DEFCONFIG1=`sed -n "/CONFIG_BASE_DEFCONFIG=/s/CONFIG_BASE_DEFCONFIG=//p" .config | tr -d '\r' | tr -d '"'`
if [ -z "${BASE_DEFCONFIG1}" ]; then
echo "ERROR: No base defconfig assigned by BASE_DEFCONFIG1=..."
exit 1
fi
if [ ! -f configs/${BASE_DEFCONFIG} ]; then
echo "ERROR: No base defconfig \"${BASE_DEFCONFIG}\""
if [ ! -f configs/${BASE_DEFCONFIG1} ]; then
echo "ERROR: No base defconfig \"${BASE_DEFCONFIG1}\""
exit 1
fi
BASE_DEFCONFIG0=`sed -n "/CONFIG_BASE_DEFCONFIG=/s/CONFIG_BASE_DEFCONFIG=//p" configs/${BASE_DEFCONFIG1} | tr -d '\r' | tr -d '"'`
if [ ! -f ${FRAGMENT_CONFIG} ]; then
MSG_NEW_FILE="New config fragment: ${FRAGMENT_CONFIG}"
fi
cp .config fragment.config
make ${BASE_DEFCONFIG}
make ${BASE_DEFCONFIG0} ${BASE_DEFCONFIG1}
./scripts/diffconfig -m .config fragment.config | sort > ${FRAGMENT_CONFIG}
cp fragment.config .config