iopsys-feed/iop/scripts/feeds_update.sh
Andreas Gnau e26a9affbd iop: feeds_update: Workaround OpenWrt bug wrt targets
Workaround a bug in the OpenWrt build system that was introduced when
the installed target path had been moved to target/linux/feeds.
Config.in and Makefile from installed targets are not properly included
from the new location. This hack is to be removed once the issues are
fixed.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2022-07-01 08:48:32 +02:00

66 lines
1.7 KiB
Bash
Executable file

#! /bin/bash
function feeds_update {
developer=0
override=1
start=$(date -u +'%s')
while getopts "n" opt; do
case $opt in
n)
override=0
;;
esac
done
git remote -v | grep -qE '(git@|ssh://)' && developer=1
cp .config .genconfig_config_bak
#if -d argument is passed, clone feeds with ssh instead of http
if [ $developer == 1 ]; then
./scripts/feeds update -g
else
./scripts/feeds update
fi
./scripts/feeds update -ai
# replace core packages with iopsys versions
if [ $override == 1 ]; then
./scripts/feeds install -f -p openwrt_core -a
fi
# targets need to be installed explicitly
for target in $(ls ./feeds/targets); do
rm -f target/linux/$target
./scripts/feeds install -p targets $target
done
# Workaround for bug in 22.03.0-rc4 where installed target path has been
# moved to target/linux/feeds but Config.in and Makefile from installed
# targets are not properly included from the new location.
# This hack is to be removed once the issues are fixed.
# Note that the above block of code might no longer necessary because
# targets no longer need to be installed explicitly.
echo "Working around installed-target-bug"
for f in target/linux/feeds/*; do
ln -vsf "feeds/$(basename "$f")" "target/linux/$(basename "$f")"
done
# install all packages
./scripts/feeds install -a
# remove broken symlinks ( for packages that are no longer in the feed )
find -L package/feeds -maxdepth 2 -type l -delete
cp .genconfig_config_bak .config
make defconfig
# record when we last run this script
touch tmp/.iop_bootstrap
# always return true
exit 0
}
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"