Переглянути джерело

swupdate: Split common parts into separate include

Split the swupdate_git.bb recipe into common include-file that can be used
to create swupdate recipes that are locked to a certain release without
duplicating recipe content.

The initscript bits are not part of the common include file since it is not
always desired to install an initscript (i.e when swupdate is not build to
go into background / no webserver).

Signed-off-by: Magnus Olsson <magnus@minimum.se>
Magnus Olsson 10 роки тому
батько
коміт
f328fa8f99

+ 41 - 0
recipes-support/swupdate/swupdate.inc

@@ -0,0 +1,41 @@
+SUMMARY="Image updater for Yocto projects"
+DESCRIPTION = "Application for automatic software update from USB Pen"
+SECTION="swupdate"
+DEPENDS = "mtd-utils libconfig openssl lua curl"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+inherit cml1
+
+SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=git \
+     file://defconfig \
+     "
+
+PACKAGES =+ "${PN}-www"
+
+FILES_${PN}-www = "/www/*"
+FILES_${PN} = "${bindir}/* /etc/init.d"
+CONFFILES_${PN} += "${sysconfdir}/init.d/recovery"
+
+S = "${WORKDIR}/git/"
+
+EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
+
+do_configure () {
+  cp ${WORKDIR}/defconfig ${S}/.config
+  cml1_do_configure
+}
+
+do_install () {
+  install -d ${D}${bindir}/
+  install -m 0755 swupdate ${D}${bindir}/
+
+  install -m 0755 -d ${D}/www
+  install -m 0755 ${S}www/* ${D}/www
+}
+
+do_compile() {
+  unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+  oe_runmake swupdate_unstripped
+  cp swupdate_unstripped swupdate
+}

+ 6 - 44
recipes-support/swupdate/swupdate_git.bb

@@ -1,52 +1,14 @@
-SUMMARY="Image updater for Yocto projects"
-DESCRIPTION = "Application for automatic software update from USB Pen"
-SECTION="swupdate"
-DEPENDS = "mtd-utils libconfig openssl lua curl"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
-
-PR = "r0"
-
-inherit cml1 update-rc.d
+require swupdate.inc
 
+inherit update-rc.d
 
 SRCREV = "${AUTOREV}"
-SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=git \
-	   file://defconfig \
-	   file://swupdate \
-	   "
-
-PACKAGES =+ "${PN}-www"
-
-FILES_${PN}-www = "/www/*"
-FILES_${PN} = "${bindir}/* /etc/init.d"
-CONFFILES_${PN} += "${sysconfdir}/init.d/recovery"
-
-S = "${WORKDIR}/git/"
-
-EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
 
-do_configure () {
-	cp ${WORKDIR}/defconfig ${S}/.config
-	cml1_do_configure
-}
-
-do_install () {
-	install -d ${D}${bindir}/
-	install -m 0755 swupdate ${D}${bindir}/
-
-	install -m 0755 -d ${D}/www
-	install -m 0755 ${S}www/* ${D}/www
-
-	install -d ${D}${sysconfdir}/init.d
-	install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
-
-}
+SRC_URI += "file://swupdate"
 
-do_compile() {
-	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-	oe_runmake swupdate_unstripped
-	cp swupdate_unstripped swupdate
+do_install_append() {
+  install -d ${D}${sysconfdir}/init.d
+  install -m 755 ${WORKDIR}/swupdate ${D}${sysconfdir}/init.d
 }
 
 INITSCRIPT_NAME = "swupdate"