#!/bin/sh set -e umask 0022 unset GREP_OPTIONS SED _get_repo() { git clone "$2" "$1" 2>/dev/null || true git -C "$1" remote set-url origin "$2" git -C "$1" fetch origin git -C "$1" fetch origin --tags git -C "$1" checkout "origin/$3" -B "build" || git -C "$1" checkout "$3" -B "build" } OMR_DIST=${OMR_DIST:-omr} OMR_HOST=${OMR_HOST:-$(curl -sS ifconfig.co)} OMR_PORT=${OMR_PORT:-8000} OMR_REPO=${OMR_REPO:-http://$OMR_HOST:$OMR_PORT/$OMR_PATH} OMR_TARGET=${OMR_TARGET:-x86_64} OMR_TARGET_CONFIG="config-$OMR_TARGET" OMR_FEED_URL="${OMR_FEED_URL:-https://github.com/ysurac/openmptcprouter-feeds}" OMR_FEED_SRC="${OMR_FEED_SRC:-master}" if [ ! -f "$OMR_TARGET_CONFIG" ]; then echo "Target $OMR_TARGET not found !" exit 1 fi #_get_repo source https://github.com/ysurac/openmptcprouter-source "master" _get_repo source https://github.com/openwrt/openwrt "lede-17.01" _get_repo feeds/packages https://github.com/openwrt/packages "master" _get_repo feeds/luci https://github.com/openwrt/luci "lede-17.01" if [ -z "$OMR_FEED" ]; then OMR_FEED=feeds/openmptcprouter _get_repo "$OMR_FEED" "$OMR_FEED_URL" "$OMR_FEED_SRC" fi if [ -n "$1" ] && [ -f "$OMR_FEED/$1/Makefile" ]; then OMR_DIST=$1 shift 1 fi rm -rf source/bin source/files source/tmp cp -rf root/* source cat >> source/package/base-files/files/etc/banner < source/feeds.conf < source/.config <