[LEDE-DEV] [PATCH-v2 2/2] Add script to build common platforms.

greearb at candelatech.com greearb at candelatech.com
Fri May 27 11:14:17 PDT 2016


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.

Includes example that builds x86-64 with additional drivers and luci
so that it works nicely on apu2 and other generic hardware.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 buildme.sh                            | 76 +++++++++++++++++++++++++++++++++++
 buildme_targets/x86_64/diffconfig.txt | 50 +++++++++++++++++++++++
 2 files changed, 126 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..923b35e
--- /dev/null
+++ b/buildme_targets/x86_64/diffconfig.txt
@@ -0,0 +1,50 @@
+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_ETHTOOL_PRETTY_DUMP=y
+CONFIG_IMAGEOPT=y
+CONFIG_PACKAGE_hostapd-common-old=y
+CONFIG_PACKAGE_hostapd-utils=y
+CONFIG_PACKAGE_kmod-hwmon-core=y
+CONFIG_PACKAGE_iperf=y
+CONFIG_PACKAGE_kmod-ath5k=m
+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_PACKAGE_libiwinfo=y
+CONFIG_PACKAGE_libiwinfo-lua=y
+CONFIG_PACKAGE_liblua=y
+CONFIG_PACKAGE_libubus-lua=y
+CONFIG_PACKAGE_libuci-lua=y
+CONFIG_PACKAGE_lua=y
+CONFIG_PACKAGE_luci=y
+CONFIG_PACKAGE_luci-app-firewall=y
+CONFIG_PACKAGE_luci-base=y
+CONFIG_PACKAGE_luci-lib-ip=y
+CONFIG_PACKAGE_luci-lib-jsonc=y
+CONFIG_PACKAGE_luci-lib-nixio=y
+CONFIG_PACKAGE_luci-mod-admin-full=y
+CONFIG_PACKAGE_luci-proto-ipv6=y
+CONFIG_PACKAGE_luci-proto-ppp=y
+CONFIG_PACKAGE_luci-theme-bootstrap=y
+CONFIG_PACKAGE_rpcd=y
+CONFIG_PACKAGE_uclibcxx=y
+CONFIG_PACKAGE_uhttpd=y
+CONFIG_PACKAGE_uhttpd-mod-ubus=y
+CONFIG_PACKAGE_zlib=y
+# CONFIG_PER_FEED_REPO is not set
+CONFIG_TARGET_KERNEL_PARTSIZE=64
+CONFIG_TARGET_ROOTFS_PARTSIZE=1024
-- 
2.4.3




More information about the Lede-dev mailing list