Patchwork [1/1,RFC] package-index-{ipk, rpm, deb}.bb: add the package-index for rpm and deb

login
register
mail settings
Submitter Dexuan Cui
Date May 12, 2011, 10:49 a.m.
Message ID <2dc5ca45f0335b704e853e222d8faf7d62f07e42.1305196874.git.dexuan.cui@intel.com>
Download mbox | patch
Permalink /patch/3779/
State New, archived
Headers show

Comments

Dexuan Cui - May 12, 2011, 10:49 a.m.
From: Dexuan Cui <dexuan.cui@intel.com>

[YOCTO #1024]

The commit renamed package-index.bb to package-index.inc and added
3 bb files for ipk, rpm and deb.

-------------------------------

How to generate and use repo:

RPM:
    1) run "bitbake package-index-rpm" after building some target;
    2) export the ${DEPLOY_DIR_RPM} by a webserver on the host (let's assume
the IP is 192.168.7.1) at http://192.168.7.1/rpm;
    3) inside the target, run "zypper addrepo http://192.168.7.1/rpm main; zypper refresh"
to retrieve info about the repo; next, we can use zypper install/remove to
manage packages.

IPK:
    1) run "bitbake package-index-ipk" after building some target;
    2) export the ${DEPLOY_DIR_IPK} by a webserver on the host (let's assume
the IP is 192.168.7.1) at http://192.168.7.1/ipk;
    3) inside the target, add the repo info into opkg config file, i.e.,
in /etc/opkg/arch.conf, we can add something like
src i586 http://192.168.7.1/ipk/i586, and next we run "opkg update" to make
opkg update the list of available packages, and next, we can use
opkg install/remove to manage packages.

DEB: To be added.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/recipes-core/meta/package-index-deb.bb        |   10 ++++++++++
 meta/recipes-core/meta/package-index-ipk.bb        |   11 +++++++++++
 meta/recipes-core/meta/package-index-rpm.bb        |   10 ++++++++++
 .../meta/{package-index.bb => package-index.inc}   |    8 --------
 4 files changed, 31 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-core/meta/package-index-deb.bb
 create mode 100644 meta/recipes-core/meta/package-index-ipk.bb
 create mode 100644 meta/recipes-core/meta/package-index-rpm.bb
 rename meta/recipes-core/meta/{package-index.bb => package-index.inc} (69%)

Patch

diff --git a/meta/recipes-core/meta/package-index-deb.bb b/meta/recipes-core/meta/package-index-deb.bb
new file mode 100644
index 0000000..db52e2a
--- /dev/null
+++ b/meta/recipes-core/meta/package-index-deb.bb
@@ -0,0 +1,10 @@ 
+require package-index.inc
+
+do_package_index[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
+
+do_package_index() {
+    set -ex
+    package_update_index_deb
+    set +ex
+}
+
diff --git a/meta/recipes-core/meta/package-index-ipk.bb b/meta/recipes-core/meta/package-index-ipk.bb
new file mode 100644
index 0000000..5eddea1
--- /dev/null
+++ b/meta/recipes-core/meta/package-index-ipk.bb
@@ -0,0 +1,11 @@ 
+require package-index.inc
+
+do_package_index[depends] += "opkg-utils-native:do_populate_sysroot"
+do_package_index[depends] += "opkg-native:do_populate_sysroot"
+
+do_package_index() {
+    set -ex
+    package_update_index_ipk
+    set +ex
+}
+
diff --git a/meta/recipes-core/meta/package-index-rpm.bb b/meta/recipes-core/meta/package-index-rpm.bb
new file mode 100644
index 0000000..605a638
--- /dev/null
+++ b/meta/recipes-core/meta/package-index-rpm.bb
@@ -0,0 +1,10 @@ 
+require package-index.inc
+
+do_package_index[depends] += "createrepo-native:do_populate_sysroot"
+
+do_package_index() {
+    set -ex
+    createrepo "${DEPLOY_DIR_RPM}"
+    set +ex
+}
+
diff --git a/meta/recipes-core/meta/package-index.bb b/meta/recipes-core/meta/package-index.inc
similarity index 69%
rename from meta/recipes-core/meta/package-index.bb
rename to meta/recipes-core/meta/package-index.inc
index 3c642cb..3f1caea 100644
--- a/meta/recipes-core/meta/package-index.bb
+++ b/meta/recipes-core/meta/package-index.inc
@@ -19,14 +19,6 @@  do_package_write_deb[noexec] = "1"
 do_populate_sysroot[noexec] = "1"
 
 do_package_index[nostamp] = "1"
-do_package_index[dirs] = "${DEPLOY_DIR_IPK}"
-do_package_index[depends] += "opkg-utils-native:do_populate_sysroot"
-do_package_index[depends] += "opkg-native:do_populate_sysroot"
 
-do_package_index() {
-	set -ex
-	package_update_index_ipk
-	set +ex
-}
 addtask do_package_index before do_build
 EXCLUDE_FROM_WORLD = "1"