[oe-commits] Koen Kooi : angstrom-version: add lsb_release script

git version control git at git.openembedded.org
Fri Jun 18 13:46:21 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 3981cd6da91e02a51717456565026576fbc1b2cb
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=3981cd6da91e02a51717456565026576fbc1b2cb

Author: Koen Kooi <koen at openembedded.org>
Date:   Fri Jun 18 15:44:32 2010 +0200

angstrom-version: add lsb_release script

---

 recipes/angstrom/angstrom-version.bb          |    7 +++-
 recipes/angstrom/angstrom-version/lsb_release |   43 +++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/recipes/angstrom/angstrom-version.bb b/recipes/angstrom/angstrom-version.bb
index 1728c0d..a2f1335 100644
--- a/recipes/angstrom/angstrom-version.bb
+++ b/recipes/angstrom/angstrom-version.bb
@@ -1,9 +1,11 @@
 LICENSE = "MIT"
 
 PV = "${DISTRO_VERSION}"
-PR = "r3"
+PR = "r4"
 PE = "1"
 
+SRC_URI = "file://lsb_release"
+
 PACKAGES = "${PN}"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
@@ -17,4 +19,7 @@ do_install() {
 	echo "Built from branch: ${METADATA_BRANCH}" >> ${D}${sysconfdir}/angstrom-version
 	echo "Revision: ${METADATA_REVISION}" >> ${D}${sysconfdir}/angstrom-version
 	echo "Target system: ${TARGET_SYS}" >> ${D}${sysconfdir}/angstrom-version
+	
+	install -d ${D}${bindir}
+	install -m 0755 ${WORKDIR}/lsb_release ${D}${bindir}/
 }
diff --git a/recipes/angstrom/angstrom-version/lsb_release b/recipes/angstrom/angstrom-version/lsb_release
new file mode 100755
index 0000000..11b4814
--- /dev/null
+++ b/recipes/angstrom/angstrom-version/lsb_release
@@ -0,0 +1,43 @@
+#!/bin/sh
+VERSION="$(cat /etc/angstrom-version | head -n1 | awk '{print $2}')"
+CODENAME="foo"
+
+case $1 in
+"-v")
+	echo "No LSB modules are available."
+	;;
+"-i")
+	echo "Distributor ID: Angstrom"
+	;;
+"-d")
+	echo "Description:    Angstrom GNU/Linux $VERSION ($CODENAME)"
+	;;
+"-r")
+	echo "Release:        $VERSION"
+	;;
+"-c")
+	echo "Codename:       $CODENAME"
+	;;
+"-a")
+	echo "Distributor ID: Angstrom"
+	echo "Description:    Angstrom GNU/Linux $VERSION ($CODENAME)"
+	echo "Release:        $VERSION" 
+	echo "Codename:       $CODENAME"
+	;;
+"-s")
+	echo "No LSB modules are available."
+	;;
+*)
+	echo "Usage: lsb_release [options]"
+	echo ""
+	echo "Options:"
+	echo "  -h, --help         show this help message and exit"
+	echo "  -v, --version      show LSB modules this system supports"
+	echo "  -i, --id           show distributor ID"
+	echo "  -d, --description  show description of this distribution"
+	echo "  -r, --release      show release number of this distribution"
+	echo "  -c, --codename     show code name of this distribution"
+	echo "  -a, --all          show all of the above information"
+	echo "  -s, --short        show requested information in short format"
+;;
+esac





More information about the Openembedded-commits mailing list