Modify

Opened 7 years ago

Closed 6 years ago

Last modified 4 years ago

#8589 closed enhancement (obsolete)

[PATCH] Backfire: Embedd SVN revision text into /etc/openwrt_release so that Luci picks it up

Reported by: hnyman Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: base system Version: Backfire 10.03.1 RC4
Keywords: Backfire Version Luci Cc:

Description

A compiled Backfire contains version information in /etc/banner and /etc/openwrt_release.

I noticed that the /etc/banner file that gets shown in terminal sessions, has the SVN version number. But the string shown in upper right corner of Luci config screens in the self-built Openwrt builds does not show the exact version info and the SVN revision is hard to see anywhere in Luci. (Which is a regression compared to 10.03.1-rc4, where the SVN revision is explicitly shown in the similar place.)

I browsed the Luci source and found out that it pulls the string from /etc/openwrt_release file, which was added to Backfire 9 months ago.

The Makefile for the base-files package already contains a SED command to place the correct SVN revision to /etc/banner, so I added a second command to add it also for /etc/openwrt_release (to which I also added a similar replacement seed string as in /etc/banner).

Additionally, I modified the 'getver.sh' so that it does not show the last check-in revision to Backfire branch itself, instead it shows the last SVN revision globally, which better reflects also the changes to packages, feeds etc.

My Luci screens now show like this in the upper right corner:

OpenWrt Backfire 10.03.SVN (r24714)
Load: 0.05 0.10 0.04
Hostname: OpenWrt


Changes done:

perus@HNVB:/Openwrt$ svn diff backfire/
Index: backfire/scripts/getver.sh
===================================================================
--- backfire/scripts/getver.sh	(revision 24919)
+++ backfire/scripts/getver.sh	(working copy)
@@ -11,7 +11,7 @@
 
 try_svn() {
 	[ -d .svn ] || return 1
-	REV="$(svn info | awk '/^Last Changed Rev:/ { print $4 }')"
+	REV="$(svn info | awk '/^Revision:/ { print $2 }')"
 	REV="${REV:+r$REV}"
 	[ -n "$REV" ]
 }
Index: backfire/package/base-files/files/etc/openwrt_release
===================================================================
--- backfire/package/base-files/files/etc/openwrt_release	(revision 24919)
+++ backfire/package/base-files/files/etc/openwrt_release	(working copy)
@@ -1,4 +1,4 @@
 DISTRIB_ID="OpenWrt"
 DISTRIB_RELEASE="10.03"
 DISTRIB_CODENAME="backfire"
-DISTRIB_DESCRIPTION="OpenWrt Backfire 10.03"
+DISTRIB_DESCRIPTION="OpenWrt Backfire 10.03.SVN ($R)"
Index: backfire/package/base-files/Makefile
===================================================================
--- backfire/package/base-files/Makefile	(revision 24919)
+++ backfire/package/base-files/Makefile	(working copy)
@@ -364,6 +364,7 @@
 		$(SED) 's/$$$$/:13848:0:99999:7:::/' $(1)/etc/shadow \
 	)
 	$(SED) 's,$$$$R,$(REVISION),g' $(1)/etc/banner
+	$(SED) 's,$$$$R,$(REVISION),g' $(1)/etc/openwrt_release
 	mkdir -p $(1)/CONTROL
 	mkdir -p $(1)/dev
 	mkdir -p $(1)/etc/crontabs

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by hnyman <hannu.nyman@…>

Probably obsolete (especially regarding /etc/openwrt_release) after r31263.

comment:2 Changed 6 years ago by jow

  • Resolution set to obsolete
  • Status changed from new to closed

comment:3 Changed 4 years ago by jow

  • Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)

Milestone Backfire 10.03.2 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.