#!/bin/bash

# Run this within the unpacked Kernel source (use do-src-update n)
cp .config .config-pre-frag-merge

[ ! -f $1 ] && { echo "Error: where's the fragment file?" ; exit 1;}

echo "Merging configurations ..."
scripts/kconfig/merge_config.sh .config $1

#read -p "Press ENTER to continue and resolve new dependencies"
make ARCH=arm64 olddefconfig

#read -p "Press ENTER to provide a diff"
diff -u .config-pre-frag-merge .config > config.diff
less config.diff

echo "Now copy '.config' back into the src tree"
