Skip to content

Commit e0e1ca3

Browse files
author
Abhijit A. Mahajani
committed
Merge pull request #41 from mayank-sirotiya-imgtec/master_version
add build version details in openwrt image
2 parents 4b6b4e4 + 36c8148 commit e0e1ca3

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ openwrt/.config: openwrt/feeds.conf
2020
cat creator-kit.config > ../dist/openwrt/.config
2121
$(MAKE) -C ../dist/openwrt defconfig
2222

23+
openwrt/version:
24+
./getver.sh ../dist/openwrt > ../dist/openwrt/version
25+
2326
.PHONY: build_openwrt
24-
build_openwrt: openwrt/.config
27+
build_openwrt: openwrt/.config openwrt/version
2528
if test $(findstring J=,$(MAKEFLAGS)); then \
2629
$(MAKE) $(SUBMAKEFLAGS) -C ../dist/openwrt -j$(J); \
2730
else \

creator-kit.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ CONFIG_TARGET_pistachio_marduk_marduk_cc2520=y
44
CONFIG_PACKAGE_button-gateway=y
55
CONFIG_PACKAGE_device-manager=y
66
CONFIG_PACKAGE_webscripts=y
7+
CONFIG_IMAGEOPT=y
8+
CONFIG_VERSIONOPT=y
9+
CONFIG_VERSION_NUMBER="v0.9.0"

getver.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
export LANG=C
3+
export LC_ALL=C
4+
[ -n $1 ] && cd $1
5+
6+
try_git() {
7+
[ -e .git ] || return 1
8+
REV="$(git log | grep -m 1 commit | awk '{print substr ($2, 0, 7)}')"
9+
[ -n "$REV" ]
10+
}
11+
12+
try_git || REV="unknown"
13+
echo "$REV"

0 commit comments

Comments
 (0)