diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 22:31:25 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 19:43:26 +0300 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-devtools/opkg | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.xz |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/opkg')
8 files changed, 308 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb new file mode 100644 index 000000000..ace3de4f4 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb @@ -0,0 +1,35 @@ +SUMMARY = "Architecture-dependent configuration for opkg" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +PACKAGE_ARCH = "${MACHINE_ARCH}" +PR = "r1" + +S = "${WORKDIR}" + +do_compile() { + mkdir -p ${S}/${sysconfdir}/opkg/ + + archconf=${S}/${sysconfdir}/opkg/arch.conf + + rm -f $archconf + ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}" + priority=1 + for arch in $ipkgarchs; do + echo "arch $arch $priority" >> $archconf + priority=$(expr $priority + 5) + done +} + + +do_install () { + install -d ${D}${sysconfdir}/opkg + install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/ +} + +FILES_${PN} = "${sysconfdir}/opkg/ " + +CONFFILES_${PN} += "${sysconfdir}/opkg/arch.conf" + +RREPLACES_${PN} = "opkg-config-base" +RCONFLICTS_${PN} = "opkg-config-base" +RPROVIDES_${PN} = "opkg-config-base" diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb new file mode 100644 index 000000000..18d6abdde --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb @@ -0,0 +1,48 @@ +SUMMARY = "Keyrings for verifying opkg packages and feeds" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +# Distro-specific keys can be added to this package in two ways: +# +# 1) In a .bbappend, add .gpg and/or .asc files to SRC_URI and install them to +# ${D}${datadir}/opkg/keyrings/ in a do_install_append function. These +# files should not be named 'key-$name.gpg' to ensure they don't conflict +# with keys exported as per (2). +# +# 2) In a .bbappend, distro config or local.conf, override the variable +# OPKG_KEYRING_KEYS to contain a space-separated list of key names. For +# each name, 'gpg --export $name' will be ran to export the public key to a +# file named 'key-$name.gpg'. The public key must therefore be in the gpg +# keyrings on the build machine. + +OPKG_KEYRING_KEYS ?= "" + +do_compile() { + for name in ${OPKG_KEYRING_KEYS}; do + gpg --export ${name} > ${B}/key-${name}.gpg + done +} + +do_install () { + install -d ${D}${datadir}/opkg/keyrings/ + for name in ${OPKG_KEYRING_KEYS}; do + install -m 0644 ${B}/key-${name}.gpg ${D}${datadir}/opkg/keyrings/ + done +} + +FILES_${PN} = "${datadir}/opkg/keyrings" + +# We need 'opkg-key' to run the postinst script +RDEPENDS_${PN} = "opkg" + +pkg_postinst_${PN} () { +#! /bin/sh +set -e + +if [ x"$D" = "x" ]; then + # On target + opkg-key populate +else + exit 1 +fi +} diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch new file mode 100644 index 000000000..e67ec7479 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch @@ -0,0 +1,36 @@ +From 2a43027f7ecf2bb3ce73f95bcf575c56bc495d07 Mon Sep 17 00:00:00 2001 +From: Alejandro del Castillo <alejandro.delcastillo@ni.com> +Date: Wed, 9 Dec 2015 17:38:05 -0600 +Subject: [PATCH] configure.ac: use pkg-config for libsolv + +Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> +--- + configure.ac | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 52e1025..d17dc5c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -159,17 +159,7 @@ if test "x$want_solver" != "xno"; then + AC_MSG_ERROR(Specify which solver with --enable-solver=<SOLVER>)], + [libsolv], + [AC_MSG_RESULT(libsolv) +- +- SOLVER_CFLAGS="-I/usr/local/include/" +- SOLVER_LIBS="-lsolv -lsolvext" +- AC_CHECK_LIB([solv], +- [solver_solve], +- [], +- [AC_MSG_ERROR(libsolv not found)]) +- dnl TODO: remove previous 6 lines and uncomment line below to use +- dnl pkg-config once there is a release of libsolv with pkg-config: +- dnl PKG_CHECK_MODULES(SOLVER, libsolv) +- ++ PKG_CHECK_MODULES(SOLVER, libsolv) + AC_DEFINE(HAVE_SOLVER_LIBSOLV,1,[Define if you want to use libsolv])], + # default + [AC_MSG_RESULT(no) +-- +1.9.1 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch new file mode 100644 index 000000000..1ab1790d6 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch @@ -0,0 +1,35 @@ +From 3e562bed7dced25eb3e9174ca9395324b6c873c1 Mon Sep 17 00:00:00 2001 +From: Alejandro del Castillo <alejandro.delcastillo@ni.com> +Date: Wed, 9 Dec 2015 13:36:14 -0600 +Subject: [PATCH] libsolv_solver_set_arch_policy: use correct logic during + archs resizing + +If there are more than INITIAL_ARCH_LIST_SIZE archs defined in the +configuration, libsolv_solver_set_arch_policy crashes due to flawed +logic when resizing the archs array. + +Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> +--- + libopkg/opkg_solver_libsolv.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libopkg/opkg_solver_libsolv.c b/libopkg/opkg_solver_libsolv.c +index 1cdcf1f..b5af0fa 100644 +--- a/libopkg/opkg_solver_libsolv.c ++++ b/libopkg/opkg_solver_libsolv.c +@@ -66,8 +66,10 @@ static void libsolv_solver_set_arch_policy(libsolv_solver_t *libsolv_solver) + nv_pair_list_elt_t *arch_info; + + list_for_each_entry(arch_info, &opkg_config->arch_list.head, node) { +- if (arch_count > arch_list_size) +- archs = xrealloc(archs, arch_list_size *= 2); ++ if (arch_count >= arch_list_size) { ++ arch_list_size *= 2; ++ archs = xrealloc(archs, arch_list_size * sizeof(arch_data_t)); ++ } + + archs[arch_count].arch = ((nv_pair_t *)(arch_info->data))->name; + archs[arch_count].priority = atoi(((nv_pair_t *) +-- +1.9.1 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch new file mode 100644 index 000000000..255021b4b --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch @@ -0,0 +1,34 @@ +From a4628a6171f393add9a2b287483ca39bb72b4dd6 Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Mon, 21 Sep 2015 20:23:23 +1000 +Subject: [PATCH] opkg_conf: create opkg.lock in /run instead of /var/run + +This avoids a "Could not unlink" warning when extracting a /var/run +symbolic link pointing to /run from a package as it is unable to +unlink the /var/run directory when it contains opkg.lock. + +This also fixes an issue where /var/run is created as a directory +instead of a symbolic link to /run. + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Jonathan Liu <net147@gmail.com> +--- + libopkg/opkg_conf.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h +index 7bca948..5a1bc44 100644 +--- a/libopkg/opkg_conf.h ++++ b/libopkg/opkg_conf.h +@@ -40,7 +40,7 @@ extern "C" { + #define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status" + #define OPKG_CONF_DEFAULT_CACHE_DIR "/var/cache/opkg" + #define OPKG_CONF_DEFAULT_CONF_FILE_DIR "/etc/opkg" +-#define OPKG_CONF_DEFAULT_LOCK_FILE "/var/run/opkg.lock" ++#define OPKG_CONF_DEFAULT_LOCK_FILE "/run/opkg.lock" + + /* In case the config file defines no dest */ + #define OPKG_CONF_DEFAULT_DEST_NAME "root" +-- +2.5.0 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service new file mode 100644 index 000000000..8e74026ec --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service @@ -0,0 +1,17 @@ +[Unit] +Description=Opkg first boot configure +DefaultDependencies=no +After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount +Before=sysinit.target + +[Service] +Type=oneshot +EnvironmentFile=-@SYSCONFDIR@/default/postinst +ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi" +ExecStartPost=@BASE_BINDIR@/systemctl disable opkg-configure.service +StandardOutput=syslog +RemainAfterExit=No + +[Install] +WantedBy=basic.target +WantedBy=sysinit.target diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf new file mode 100644 index 000000000..c2e9e92f9 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf @@ -0,0 +1,28 @@ +# Must have one or more source entries of the form: +# +# src <src-name> <source-url> +# +# and one or more destination entries of the form: +# +# dest <dest-name> <target-path> +# +# where <src-name> and <dest-names> are identifiers that +# should match [a-zA-Z0-9._-]+, <source-url> should be a +# URL that points to a directory containing a Familiar +# Packages file, and <target-path> should be a directory +# that exists on the target system. + +# Proxy Support +#option http_proxy http://proxy.tld:3128 +#option ftp_proxy http://proxy.tld:3128 +#option proxy_username <username> +#option proxy_password <password> + +# Enable GPGME signature +# option check_signature 1 + +# Offline mode (for use in constructing flash images offline) +#option offline_root target + +# Default destination for installed packages +dest root / diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb new file mode 100644 index 000000000..577f49534 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb @@ -0,0 +1,75 @@ +SUMMARY = "Open Package Manager" +SUMMARY_libopkg = "Open Package Manager library" +SECTION = "base" +HOMEPAGE = "http://code.google.com/p/opkg/" +BUGTRACKER = "http://code.google.com/p/opkg/issues/list" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://src/opkg.c;beginline=2;endline=21;md5=90435a519c6ea69ef22e4a88bcc52fa0" + +DEPENDS = "libarchive" + +PE = "1" + +SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \ + file://opkg-configure.service \ + file://opkg.conf \ + file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \ + file://0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch \ + file://0001-configure.ac-use-pkg-config-for-libsolv.patch \ +" + +SRC_URI[md5sum] = "43735e5dc1ebf46bd6ce56a7cdfdc720" +SRC_URI[sha256sum] = "d2c6c02a8384ec21168a1f0a186cb5e9f577d1452f491d02ed3e56b2ea8b87df" + +inherit autotools pkgconfig systemd + +SYSTEMD_SERVICE_${PN} = "opkg-configure.service" + +target_localstatedir := "${localstatedir}" +OPKGLIBDIR = "${target_localstatedir}/lib" + +PACKAGECONFIG ??= "" + +PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,gpgme libgpg-error,gnupg" +PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl" +PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl" +PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" +PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256" +PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder" +PACKAGECONFIG[libsolv] = "--enable-solver=libsolv,--disable-solver,libsolv" + +do_install_append () { + install -d ${D}${sysconfdir}/opkg + install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf + echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf + + # We need to create the lock directory + install -d ${D}${OPKGLIBDIR}/opkg + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/ + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + -e 's,@BINDIR@,${bindir},g' \ + -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \ + ${D}${systemd_unitdir}/system/opkg-configure.service + fi +} + +RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config run-postinsts libarchive" +RDEPENDS_${PN}_class-native = "" +RDEPENDS_${PN}_class-nativesdk = "" +RREPLACES_${PN} = "opkg-nogpg opkg-collateral" +RCONFLICTS_${PN} = "opkg-collateral" +RPROVIDES_${PN} = "opkg-collateral" + +PACKAGES =+ "libopkg" + +FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/" +FILES_${PN} += "${systemd_unitdir}/system/" + +BBCLASSEXTEND = "native nativesdk" + +CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf" |