[LEDE-DEV] [PATCH 2/2] Add script to build common platforms.
John Crispin
john at phrozen.org
Wed Jun 1 11:07:07 PDT 2016
Hi Ben,
also inclined to reject this one. it will open up the pandoras box and
we will end up maintaining piles of diffconfig files. it would make
morse sense to document what the script does inside web.git as a "how to
build" or "getting started" page
John
On 27/05/2016 01:57, greearb at candelatech.com wrote:
> From: Ben Greear <greearb at candelatech.com>
>
> The idea is to be able to allow newbies to easily build images
> for common hardware. These images should be user-friendly, including
> luci and other tools that may aid debugging and use of the platform.
>
> Signed-off-by: Ben Greear <greearb at candelatech.com>
> ---
> buildme.sh | 76 +++++++++++++++++++++++++++++++++++
> buildme_targets/x86_64/diffconfig.txt | 26 ++++++++++++
> 2 files changed, 102 insertions(+)
> create mode 100755 buildme.sh
> create mode 100644 buildme_targets/x86_64/diffconfig.txt
>
> diff --git a/buildme.sh b/buildme.sh
> new file mode 100755
> index 0000000..83644fa
> --- /dev/null
> +++ b/buildme.sh
> @@ -0,0 +1,76 @@
> +#!/usr/bin/env bash
> +
> +USAGE=$( cat <<EOF
> +Usage:\n
> +# -t: Target\n
> +# -l: List available targets.\n
> +# -f: Skip feeds (useful on rebuild)\n
> +# -j: Compile jobs (default is 8)\n
> +# -h: Show help and exit\n
> +#\n
> +#\n
> +# Example: Build an image for x86_64
> +# ./buildme.sh -t x86_64\n
> +EOF
> +)
> +
> +BMT=buildme_targets
> +TARGET=UNKNOWN
> +LIST_TARGETS=0
> +SKIP_FEEDS=0
> +JOBS=8
> +
> +while getopts "t:j:lfh" flag
> + do
> + case $flag in
> + t) TARGET=$OPTARG;;
> + l) LIST_TARGETS=1;;
> + f) SKIP_FEEDS=1;;
> + j) JOBS=$OPTARG;;
> + h) echo -e USAGE && exit 0;;
> +
> + *) echo "Un-known option: $flag"; echo -e $USAGE;exit 1;;
> + esac
> +done
> +
> +if [ $LIST_TARGETS == 1 ]
> +then
> + ls $BMT
> + exit 0
> +fi
> +
> +echo "Target dir: $BMT/$TARGET"
> +
> +if [ ! -d $BMT/$TARGET ]
> +then
> + echo "ERROR: Unknown target, try -l option?"
> + exit 1;
> +fi
> +
> +set -x
> +
> +if [ $SKIP_FEEDS != 1 ]
> +then
> + # Update feeds
> + ./scripts/feeds update -a || exit 1
> +
> + # Enable luci web interface
> + ./scripts/feeds install -d y luci || exit 1
> +
> + # Enable ethtool for driver info and stats and such
> + ./scripts/feeds install -d y ethtool || exit 1
> +fi
> +
> +# Copy default config into place
> +cp $BMT/$TARGET/diffconfig.txt .config || exit 1
> +
> +# Build complate .config file based on whatever is latest, etc.
> +make defconfig || exit 1
> +
> +# Build
> +make v=S -j $JOBS || exit 1
> +
> +# Try to figure out where the images are at.
> +set +x
> +. .config > /dev/null 2>&1
> +echo "Images may be found at: bin/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/"
> diff --git a/buildme_targets/x86_64/diffconfig.txt b/buildme_targets/x86_64/diffconfig.txt
> new file mode 100644
> index 0000000..d3db402
> --- /dev/null
> +++ b/buildme_targets/x86_64/diffconfig.txt
> @@ -0,0 +1,26 @@
> +CONFIG_TARGET_x86=y
> +CONFIG_TARGET_x86_64=y
> +CONFIG_TARGET_x86_64_Generic=y
> +CONFIG_ALL_NONSHARED=y
> +CONFIG_BUSYBOX_CUSTOM=y
> +CONFIG_BUSYBOX_CONFIG_ARP=y
> +CONFIG_BUSYBOX_CONFIG_FEATURE_TELNET_AUTOLOGIN=y
> +CONFIG_BUSYBOX_CONFIG_FEATURE_TELNET_TTYPE=y
> +CONFIG_BUSYBOX_CONFIG_LSPCI=y
> +CONFIG_BUSYBOX_CONFIG_LSUSB=y
> +CONFIG_BUSYBOX_CONFIG_MORE=y
> +CONFIG_BUSYBOX_CONFIG_TELNET=y
> +CONFIG_IMAGEOPT=y
> +CONFIG_PACKAGE_hostapd-common-old=y
> +CONFIG_PACKAGE_hostapd-utils=y
> +CONFIG_PACKAGE_kmod-hwmon-core=y
> +CONFIG_PACKAGE_kmod-i2c-algo-bit=y
> +CONFIG_PACKAGE_kmod-i2c-core=y
> +CONFIG_PACKAGE_kmod-igb=y
> +CONFIG_PACKAGE_kmod-libphy=y
> +CONFIG_PACKAGE_kmod-skge=y
> +CONFIG_PACKAGE_kmod-sky2=y
> +CONFIG_PACKAGE_kmod-tg3=y
> +# CONFIG_PER_FEED_REPO is not set
> +CONFIG_TARGET_KERNEL_PARTSIZE=64
> +CONFIG_TARGET_ROOTFS_PARTSIZE=1024
>
More information about the Lede-dev
mailing list