* [PATCH 06/33] debianutils: Allow native builds
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>
Apt has a runtime dependency on it.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
meta/recipes-support/debianutils/debianutils_4.8.bb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-support/debianutils/debianutils_4.8.bb b/meta/recipes-support/debianutils/debianutils_4.8.bb
index d969fd3..cf4f382 100644
--- a/meta/recipes-support/debianutils/debianutils_4.8.bb
+++ b/meta/recipes-support/debianutils/debianutils_4.8.bb
@@ -32,7 +32,7 @@ do_install_append() {
PACKAGES =+ "${PN}-run-parts"
FILES_${PN}-run-parts = "${base_bindir}/run-parts.debianutils"
-RDEPENDS_${PN} += "${PN}-run-parts"
+RDEPENDS_${PN}_class-target = "${PN}-run-parts"
ALTERNATIVE_PRIORITY="30"
@@ -46,3 +46,5 @@ ALTERNATIVE_LINK_NAME[run-parts]="${base_bindir}/run-parts"
ALTERNATIVE_LINK_NAME[savelog]="${bindir}/savelog"
ALTERNATIVE_LINK_NAME[tempfile]="${base_bindir}/tempfile"
ALTERNATIVE_LINK_NAME[which]="${bindir}/which"
+
+BBCLASSEXTEND = "native"
--
2.7.4
^ permalink raw reply related
* [PATCH 05/33] package_manager/deb: pass option --force-script-chrootless to dpkg
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>
Fixes removal of packages with new dpkg version.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
meta/lib/oe/package_manager.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 7ba2e4d..4ef4f6d 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -2090,7 +2090,7 @@ class DpkgPM(OpkgDpkgPM):
cmd = "%s purge %s" % (self.apt_get_cmd, ' '.join(pkgs))
else:
cmd = "%s --admindir=%s/var/lib/dpkg --instdir=%s" \
- " -P --force-depends %s" % \
+ " -P --force-depends --force-script-chrootless %s" % \
(bb.utils.which(os.getenv('PATH'), "dpkg"),
self.target_rootfs, self.target_rootfs, ' '.join(pkgs))
--
2.7.4
^ permalink raw reply related
* [PATCH 02/33] dpkg: update-alternatives-dpkg should conflict with other providers
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
meta/recipes-devtools/dpkg/dpkg.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index ec0117b..f7d9e77 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -63,6 +63,7 @@ do_install_append () {
PACKAGES =+ "update-alternatives-dpkg"
FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
RPROVIDES_update-alternatives-dpkg = "update-alternatives"
+RCONFLICTS_update-alternatives-dpkg = "update-alternatives"
PACKAGES += "${PN}-perl"
FILES_${PN}-perl = "${libdir}/perl"
--
2.7.4
^ permalink raw reply related
* [PATCH 01/33] dpkg: implement offline mode for update-alternatives
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
meta/recipes-devtools/dpkg/dpkg.inc | 12 +-
...tinsts-expect-D-to-be-set-when-running-in.patch | 70 ----
...pdate-alternatives-Implement-offline-mode.patch | 399 +++++++++++++++++++++
meta/recipes-devtools/dpkg/dpkg_1.18.7.bb | 2 +-
4 files changed, 403 insertions(+), 80 deletions(-)
delete mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
create mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index e8d8a9b..ec0117b 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -1,9 +1,10 @@
SUMMARY = "Package maintenance system from Debian"
LICENSE = "GPLv2.0+"
SECTION = "base"
+PROVIDES = "virtual/update-alternatives"
DEPENDS = "zlib bzip2 perl ncurses"
-DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
+DEPENDS_class-native = "bzip2-replacement-native zlib-native gettext-native perl-native"
RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
RDEPENDS_${PN}_class-native = "xz-native"
@@ -43,8 +44,6 @@ do_configure () {
do_install_append () {
if [ "${PN}" = "dpkg-native" ]; then
- # update-alternatives doesn't have an offline mode
- rm ${D}${bindir}/update-alternatives
sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
else
sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
@@ -61,14 +60,9 @@ do_install_append () {
fi
}
-PROV = "virtual/update-alternatives"
-PROV_class-native = ""
-
-PROVIDES += "${PROV}"
-
PACKAGES =+ "update-alternatives-dpkg"
FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
-RPROVIDES_update-alternatives-dpkg += "update-alternatives"
+RPROVIDES_update-alternatives-dpkg = "update-alternatives"
PACKAGES += "${PN}-perl"
FILES_${PN}-perl = "${libdir}/perl"
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
deleted file mode 100644
index 80504ce..0000000
--- a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 24229971492515b64c81e8c6392e5dfbdc22b44c Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Wed, 26 Aug 2015 16:25:45 +0300
-Subject: [PATCH 3/5] Our pre/postinsts expect $D to be set when running in a
- sysroot and don't expect a chroot. This matches up our system expectations
- with what dpkg does.
-
-Upstream-Status: Inappropriate [OE Specific]
-
-RP 2011/12/07
-ALIMON 2016/05/26
-
----
- src/script.c | 39 +++------------------------------------
- 1 file changed, 3 insertions(+), 36 deletions(-)
-
-diff --git a/src/script.c b/src/script.c
-index 3c88be8..ce66a86 100644
---- a/src/script.c
-+++ b/src/script.c
-@@ -97,43 +97,10 @@ setexecute(const char *path, struct stat *stab)
- static const char *
- maintscript_pre_exec(struct command *cmd)
- {
-- const char *admindir = dpkg_db_get_dir();
-- const char *changedir = fc_script_chrootless ? instdir : "/";
-- size_t instdirl = strlen(instdir);
--
-- if (*instdir && !fc_script_chrootless) {
-- if (strncmp(admindir, instdir, instdirl) != 0)
-- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
-- if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
-- ohshite(_("unable to setenv for subprocesses"));
-- if (setenv("DPKG_ROOT", "", 1) < 0)
-- ohshite(_("unable to setenv for subprocesses"));
--
-- if (chroot(instdir))
-- ohshite(_("failed to chroot to '%.250s'"), instdir);
-+ if (*instdir) {
-+ setenv("D", instdir, 1);
- }
-- /* Switch to a known good directory to give the maintainer script
-- * a saner environment, also needed after the chroot(). */
-- if (chdir(changedir))
-- ohshite(_("failed to chdir to '%.255s'"), changedir);
-- if (debug_has_flag(dbg_scripts)) {
-- struct varbuf args = VARBUF_INIT;
-- const char **argv = cmd->argv;
--
-- while (*++argv) {
-- varbuf_add_char(&args, ' ');
-- varbuf_add_str(&args, *argv);
-- }
-- varbuf_end_str(&args);
-- debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
-- args.buf);
-- varbuf_destroy(&args);
-- }
-- if (!instdirl || fc_script_chrootless)
-- return cmd->filename;
--
-- assert(strlen(cmd->filename) >= instdirl);
-- return cmd->filename + instdirl;
-+ return cmd->filename;
- }
-
- /**
---
-2.1.4
-
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch b/meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch
new file mode 100644
index 0000000..ebf4e08
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch
@@ -0,0 +1,399 @@
+From b4f0f6ced469095a2b21ddddb01b59c7aded057e Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Thu, 28 Aug 2014 05:20:21 +0200
+Subject: [PATCH] update-alternatives: Implement offline mode
+
+Lets update-alternatives manage symlinks inside a cross-arch root
+filesystem in a directory specified by DPKG_ROOT.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ utils/Makefile.am | 1 +
+ utils/update-alternatives.c | 175 ++++++++++++++++++++++++++++----------------
+ 2 files changed, 114 insertions(+), 62 deletions(-)
+
+diff --git a/utils/Makefile.am b/utils/Makefile.am
+index 83378ad..1f821c5 100644
+--- a/utils/Makefile.am
++++ b/utils/Makefile.am
+@@ -27,6 +27,7 @@ update_alternatives_SOURCES = \
+ update_alternatives_CPPFLAGS = \
+ -DALT_TMP_EXT=\".dpkg-tmp\" \
+ -DADMINDIR_ENVVAR=\"DPKG_ADMINDIR\" \
++ -DINSTDIR_ENVVAR=\"DPKG_ROOT\" \
+ $(AM_CPPFLAGS)
+
+ update_alternatives_LDADD = \
+diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
+index 5dc3213..2b49819 100644
+--- a/utils/update-alternatives.c
++++ b/utils/update-alternatives.c
+@@ -51,6 +51,7 @@
+ #define PROGNAME "update-alternatives"
+
+ static const char *altdir = SYSCONFDIR "/alternatives";
++static const char *instdir;
+ static const char *admdir;
+
+ static const char *prog_path = "update-alternatives";
+@@ -64,6 +65,27 @@ static int opt_verbose = 0;
+ static int opt_force = 0;
+
+ /*
++ * Types.
++ */
++
++enum alternative_path_status {
++ ALT_PATH_SYMLINK,
++ ALT_PATH_MISSING,
++ ALT_PATH_OTHER,
++};
++
++
++/*
++ * Predeclarations.
++ */
++
++static char * DPKG_ATTR_PRINTF(1)
++xasprintf(const char *fmt, ...);
++
++static enum alternative_path_status
++alternative_path_classify(const char *linkname);
++
++/*
+ * Functions.
+ */
+
+@@ -270,7 +292,7 @@ xstrdup(const char *str)
+ }
+
+ static char *
+-areadlink(const char *linkname)
++_areadlink(const char *linkname)
+ {
+ struct stat st;
+ char *buf;
+@@ -303,6 +325,19 @@ areadlink(const char *linkname)
+ }
+
+ static char *
++areadlink(const char *linkname)
++{
++ char *instdir_linkname;
++ char *ret;
++
++ instdir_linkname = xasprintf("%s%s", instdir, linkname);
++ ret = _areadlink(instdir_linkname);
++ free(instdir_linkname);
++
++ return ret;
++}
++
++static char *
+ xreadlink(const char *linkname)
+ {
+ char *buf;
+@@ -348,9 +383,22 @@ set_action(const char *new_action)
+ }
+
+ static const char *
++instdir_init(void)
++{
++ const char *dpkg_instdir;
++
++ dpkg_instdir = getenv(INSTDIR_ENVVAR);
++ if (dpkg_instdir)
++ return dpkg_instdir;
++
++ return "";
++}
++
++static const char *
+ admindir_init(void)
+ {
+ const char *basedir, *basedir_env;
++ size_t length;
+
+ /* Try to get the admindir from an environment variable, usually set
+ * by the system package manager. */
+@@ -360,6 +408,12 @@ admindir_init(void)
+ else
+ basedir = ADMINDIR;
+
++ /* If instdir is set and admindir is below instdir, treat admindir
++ * as relative. */
++ length = strlen(instdir);
++ if (strncmp(basedir, instdir, length) == 0)
++ basedir += length;
++
+ return xasprintf("%s/%s", basedir, "alternatives");
+ }
+
+@@ -432,25 +486,43 @@ rename_mv(const char *src, const char *dst)
+ static void
+ checked_symlink(const char *filename, const char *linkname)
+ {
+- if (symlink(filename, linkname))
++ char *instdir_linkname;
++
++ instdir_linkname = xasprintf("%s%s", instdir, linkname);
++
++ if (symlink(filename, instdir_linkname))
+ syserr(_("error creating symbolic link '%.255s'"), linkname);
++
++ free(instdir_linkname);
+ }
+
+ static void
+ checked_mv(const char *src, const char *dst)
+ {
+- if (!rename_mv(src, dst))
++ char *instdir_src;
++ char *instdir_dst;
++
++ instdir_src = xasprintf("%s%s", instdir, src);
++ instdir_dst = xasprintf("%s%s", instdir, dst);
++
++ if (!rename_mv(instdir_src, instdir_dst))
+ syserr(_("unable to install '%.250s' as '%.250s'"), src, dst);
++
++ free(instdir_src);
++ free(instdir_dst);
+ }
+
+ static void
+ checked_rm(const char *f)
+ {
+- if (!unlink(f))
+- return;
++ char *instdir_f;
+
+- if (errno != ENOENT)
++ instdir_f = xasprintf("%s%s", instdir, f);
++
++ if (unlink(instdir_f) && errno != ENOENT)
+ syserr(_("unable to remove '%s'"), f);
++
++ free(instdir_f);
+ }
+
+ static void DPKG_ATTR_PRINTF(1)
+@@ -567,16 +639,11 @@ fileset_has_slave(struct fileset *fs, const char *name)
+ static bool
+ fileset_can_install_slave(struct fileset *fs, const char *slave_name)
+ {
+- struct stat st;
+-
+ /* Decide whether the slave alternative must be setup */
+ if (fileset_has_slave(fs, slave_name)) {
+ const char *slave = fileset_get_slave(fs, slave_name);
+
+- errno = 0;
+- if (stat(slave, &st) == -1 && errno != ENOENT)
+- syserr(_("cannot stat file '%s'"), slave);
+- if (errno == 0)
++ if (alternative_path_classify(slave) != ALT_PATH_MISSING)
+ return true;
+ }
+
+@@ -1039,10 +1106,15 @@ static int
+ altdb_get_namelist(struct dirent ***table)
+ {
+ int count;
++ char *instdir_admdir;
+
+- count = scandir(admdir, table, altdb_filter_namelist, alphasort);
++ instdir_admdir = xasprintf("%s%s", instdir, admdir);
++
++ count = scandir(instdir_admdir, table, altdb_filter_namelist, alphasort);
+ if (count < 0)
+- syserr(_("cannot scan directory '%.255s'"), admdir);
++ syserr(_("cannot scan directory '%.255s'"), instdir_admdir);
++
++ free(instdir_admdir);
+
+ return count;
+ }
+@@ -1167,7 +1239,6 @@ alternative_parse_fileset(struct alternative *a, struct altdb_context *ctx)
+ {
+ struct fileset *fs;
+ struct slave_link *sl;
+- struct stat st;
+ char *master_file;
+
+ master_file = altdb_get_line(ctx, _("master file"));
+@@ -1180,12 +1251,9 @@ alternative_parse_fileset(struct alternative *a, struct altdb_context *ctx)
+ if (fs)
+ ctx->bad_format(ctx, _("duplicate path %s"), master_file);
+
+- if (stat(master_file, &st)) {
++ if (alternative_path_classify(master_file) == ALT_PATH_MISSING) {
+ char *junk;
+
+- if (errno != ENOENT)
+- syserr(_("cannot stat file '%s'"), master_file);
+-
+ /* File not found - remove. */
+ if (ctx->flags & ALTDB_WARN_PARSER)
+ warning(_("alternative %s (part of link group %s) "
+@@ -1248,7 +1316,7 @@ alternative_load(struct alternative *a, enum altdb_flags flags)
+ ctx.bad_format = altdb_parse_stop;
+ else
+ ctx.bad_format = altdb_parse_error;
+- ctx.filename = xasprintf("%s/%s", admdir, a->master_name);
++ ctx.filename = xasprintf("%s%s/%s", instdir, admdir, a->master_name);
+
+ /* Open the alternative file. */
+ ctx.fh = fopen(ctx.filename, "r");
+@@ -1340,7 +1408,7 @@ alternative_save(struct alternative *a)
+ file = xasprintf("%s/%s", admdir, a->master_name);
+ filenew = xasprintf("%s" ALT_TMP_EXT, file);
+
+- ctx.filename = filenew;
++ ctx.filename = xasprintf("%s%s", instdir, filenew);
+ ctx.fh = fopen(ctx.filename, "w");
+ if (ctx.fh == NULL)
+ syserr(_("unable to create file '%s'"), ctx.filename);
+@@ -1379,6 +1447,7 @@ alternative_save(struct alternative *a)
+ syserr(_("unable to sync file '%s'"), ctx.filename);
+ if (fclose(ctx.fh))
+ syserr(_("unable to close file '%s'"), ctx.filename);
++ free(ctx.filename);
+
+ /* Put in place atomically. */
+ checked_mv(filenew, file);
+@@ -1399,7 +1468,6 @@ alternative_set_current(struct alternative *a, char *new_choice)
+ static const char *
+ alternative_get_current(struct alternative *a)
+ {
+- struct stat st;
+ char *curlink;
+ char *file;
+
+@@ -1407,12 +1475,9 @@ alternative_get_current(struct alternative *a)
+ return a->current;
+
+ curlink = xasprintf("%s/%s", altdir, a->master_name);
+- if (lstat(curlink, &st)) {
+- if (errno == ENOENT) {
+- free(curlink);
+- return alternative_set_current(a, NULL);
+- }
+- syserr(_("cannot stat file '%s'"), curlink);
++ if (alternative_path_classify(curlink) == ALT_PATH_MISSING) {
++ free(curlink);
++ return alternative_set_current(a, NULL);
+ }
+
+ file = xreadlink(curlink);
+@@ -1674,14 +1739,8 @@ alternative_commit(struct alternative *a)
+ alternative_commit_operations_free(a);
+ }
+
+-enum alternative_path_status {
+- ALT_PATH_SYMLINK,
+- ALT_PATH_MISSING,
+- ALT_PATH_OTHER,
+-};
+-
+ static enum alternative_path_status
+-alternative_path_classify(const char *linkname)
++_alternative_path_classify(const char *linkname)
+ {
+ struct stat st;
+
+@@ -1697,6 +1756,19 @@ alternative_path_classify(const char *linkname)
+ }
+ }
+
++static enum alternative_path_status
++alternative_path_classify(const char *linkname)
++{
++ enum alternative_path_status ret;
++ char *instdir_linkname;
++
++ instdir_linkname = xasprintf("%s%s", instdir, linkname);
++ ret = _alternative_path_classify(instdir_linkname);
++ free(instdir_linkname);
++
++ return ret;
++}
++
+ static bool
+ alternative_path_can_remove(const char *linkname)
+ {
+@@ -2120,13 +2192,7 @@ alternative_select_mode(struct alternative *a, const char *current_choice)
+ if (current_choice) {
+ /* Detect manually modified alternative, switch to manual. */
+ if (!alternative_has_choice(a, current_choice)) {
+- struct stat st;
+-
+- errno = 0;
+- if (stat(current_choice, &st) == -1 && errno != ENOENT)
+- syserr(_("cannot stat file '%s'"), current_choice);
+-
+- if (errno == ENOENT) {
++ if (alternative_path_classify(current_choice) == ALT_PATH_MISSING) {
+ warning(_("%s/%s is dangling; it will be updated "
+ "with best choice"), altdir, a->master_name);
+ alternative_set_status(a, ALT_ST_AUTO);
+@@ -2150,7 +2216,6 @@ alternative_evolve_slave(struct alternative *a, const char *cur_choice,
+ struct slave_link *sl, struct fileset *fs)
+ {
+ struct slave_link *sl_old;
+- struct stat st;
+ char *new_file = NULL;
+ const char *old, *new;
+
+@@ -2174,17 +2239,7 @@ alternative_evolve_slave(struct alternative *a, const char *cur_choice,
+ }
+ if (strcmp(old, new) != 0 &&
+ alternative_path_classify(old) == ALT_PATH_SYMLINK) {
+- bool rename_link = false;
+-
+- if (new_file) {
+- errno = 0;
+- if (stat(new_file, &st) == -1 && errno != ENOENT)
+- syserr(_("cannot stat file '%s'"),
+- new_file);
+- rename_link = (errno == 0);
+- }
+-
+- if (rename_link) {
++ if (new_file && alternative_path_classify(new_file) != ALT_PATH_MISSING) {
+ info(_("renaming %s slave link from %s to %s"),
+ sl->name, old, new);
+ checked_mv(old, new);
+@@ -2474,7 +2529,6 @@ alternative_check_install_args(struct alternative *inst_alt,
+ struct alternative_map *alt_map_links, *alt_map_parent;
+ struct alternative *found;
+ struct slave_link *sl;
+- struct stat st;
+
+ alternative_check_name(inst_alt->master_name);
+ alternative_check_link(inst_alt->master_link);
+@@ -2499,13 +2553,9 @@ alternative_check_install_args(struct alternative *inst_alt,
+ inst_alt->master_link, found->master_name);
+ }
+
+- if (stat(fileset->master_file, &st) == -1) {
+- if (errno == ENOENT)
+- error(_("alternative path %s doesn't exist"),
+- fileset->master_file);
+- else
+- syserr(_("cannot stat file '%s'"), fileset->master_file);
+- }
++ if (alternative_path_classify(fileset->master_file) == ALT_PATH_MISSING)
++ error(_("alternative path %s doesn't exist"),
++ fileset->master_file);
+
+ for (sl = inst_alt->slaves; sl; sl = sl->next) {
+ const char *file = fileset_get_slave(fileset, sl->name);
+@@ -2580,6 +2630,7 @@ main(int argc, char **argv)
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
++ instdir = instdir_init();
+ admdir = admindir_init();
+
+ if (setvbuf(stdout, NULL, _IONBF, 0))
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb b/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
index 28fdc13..65a9bb6 100644
--- a/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
+++ b/meta/recipes-devtools/dpkg/dpkg_1.18.7.bb
@@ -8,7 +8,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20160509T100042Z/pool/main/
file://dpkg-configure.service \
file://add_armeb_triplet_entry.patch \
file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
- file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
+ file://0003-update-alternatives-Implement-offline-mode.patch \
file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
file://0005-dpkg-compiler.m4-remove-Wvla.patch \
file://0006-add-musleabi-to-known-target-tripets.patch \
--
2.7.4
^ permalink raw reply related
* [PATCH 00/33] Accumulated patches for deb packaging
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
To: openembedded-core
These are most of my patches which accumulated since our distro
switched from opkg to dpkg and apt two years ago. They were tested
thoroughly on dora and krogoth and just a little bit on master.
Most importantly, this adds support for Debian's update-alternatives
on rootfs creation time. For this to work, the recently added option
'--force-script-chrootless' must be passed to dpkg.
There's also a patch adding BAD_RECOMMENDATIONS for deb packages.
One patch renames dpkg-start-stop to start-stop-daemon. There's also
a recipe in meta-oe with the same name, which should be removed later.
Andreas Oberritter (33):
dpkg: implement offline mode for update-alternatives
dpkg: update-alternatives-dpkg should conflict with other providers
dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
apt-native: Use option --force-script-chrootless for rootfs
package_manager/deb: pass option --force-script-chrootless to dpkg
debianutils: Allow native builds
apt-native: merge apt-native.inc into .bb
apt: merge apt-package.inc into .bb
apt-native: use sed to prepare apt.conf.sample
apt: use default packaging rules for manpages
apt: use default packaging rules for base package, prepend apt-utils
apt: use default packaging rules for -dev package
apt: rewrite do_install
apt-native: drop obsolete patches
apt: merge with apt-native
apt: merge apt.inc into .bb
apt: group variables (license, configuration, packaging)
apt: more fine-grained packaging
apt: recommend gnupg
package_manager/deb: let apt-get handle postinst scripts
package_manager/deb: create Packages.xz
package_manager/deb: implement BAD_RECOMMENDATIONS
dpkg: use PACKAGECONFIG
dpkg: set license field to more common "GPLv2+"
dpkg: clean-up packaging of start-stop-daemon
dpkg: remove unneeded do_configure override
dpkg: simplify replacing perl interpreter in scripts
dpkg: update packages and files to match Debian more closely
dpkg: always install dpkg-configure.service
dpkg: use correct path for perl libraries
package_deb.bbclass: compress control.tar with the same algorithm as
data.tar
apt: fix rpath error during configure
apt: dselect depends on perl
meta/classes/package_deb.bbclass | 2 +-
meta/classes/rootfs_deb.bbclass | 6 -
meta/lib/oe/package_manager.py | 117 ++----
meta/lib/oe/rootfs.py | 8 +-
meta/recipes-devtools/apt/apt-native.inc | 70 ----
meta/recipes-devtools/apt/apt-native_1.2.12.bb | 4 -
meta/recipes-devtools/apt/apt-package.inc | 78 ----
meta/recipes-devtools/apt/apt.inc | 35 --
...ys-run-dpkg-configure-a-at-the-end-of-our.patch | 126 -------
.../apt/{files/apt.conf => apt/apt.conf.in} | 8 +-
meta/recipes-devtools/apt/apt/noconfigure.patch | 37 --
meta/recipes-devtools/apt/apt_1.2.12.bb | 125 ++++++-
.../apt/files/db_linking_hack.patch | 29 --
meta/recipes-devtools/apt/files/environment.patch | 15 -
meta/recipes-devtools/apt/files/no-curl.patch | 54 ---
meta/recipes-devtools/dpkg/dpkg.inc | 153 ++++----
...tinsts-expect-D-to-be-set-when-running-in.patch | 70 ----
...pdate-alternatives-Implement-offline-mode.patch | 399 +++++++++++++++++++++
meta/recipes-devtools/dpkg/dpkg_1.18.7.bb | 2 +-
.../recipes-support/debianutils/debianutils_4.8.bb | 4 +-
20 files changed, 654 insertions(+), 688 deletions(-)
delete mode 100644 meta/recipes-devtools/apt/apt-native.inc
delete mode 100644 meta/recipes-devtools/apt/apt-native_1.2.12.bb
delete mode 100644 meta/recipes-devtools/apt/apt-package.inc
delete mode 100644 meta/recipes-devtools/apt/apt.inc
delete mode 100644 meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
rename meta/recipes-devtools/apt/{files/apt.conf => apt/apt.conf.in} (80%)
delete mode 100644 meta/recipes-devtools/apt/apt/noconfigure.patch
delete mode 100644 meta/recipes-devtools/apt/files/db_linking_hack.patch
delete mode 100644 meta/recipes-devtools/apt/files/environment.patch
delete mode 100644 meta/recipes-devtools/apt/files/no-curl.patch
delete mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
create mode 100644 meta/recipes-devtools/dpkg/dpkg/0003-update-alternatives-Implement-offline-mode.patch
--
2.7.4
^ permalink raw reply
* [PATCH 03/33] dpkg-native: hardcode SYSCONFDIR to /etc in update-alternatives
From: Andreas Oberritter @ 2016-12-06 11:49 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1481024991-5882-1-git-send-email-obi@opendreambox.org>
It needs to be relative to DPKG_INSTDIR when installing.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
meta/recipes-devtools/dpkg/dpkg.inc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index f7d9e77..6769a70 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -36,6 +36,10 @@ EXTRA_OECONF = "\
EXTRA_OECONF += "TAR=tar"
EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
+do_configure_prepend_class-native() {
+ sed -i -e 's|SYSCONFDIR|"/etc"|' ${S}/utils/update-alternatives.c
+}
+
do_configure () {
echo >> ${S}/m4/compiler.m4
sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
--
2.7.4
^ permalink raw reply related
* Re: [meta-intel] [PATCH 2/2] gstreamer1.0-vaapi: Import from meta-intel
From: Burton, Ross @ 2016-12-06 10:48 UTC (permalink / raw)
To: Ylinen, Mikko; +Cc: meta-intel@yoctoproject.org, OE-core
In-Reply-To: <CAHZ0fbGcJPSjagwjxu08SxbaCAr50ucZ7WL3s-cMG2v4JaoNdg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
On 6 December 2016 at 09:57, Ylinen, Mikko <mikko.ylinen@intel.com> wrote:
> This suggests the versions should be kept in sync with the gstreamer
> versions:
> http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/commit/?id=
> 3f51f61efe93c104ba7996f54f381c6c1a5e6546
>
Khem sent a GStreamer upgrade a few days ago, so they'll all be merging at
once. gst-vaapi 1.8 doesn't build with gst 1.10 anyway.
Ross
[-- Attachment #2: Type: text/html, Size: 1014 bytes --]
^ permalink raw reply
* [PATCH] liburi-perl: update to 1.71
From: Andreas Müller @ 2016-12-06 10:33 UTC (permalink / raw)
To: openembedded-core
Old version was broken by perl update. It was found by investigating configure
errors in meta-qt5-extra/kf5:
| [superandy@mueller-a-nb-linux 5.28.0-r0]$ /home/superandy/tmp/oe-core-glibc/sysroots/x86_64-linux/usr/bin/perl-native/perl -e "use URI::Escape"
| \C no longer supported in regex; marked by <-- HERE in m/(\ <-- HERE C)/ at /home/superandy/tmp/oe-core-glibc/sysroots/x86_64-linux/usr/lib/perl-native/perl/vendor_perl/5.24.0/URI/Escape.pm line 205.
| Compilation failed in require at -e line 1.
| BEGIN failed--compilation aborted at -e line 1.
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
.../perl/{liburi-perl_1.60.bb => liburi-perl_1.71.bb} | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
rename meta/recipes-devtools/perl/{liburi-perl_1.60.bb => liburi-perl_1.71.bb} (64%)
diff --git a/meta/recipes-devtools/perl/liburi-perl_1.60.bb b/meta/recipes-devtools/perl/liburi-perl_1.71.bb
similarity index 64%
rename from meta/recipes-devtools/perl/liburi-perl_1.60.bb
rename to meta/recipes-devtools/perl/liburi-perl_1.71.bb
index 8809a44..a800198 100644
--- a/meta/recipes-devtools/perl/liburi-perl_1.60.bb
+++ b/meta/recipes-devtools/perl/liburi-perl_1.71.bb
@@ -3,17 +3,18 @@ DESCRIPTION = "This package contains the URI.pm module with friends. \
The module implements the URI class. URI objects can be used to access \
and manipulate the various components that make up these strings."
+HOMEPAGE = "http://search.cpan.org/dist/URI/"
SECTION = "libs"
LICENSE = "Artistic-1.0 | GPL-1.0+"
-LIC_FILES_CHKSUM = "file://README;beginline=26;endline=30;md5=6c33ae5c87fd1c4897714e122dd9c23d"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c453e94fae672800f83bc1bd7a38b53f"
DEPENDS += "perl"
-SRC_URI = "http://www.cpan.org/authors/id/G/GA/GAAS/URI-${PV}.tar.gz"
+SRC_URI = "http://www.cpan.org/authors/id/E/ET/ETHER/URI-${PV}.tar.gz"
-SRC_URI[md5sum] = "70f739be8ce28b8baba7c5920ffee4dc"
-SRC_URI[sha256sum] = "1f92d3dc64acb8845e9917c945e22b9a5275aeb9ff924eb7873c3b7a5c0d2377"
+SRC_URI[md5sum] = "247c3da29a794f72730e01aa5a715daf"
+SRC_URI[sha256sum] = "9c8eca0d7f39e74bbc14706293e653b699238eeb1a7690cc9c136fb8c2644115"
S = "${WORKDIR}/URI-${PV}"
--
2.7.4
^ permalink raw reply related
* Re: [PATCH 2/2] gstreamer1.0-vaapi: Import from meta-intel
From: Ylinen, Mikko @ 2016-12-06 9:57 UTC (permalink / raw)
To: Khem Raj, openembedded-core, meta-intel
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
Hi,
On Fri, Dec 2, 2016 at 9:32 PM, Khem Raj <raj.khem@gmail.com> wrote:
> Update to 1.10.1 at the same time
>
This suggests the versions should be kept in sync with the gstreamer
versions:
http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/commit/?id=3f51f61efe93c104ba7996f54f381c6c1a5e6546
-- Mikko
[-- Attachment #2: Type: text/html, Size: 794 bytes --]
^ permalink raw reply
* Re: oetest.py construction of pkgmanifest is probably wrong
From: Burton, Ross @ 2016-12-06 9:52 UTC (permalink / raw)
To: Slater, Joseph; +Cc: openembedded-core@lists.openembedded.org
In-Reply-To: <007BD92917A2324FA403BCF9A464CF84BF4DD4D5@ALA-MBB.corp.ad.wrs.com>
[-- Attachment #1: Type: text/plain, Size: 331 bytes --]
On 6 December 2016 at 02:24, Slater, Joseph <joe.slater@windriver.com>
wrote:
> This variable is a dictionary with entries based on package, but for
> multillib a package might exist in only some variants. Perhaps
>
> each entry should be a dictionary of multilib variants?
>
>
Yeah, probably. Got a patch? :)
Ross
[-- Attachment #2: Type: text/html, Size: 778 bytes --]
^ permalink raw reply
* Re: [PATCH] gdb-cross-canadian: Depend on nativesdk-python3-misc
From: Burton, Ross @ 2016-12-06 9:14 UTC (permalink / raw)
To: George McCollister; +Cc: OE-core
In-Reply-To: <CAFSKS=NvbpPaR038OS+uAK78HQt_DfKuNodJHTQ54Zi5aXV+Ng@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 411 bytes --]
On 6 December 2016 at 00:16, George McCollister <
george.mccollister@gmail.com> wrote:
> importlib is the replacement for imp (it's deprecated since version
> 3.4) so this sounds reasonable to me. Shall I send a patch to add
> imp.py to python3-importlib and another to add python3-importlib to
> PACKAGECONFIG[python] in gdb-cross-canadian.inc?
>
Yes, that sounds like the best idea to me.
Ross
[-- Attachment #2: Type: text/html, Size: 822 bytes --]
^ permalink raw reply
* Re: [PATCH V2 0/6] runqemu: fix for slirp, network device and hostfwd
From: Robert Yang @ 2016-12-06 9:01 UTC (permalink / raw)
To: Randy Witt, Nathan Rossi; +Cc: openembedded-core
In-Reply-To: <cover.1481014270.git.liezhi.yang@windriver.com>
On 12/06/2016 04:55 PM, Robert Yang wrote:
> * V2
> - Add QB_NETWORK_DEVICE to set network device for both slirp and tap,
> the idea is from Randy and Nathan.
Add Randy and Nathan in the loop, I had added them in git send-email,
but there were not in the CC list, look strange.
// Robert
> - Use different mac sections for slirp and tap to fix conflicts when
> running both of them on the same host.
>
> * V1
> - Initial version
>
> The following changes since commit 11063a01d4511b2688ea7ba2d7359e4e07328c66:
>
> ruby: upgrade to 2.3.1 (2016-11-30 15:47:17 +0000)
>
> are available in the git repository at:
>
> git://git.openembedded.org/openembedded-core-contrib rbt/runqemu
> http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/runqemu
>
> Robert Yang (6):
> scripts/runqemu: fix checking for <file>.cpio.gz
> qemuboot.bbclass: use IMGDEPLOYDIR
> runqemu-export-rootfs: fix inconsistent var names
> runqemu: support mutiple qemus running when nfs
> runqemu: fixes for slirp, network device and hostfwd
> qemuboot.bbclass: add blank lines in comments
>
> meta/classes/qemuboot.bbclass | 34 ++++++--
> meta/conf/machine/include/qemuboot-x86.inc | 1 -
> meta/conf/machine/qemuarm64.conf | 1 -
> scripts/runqemu | 133 ++++++++++++++++++++++-------
> scripts/runqemu-export-rootfs | 21 ++---
> 5 files changed, 140 insertions(+), 50 deletions(-)
>
^ permalink raw reply
* [PATCH V2 3/6] runqemu-export-rootfs: fix inconsistent var names
From: Robert Yang @ 2016-12-06 8:55 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481014270.git.liezhi.yang@windriver.com>
Fixed:
$ runqemu nfs qemux86-64
[snip]
On your target please remember to add the following options for NFS
nfsroot=IP_ADDRESS:/path/to/nfsroot,nfsvers=3,port=,mountprog=,nfsprog=,udp,mountport=
[snip]
Note that the values are null, this is because their var names are
inconsistent.
[YOCTO #10519]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
scripts/runqemu-export-rootfs | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs
index 3dee131..0dd3eba 100755
--- a/scripts/runqemu-export-rootfs
+++ b/scripts/runqemu-export-rootfs
@@ -78,23 +78,17 @@ if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then
fi
# rpc.mountd RPC port
-NFS_MOUNTPROG=$[ 21111 + $NFS_INSTANCE ]
+MOUNTD_RPCPORT=$[ 21111 + $NFS_INSTANCE ]
# rpc.nfsd RPC port
-NFS_NFSPROG=$[ 11111 + $NFS_INSTANCE ]
-# NFS port number
-NFS_PORT=$[ 3049 + 2 * $NFS_INSTANCE ]
+NFSD_RPCPORT=$[ 11111 + $NFS_INSTANCE ]
+# NFS server port number
+NFSD_PORT=$[ 3049 + 2 * $NFS_INSTANCE ]
# mountd port number
-MOUNT_PORT=$[ 3048 + 2 * $NFS_INSTANCE ]
+MOUNTD_PORT=$[ 3048 + 2 * $NFS_INSTANCE ]
## For debugging you would additionally add
## --debug all
-UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -x $NFS_NFSPROG -n $NFS_PORT -y $NFS_MOUNTPROG -m $MOUNT_PORT"
-
-# Setup the exports file
-if [ "$1" = "start" ]; then
- echo "Creating exports file..."
- echo "$NFS_EXPORT_DIR (rw,async,no_root_squash,no_all_squash,insecure)" > $EXPORTS
-fi
+UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -x $NFSD_RPCPORT -n $NFSD_PORT -y $MOUNTD_RPCPORT -m $MOUNTD_PORT"
# See how we were called.
case "$1" in
@@ -114,6 +108,9 @@ case "$1" in
exit 1
fi
+ echo "Creating exports file..."
+ echo "$NFS_EXPORT_DIR (rw,async,no_root_squash,no_all_squash,insecure)" > $EXPORTS
+
echo "Starting User Mode nfsd"
echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS"
$PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS
--
2.9.0
^ permalink raw reply related
* [PATCH V2 6/6] qemuboot.bbclass: add blank lines in comments
From: Robert Yang @ 2016-12-06 8:55 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481014270.git.liezhi.yang@windriver.com>
Add blank lines in comments to make it easy for readind and updating.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
meta/classes/qemuboot.bbclass | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 1b94af9..f953241 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -3,34 +3,52 @@
# boot by runqemu:
#
# QB_SYSTEM_NAME: qemu name, e.g., "qemu-system-i386"
+#
# QB_OPT_APPEND: options to append to qemu, e.g., "-show-cursor"
+#
# QB_DEFAULT_KERNEL: default kernel to boot, e.g., "bzImage"
+#
# QB_DEFAULT_FSTYPE: default FSTYPE to boot, e.g., "ext4"
+#
# QB_MEM: memory, e.g., "-m 512"
+#
# QB_MACHINE: qemu machine, e.g., "-machine virt"
+#
# QB_CPU: qemu cpu, e.g., "-cpu qemu32"
+#
# QB_CPU_KVM: the similar to QB_CPU, but used when kvm, e.g., '-cpu kvm64',
# set it when support kvm.
+#
# QB_KERNEL_CMDLINE_APPEND: options to append to kernel's -append
# option, e.g., "console=ttyS0 console=tty"
+#
# QB_DTB: qemu dtb name
+#
# QB_AUDIO_DRV: qemu audio driver, e.g., "alsa", set it when support audio
+#
# QB_AUDIO_OPT: qemu audio option, e.g., "-soundhw ac97,es1370", used
# when QB_AUDIO_DRV is set.
+#
# QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda
+#
# QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@",
# it needs work with QB_TAP_OPT and QB_SLIRP_OPT.
# Note, runqemu will replace @MAC@ with a predefined mac, you can set
# a custom one, but that may cause conflicts when multiple qemus are
# running on the same host.
+#
# QB_TAP_OPT: netowrk option for 'tap' mode, e.g.,
# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
# Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ...
+#
# QB_SLIRP_OPT: network option for SLIRP mode, e.g., -netdev user,id=net0"
+#
# QB_ROOTFS_OPT: used as rootfs, e.g.,
# "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
# Note, runqemu will replace "@ROOTFS@" with the one which is used, such as core-image-minimal-qemuarm64.ext4.
+#
# QB_SERIAL_OPT: serial port, e.g., "-serial mon:stdio"
+#
# QB_TCPSERIAL_OPT: tcp serial port option, e.g.,
# " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
# Note, runqemu will replace "@PORT@" with the port number which is used.
--
2.9.0
^ permalink raw reply related
* [PATCH V2 5/6] runqemu: fixes for slirp, network device and hostfwd
From: Robert Yang @ 2016-12-06 8:55 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481014270.git.liezhi.yang@windriver.com>
Fixed:
- Add QB_NETWORK_DEVICE to set network device, it will be used by both
slirp and tap.
- Set QB_NETWORK_DEVICE to "-device virtio-net-pci" in qemuboot.bbclass
but runqemu will default to "-device e1000" when QB_NETWORK_DEVICE is
not set, this is because oe-core's qemu targets support
virtio-net-pci, but the one outside of oe-core may not,
"-device e1000" is more common.
- Set hostfwd by default: 2222 -> 22, 2323 -> 23, and it will choose a
usable port when the one like 222 is being used. This can avoid
conflicts when multilib slirp qemus are running. We can forward more
ports by default if needed, and bsp.conf can custom it.
- Use different mac sections for slirp and tap to fix conflicts when
running both of them on the same host.
[YOCTO #7887]
CC: Nathan Rossi <nathan@nathanrossi.com>
CC: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
meta/classes/qemuboot.bbclass | 11 ++++--
meta/conf/machine/include/qemuboot-x86.inc | 1 -
meta/conf/machine/qemuarm64.conf | 1 -
scripts/runqemu | 58 ++++++++++++++++++++++++++----
4 files changed, 59 insertions(+), 12 deletions(-)
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 1f78a98..1b94af9 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -18,11 +18,15 @@
# QB_AUDIO_OPT: qemu audio option, e.g., "-soundhw ac97,es1370", used
# when QB_AUDIO_DRV is set.
# QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda
+# QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@",
+# it needs work with QB_TAP_OPT and QB_SLIRP_OPT.
+# Note, runqemu will replace @MAC@ with a predefined mac, you can set
+# a custom one, but that may cause conflicts when multiple qemus are
+# running on the same host.
# QB_TAP_OPT: netowrk option for 'tap' mode, e.g.,
-# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0"
+# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
# Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ...
-# QB_SLIRP_OPT: network option for SLIRP mode, e.g.,
-# "-netdev user,id=net0 -device virtio-net-device,netdev=net0"
+# QB_SLIRP_OPT: network option for SLIRP mode, e.g., -netdev user,id=net0"
# QB_ROOTFS_OPT: used as rootfs, e.g.,
# "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
# Note, runqemu will replace "@ROOTFS@" with the one which is used, such as core-image-minimal-qemuarm64.ext4.
@@ -40,6 +44,7 @@ QB_SERIAL_OPT ?= "-serial mon:stdio -serial null"
QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}"
QB_DEFAULT_FSTYPE ?= "ext4"
QB_OPT_APPEND ?= "-show-cursor"
+QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@"
# Create qemuboot.conf
addtask do_write_qemuboot_conf after do_rootfs before do_image
diff --git a/meta/conf/machine/include/qemuboot-x86.inc b/meta/conf/machine/include/qemuboot-x86.inc
index 0870294..06ac983 100644
--- a/meta/conf/machine/include/qemuboot-x86.inc
+++ b/meta/conf/machine/include/qemuboot-x86.inc
@@ -13,4 +13,3 @@ QB_AUDIO_OPT = "-soundhw ac97,es1370"
QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1"
# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
QB_OPT_APPEND = "-vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci"
-QB_SLIRP_OPT = "-net nic,model=e1000 -net user,hostfwd=tcp::2222-:22"
diff --git a/meta/conf/machine/qemuarm64.conf b/meta/conf/machine/qemuarm64.conf
index df2010c..7a5570c 100644
--- a/meta/conf/machine/qemuarm64.conf
+++ b/meta/conf/machine/qemuarm64.conf
@@ -18,7 +18,6 @@ QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,38400"
# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
QB_OPT_APPEND = "-show-cursor -device virtio-rng-pci -monitor null"
QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0,mac=@MAC@"
-QB_SLIRP_OPT = "-netdev user,id=net0 -device virtio-net-device,netdev=net0"
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
diff --git a/scripts/runqemu b/scripts/runqemu
index a10270c..629b4ed 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -84,7 +84,7 @@ of the following environment variables (in any order):
Examples:
runqemu qemuarm
runqemu tmp/deploy/images/qemuarm
- runqemu tmp/deploy/images/qemux86/.qemuboot.conf
+ runqemu tmp/deploy/images/qemux86/<qemuboot.conf>
runqemu qemux86-64 core-image-sato ext4
runqemu qemux86-64 wic-image-minimal wic
runqemu path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial
@@ -147,6 +147,19 @@ def get_first_file(cmds):
return f
return ''
+def check_free_port(host, port):
+ """ Check whether the port is free or not """
+ import socket
+ from contextlib import closing
+
+ with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
+ if sock.connect_ex((host, port)) == 0:
+ # Port is open, so not free
+ return False
+ else:
+ # Port is not open, so free
+ return True
+
class BaseConfig(object):
def __init__(self):
# Vars can be merged with .qemuboot.conf, use a dict to manage them.
@@ -186,6 +199,15 @@ class BaseConfig(object):
self.snapshot = False
self.fstypes = ('ext2', 'ext3', 'ext4', 'jffs2', 'nfs', 'btrfs', 'cpio.gz', 'cpio', 'ramfs')
self.vmtypes = ('hddimg', 'hdddirect', 'wic', 'vmdk', 'qcow2', 'vdi', 'iso')
+ self.network_device = "-device e1000,netdev=net0,mac=@MAC@"
+ # Use different mac section for tap and slirp to avoid
+ # conflicts, e.g., when one is running with tap, the other is
+ # running with slirp.
+ # The last section is dynamic, which is for avoiding conflicts,
+ # when multiple qemus are running, e.g., when multiple tap or
+ # slirp qemus are running.
+ self.mac_tap = "52:54:00:12:34:"
+ self.mac_slirp = "52:54:00:12:35:"
def acquire_lock(self):
logger.info("Acquiring lockfile %s..." % self.lock)
@@ -751,14 +773,35 @@ class BaseConfig(object):
self.nfs_running = True
-
def setup_slirp(self):
"""Setup user networking"""
if self.fstype == 'nfs':
self.setup_nfs()
self.kernel_cmdline_script += ' ip=dhcp'
- self.set('NETWORK_CMD', self.get('QB_SLIRP_OPT'))
+ # Port mapping
+ hostfwd = ",hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23"
+ qb_slirp_opt_default = "-netdev user,id=net0%s" % hostfwd
+ qb_slirp_opt = self.get('QB_SLIRP_OPT') or qb_slirp_opt_default
+ # Figure out the port
+ ports = re.findall('hostfwd=[^-]*:([0-9]+)-[^,-]*', qb_slirp_opt)
+ ports = [int(i) for i in ports]
+ mac = 2
+ # Find a free port to avoid conflicts
+ for p in ports[:]:
+ p_new = p
+ while not check_free_port('localhost', p_new):
+ p_new += 1
+ mac += 1
+ while p_new in ports:
+ p_new += 1
+ mac += 1
+ if p != p_new:
+ ports.append(p_new)
+ qb_slirp_opt = re.sub(':%s-' % p, ':%s-' % p_new, qb_slirp_opt)
+ logger.info("Port forward changed: %s -> %s" % (p, p_new))
+ mac = "%s%02x" % (self.mac_slirp, mac)
+ self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qb_slirp_opt))
def setup_tap(self):
"""Setup tap"""
@@ -828,21 +871,22 @@ class BaseConfig(object):
if self.fstype == 'nfs':
self.setup_nfs()
self.kernel_cmdline_script += " ip=192.168.7.%s::192.168.7.%s:255.255.255.0" % (client, gateway)
- mac = "52:54:00:12:34:%02x" % client
+ mac = "%s%02x" % (self.mac_tap, client)
qb_tap_opt = self.get('QB_TAP_OPT')
if qb_tap_opt:
- qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap).replace('@MAC@', mac)
+ qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap)
else:
- qemu_tap_opt = "-device virtio-net-pci,netdev=net0,mac=%s -netdev tap,id=net0,ifname=%s,script=no,downscript=no" % (mac, self.tap)
+ qemu_tap_opt = "-netdev tap,id=net0,ifname=%s,script=no,downscript=no" % (self.tap)
if self.vhost_enabled:
qemu_tap_opt += ',vhost=on'
- self.set('NETWORK_CMD', qemu_tap_opt)
+ self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qemu_tap_opt))
def setup_network(self):
cmd = "stty -g"
self.saved_stty = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device
if self.slirp_enabled:
self.setup_slirp()
else:
--
2.9.0
^ permalink raw reply related
* [PATCH V2 4/6] runqemu: support mutiple qemus running when nfs
From: Robert Yang @ 2016-12-06 8:55 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481014270.git.liezhi.yang@windriver.com>
Fixed:
* In build1:
$ runqemu nfs qemux86-64
In build2:
$ runqemu nfs qemux86-64
It would fail before since the port numerbs and conf files are
conflicted, now make runqemu-export-rootfs work together with runqemu to
fix the problem.
* And we don't need export PSEUDO_LOCALSTATEDIR in runqemu, the
runqemu-export-rootfs can handle it well based on NFS_EXPORT_DIR.
* Remove "async" option from unfsd to fix warning in syslog:
Warning: unknown exports option `async' ignored
* Fixed typos
Both slirp and tap can work.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
scripts/runqemu | 55 ++++++++++++++++++++++++++++---------------
scripts/runqemu-export-rootfs | 10 ++++----
2 files changed, 41 insertions(+), 24 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index c737eb2..a10270c 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -690,17 +690,33 @@ class BaseConfig(object):
else:
self.nfs_server = '192.168.7.1'
- nfs_instance = int(self.nfs_instance)
-
- mountd_rpcport = 21111 + nfs_instance
- nfsd_rpcport = 11111 + nfs_instance
- nfsd_port = 3049 + 2 * nfs_instance
- mountd_port = 3048 + 2 * nfs_instance
- unfs_opts="nfsvers=3,port=%s,mountprog=%s,nfsprog=%s,udp,mountport=%s" % (nfsd_port, mountd_rpcport, nfsd_rpcport, mountd_port)
- self.unfs_opts = unfs_opts
+ # Figure out a new nfs_instance to allow multiple qemus running.
+ cmd = "ps aux"
+ ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ pattern = '/bin/unfsd .* -i .*\.pid -e .*/exports([0-9]+) '
+ all_instances = re.findall(pattern, ps, re.M)
+ if all_instances:
+ all_instances.sort(key=int)
+ self.nfs_instance = int(all_instances.pop()) + 1
+
+ mountd_rpcport = 21111 + self.nfs_instance
+ nfsd_rpcport = 11111 + self.nfs_instance
+ nfsd_port = 3049 + 2 * self.nfs_instance
+ mountd_port = 3048 + 2 * self.nfs_instance
+
+ # Export vars for runqemu-export-rootfs
+ export_dict = {
+ 'NFS_INSTANCE': self.nfs_instance,
+ 'MOUNTD_RPCPORT': mountd_rpcport,
+ 'NFSD_RPCPORT': nfsd_rpcport,
+ 'NFSD_PORT': nfsd_port,
+ 'MOUNTD_PORT': mountd_port,
+ }
+ for k, v in export_dict.items():
+ # Use '%s' since they are integers
+ os.putenv(k, '%s' % v)
- p = '%s/.runqemu-sdk/pseudo' % os.getenv('HOME')
- os.putenv('PSEUDO_LOCALSTATEDIR', p)
+ self.unfs_opts="nfsvers=3,port=%s,mountprog=%s,nfsprog=%s,udp,mountport=%s" % (nfsd_port, mountd_rpcport, nfsd_rpcport, mountd_port)
# Extract .tar.bz2 or .tar.bz if no self.nfs_dir
if not self.nfs_dir:
@@ -728,7 +744,7 @@ class BaseConfig(object):
self.nfs_dir = dest
# Start the userspace NFS server
- cmd = 'runqemu-export-rootfs restart %s' % self.nfs_dir
+ cmd = 'runqemu-export-rootfs start %s' % self.nfs_dir
logger.info('Running %s...' % cmd)
if subprocess.call(cmd, shell=True) != 0:
raise Exception('Failed to run %s' % cmd)
@@ -737,6 +753,8 @@ class BaseConfig(object):
def setup_slirp(self):
+ """Setup user networking"""
+
if self.fstype == 'nfs':
self.setup_nfs()
self.kernel_cmdline_script += ' ip=dhcp'
@@ -804,14 +822,13 @@ class BaseConfig(object):
logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.")
return 1
self.tap = tap
- n0 = tap[3:]
- n1 = int(n0) * 2 + 1
- n2 = n1 + 1
- self.nfs_instance = n0
+ tapnum = int(tap[3:])
+ gateway = tapnum * 2 + 1
+ client = gateway + 1
if self.fstype == 'nfs':
self.setup_nfs()
- self.kernel_cmdline_script += " ip=192.168.7.%s::192.168.7.%s:255.255.255.0" % (n2, n1)
- mac = "52:54:00:12:34:%02x" % n2
+ self.kernel_cmdline_script += " ip=192.168.7.%s::192.168.7.%s:255.255.255.0" % (client, gateway)
+ mac = "52:54:00:12:34:%02x" % client
qb_tap_opt = self.get('QB_TAP_OPT')
if qb_tap_opt:
qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap).replace('@MAC@', mac)
@@ -854,11 +871,11 @@ class BaseConfig(object):
vm_drive = '-drive if=none,id=hd,file=%s,format=%s -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd' \
% (self.rootfs, rootfs_format)
elif subprocess.call(cmd2, shell=True) == 0:
- logger.info('Using scsi drive')
+ logger.info('Using ide drive')
vm_drive = "%s,format=%s" % (self.rootfs, rootfs_format)
else:
logger.warn("Can't detect drive type %s" % self.rootfs)
- logger.warn('Tring to use virtio block drive')
+ logger.warn('Trying to use virtio block drive')
vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format)
self.rootfs_options = '%s -no-reboot' % vm_drive
self.kernel_cmdline = 'root=%s rw highres=off' % (self.get('QB_KERNEL_ROOT'))
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs
index 0dd3eba..7ebc071 100755
--- a/scripts/runqemu-export-rootfs
+++ b/scripts/runqemu-export-rootfs
@@ -78,13 +78,13 @@ if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then
fi
# rpc.mountd RPC port
-MOUNTD_RPCPORT=$[ 21111 + $NFS_INSTANCE ]
+MOUNTD_RPCPORT=${MOUNTD_RPCPORT:=$[ 21111 + $NFS_INSTANCE ]}
# rpc.nfsd RPC port
-NFSD_RPCPORT=$[ 11111 + $NFS_INSTANCE ]
+NFSD_RPCPORT=${NFSD_RPCPORT:=$[ 11111 + $NFS_INSTANCE ]}
# NFS server port number
-NFSD_PORT=$[ 3049 + 2 * $NFS_INSTANCE ]
+NFSD_PORT=${NFSD_PORT:=$[ 3049 + 2 * $NFS_INSTANCE ]}
# mountd port number
-MOUNTD_PORT=$[ 3048 + 2 * $NFS_INSTANCE ]
+MOUNTD_PORT=${MOUNTD_PORT:=$[ 3048 + 2 * $NFS_INSTANCE ]}
## For debugging you would additionally add
## --debug all
@@ -109,7 +109,7 @@ case "$1" in
fi
echo "Creating exports file..."
- echo "$NFS_EXPORT_DIR (rw,async,no_root_squash,no_all_squash,insecure)" > $EXPORTS
+ echo "$NFS_EXPORT_DIR (rw,no_root_squash,no_all_squash,insecure)" > $EXPORTS
echo "Starting User Mode nfsd"
echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS"
--
2.9.0
^ permalink raw reply related
* [PATCH V2 2/6] qemuboot.bbclass: use IMGDEPLOYDIR
From: Robert Yang @ 2016-12-06 8:55 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481014270.git.liezhi.yang@windriver.com>
So that "bitbake <image> -ccleansstate" can remove qemuboot.conf
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
meta/classes/qemuboot.bbclass | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 8b1d4d0..1f78a98 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -43,6 +43,7 @@ QB_OPT_APPEND ?= "-show-cursor"
# Create qemuboot.conf
addtask do_write_qemuboot_conf after do_rootfs before do_image
+IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete"
def qemuboot_vars(d):
build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
@@ -55,8 +56,8 @@ do_write_qemuboot_conf[vardeps] += "${@' '.join(qemuboot_vars(d))}"
python do_write_qemuboot_conf() {
import configparser
- qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_NAME', True))
- qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('DEPLOY_DIR_IMAGE', True), d.getVar('IMAGE_LINK_NAME', True))
+ qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR', True), d.getVar('IMAGE_NAME', True))
+ qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR', True), d.getVar('IMAGE_LINK_NAME', True))
cf = configparser.ConfigParser()
cf.add_section('config_bsp')
for k in qemuboot_vars(d):
--
2.9.0
^ permalink raw reply related
* [PATCH V2 1/6] scripts/runqemu: fix checking for <file>.cpio.gz
From: Robert Yang @ 2016-12-06 8:55 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1481014270.git.liezhi.yang@windriver.com>
When "runqemu /path/to/<file>.cpio.gz", it used the last suffix "gz" as
the fstype which was wrong. Check filename against self.fstypes firstly
can fix the problem.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
scripts/runqemu | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index af25423..c737eb2 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -269,19 +269,29 @@ class BaseConfig(object):
self.kernel = p
elif os.path.exists(p) and (not os.path.isdir(p)) and re.search('-image-', os.path.basename(p)):
self.rootfs = p
- dirpath = os.path.dirname(p)
- m = re.search('(.*)\.(.*)$', p)
- if m:
- qb = '%s%s' % (re.sub('\.rootfs$', '', m.group(1)), '.qemuboot.conf')
+ # Check filename against self.fstypes can hanlde <file>.cpio.gz,
+ # otherwise, its type would be "gz", which is incorrect.
+ fst = ""
+ for t in self.fstypes:
+ if p.endswith(t):
+ fst = t
+ break
+ if not fst:
+ m = re.search('.*\.(.*)$', self.rootfs)
+ if m:
+ fst = m.group(1)
+ if fst:
+ self.check_arg_fstype(fst)
+ qb = re.sub('\.' + fst + "$", '', self.rootfs)
+ qb = '%s%s' % (re.sub('\.rootfs$', '', qb), '.qemuboot.conf')
if os.path.exists(qb):
self.qemuboot = qb
self.qbconfload = True
else:
logger.warn("%s doesn't exist" % qb)
- fst = m.group(2)
- self.check_arg_fstype(fst)
else:
raise Exception("Can't find FSTYPE from: %s" % p)
+
elif os.path.isdir(p) or re.search(':', arg) and re.search('/', arg):
if self.is_deploy_dir_image(p):
logger.info('DEPLOY_DIR_IMAGE: %s' % p)
--
2.9.0
^ permalink raw reply related
* [PATCH V2 0/6] runqemu: fix for slirp, network device and hostfwd
From: Robert Yang @ 2016-12-06 8:55 UTC (permalink / raw)
To: openembedded-core
* V2
- Add QB_NETWORK_DEVICE to set network device for both slirp and tap,
the idea is from Randy and Nathan.
- Use different mac sections for slirp and tap to fix conflicts when
running both of them on the same host.
* V1
- Initial version
The following changes since commit 11063a01d4511b2688ea7ba2d7359e4e07328c66:
ruby: upgrade to 2.3.1 (2016-11-30 15:47:17 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/runqemu
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/runqemu
Robert Yang (6):
scripts/runqemu: fix checking for <file>.cpio.gz
qemuboot.bbclass: use IMGDEPLOYDIR
runqemu-export-rootfs: fix inconsistent var names
runqemu: support mutiple qemus running when nfs
runqemu: fixes for slirp, network device and hostfwd
qemuboot.bbclass: add blank lines in comments
meta/classes/qemuboot.bbclass | 34 ++++++--
meta/conf/machine/include/qemuboot-x86.inc | 1 -
meta/conf/machine/qemuarm64.conf | 1 -
scripts/runqemu | 133 ++++++++++++++++++++++-------
scripts/runqemu-export-rootfs | 21 ++---
5 files changed, 140 insertions(+), 50 deletions(-)
--
2.9.0
^ permalink raw reply
* Re: [PATCH 3/5] libsdl2: add EXTRA_OECONF[vardepsexclude] = "MACHINE"
From: Andreas Müller @ 2016-12-06 8:00 UTC (permalink / raw)
To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CAMKF1sorwZg-yF5k8NJBtDakZHqCZr0H=jvLP8mx8bkcU2B3Gg@mail.gmail.com>
On Tue, Dec 6, 2016 at 1:24 AM, Khem Raj <raj.khem@gmail.com> wrote:
> There probably is no need to use this additional variable. We can just use
> PKG_CONFIG_SYSROOT
Problem is not finding the wrong .pc files. Problem is that the output
of pkg-config must be prefixed to find the protocols.
Andreas
^ permalink raw reply
* Re: [PATCH 0/4] Load devtool and reciptool plugins in a well-defined manner
From: Ola x Nilsson @ 2016-12-06 7:37 UTC (permalink / raw)
To: openembedded-core@lists.openembedded.org; +Cc: paul.eggleton@linux.intel.com
In-Reply-To: <1477393415-13053-1-git-send-email-olani@axis.com>
Ping?
--
Ola x Nilsson
> -----Original Message-----
> From: Ola x Nilsson [mailto:olani@axis.com]
> Sent: den 25 oktober 2016 13:04
> To: Ola x Nilsson; openembedded-core@lists.openembedded.org
> Subject: [PATCH 0/4] Load devtool and reciptool plugins in a well-defined
> manner
>
> From: Ola x Nilsson <ola.x.nilsson@axis.com>
>
> Make devtool and recipetool load plugins in a well-defined and expected
> manner.
>
> devtool and reciptool search for pluings first in scripts/lib/<tool> and then in
> BBPATH. Each found plugin is loaded, which means that any plugin found
> later in BBPATH shadows previously loaded plugins.
> plugin_init is loaded for all plugins, no matter whether they are later
> replaced. register_plugin is called once for each time a plugin with a certain
> name is found, but it is always called on the last loaded plugin.
>
> Change the scriptutils.load_plugins function to never load a plugin file if one
> with the same filename has already been loaded. This means that the first
> found plugin wins.
>
> Change the load order to first search BBPATH and then scripts/lib/tools. This
> means that plugins in scripts/lib/<tool> can be shadowed by plugins in layers.
>
> Ola x Nilsson (4):
> devtool: selftest: add test for devtool plugin loading
> recipetool: selftest: Add test for recipetool plugin loading
> devtool: Load plugins in a well defined order
> recipetool: Load plugins in a well defined order
>
> meta-selftest/lib/devtool/bbpath.py | 44
> ++++++++++++++++++++++++++++++++++
> meta-selftest/lib/recipetool/bbpath.py | 41
> +++++++++++++++++++++++++++++++
> meta/lib/oeqa/selftest/devtool.py | 43
> +++++++++++++++++++++++++++++++++
> meta/lib/oeqa/selftest/recipetool.py | 44
> ++++++++++++++++++++++++++++++++++
> scripts/devtool | 3 ++-
> scripts/lib/scriptutils.py | 8 +++++--
> scripts/recipetool | 4 ++--
> 7 files changed, 182 insertions(+), 5 deletions(-) create mode 100644 meta-
> selftest/lib/devtool/bbpath.py
> create mode 100644 meta-selftest/lib/recipetool/bbpath.py
>
> --
> 2.1.4
^ permalink raw reply
* Re: [PATCH 1/2] diffutils: do_configure: fix "Argument list too long"
From: Khem Raj @ 2016-12-06 2:38 UTC (permalink / raw)
To: Robert Yang; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <a9bde40d-5322-c9e3-ac47-3801b520e80b@windriver.com>
> On Dec 5, 2016, at 6:11 PM, Robert Yang <liezhi.yang@windriver.com> wrote:
>
>
>
> On 12/06/2016 02:23 AM, Khem Raj wrote:
>> On Mon, Dec 5, 2016 at 6:54 AM, Robert Yang <liezhi.yang@windriver.com> wrote:
>>> Fixed when len(TMPDIR) = 410:
>>> aclocal: error: cannot open echo [snip]: Argument list too long
>>>
>>> This is becuase it has a lot of m4 files, use relative path for them
>>> can fix the problem.
>>>
>>> It doesn't happen when MACHINE="qemux86", I think it is because
>>> intel-x86-64 is longer than qemux86.
>>>
>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>> ---
>>> meta/recipes-extended/diffutils/diffutils_3.4.bb | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/meta/recipes-extended/diffutils/diffutils_3.4.bb b/meta/recipes-extended/diffutils/diffutils_3.4.bb
>>> index cb7092b..be280ec 100644
>>> --- a/meta/recipes-extended/diffutils/diffutils_3.4.bb
>>> +++ b/meta/recipes-extended/diffutils/diffutils_3.4.bb
>>> @@ -10,6 +10,9 @@ SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
>>>
>>> EXTRA_OECONF += "--without-libsigsegv-prefix"
>>>
>>> +# Fix "Argument list too long" error when len(TMPDIR) = 410
>>> +acpaths = "-I ./m4"
>>
>> it looks ok if this work ok with externalsrc
>
> Hi Khem,
>
> What did mean about externalsrc, please ? Did you mean when B != S?
yeah,
> If yes, it works well since it is for aclocal, which always runs in S.
seems to be the case. Then we should be fine.
> We have already such a fix in several recipes.
>
> meta/recipes-extended/tar/tar.inc:acpaths = "-I ./m4"
> meta/recipes-extended/wget/wget.inc:acpaths = "-I ./m4"
> meta/recipes-core/coreutils/coreutils_6.9.bb:acpaths = "-I ./m4"
> meta/recipes-core/coreutils/coreutils_8.25.bb:acpaths = "-I ./m4"
>
> // Robert
>
>>
>>> +
>>> do_configure_prepend () {
>>> # Need to remove gettext macros with weird mix of versions
>>> for i in codeset.m4 gettext_gl.m4 intlmacosx.m4 inttypes-pri.m4 lib-ld_gl.m4 lib-prefix_gl.m4 po_gl.m4 ssize_t.m4 wchar_t.m4 wint_t.m4; do
>>> --
>>> 2.9.0
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
^ permalink raw reply
* oetest.py construction of pkgmanifest is probably wrong
From: Slater, Joseph @ 2016-12-06 2:24 UTC (permalink / raw)
To: openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 198 bytes --]
This variable is a dictionary with entries based on package, but for multillib a package might exist in only some variants. Perhaps
each entry should be a dictionary of multilib variants?
Joe
[-- Attachment #2: Type: text/html, Size: 1889 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] diffutils: do_configure: fix "Argument list too long"
From: Robert Yang @ 2016-12-06 2:11 UTC (permalink / raw)
To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CAMKF1so3kwUrinR7HWarC+CPd+1d1mby2_-H-5XE3XQb3PzZaw@mail.gmail.com>
On 12/06/2016 02:23 AM, Khem Raj wrote:
> On Mon, Dec 5, 2016 at 6:54 AM, Robert Yang <liezhi.yang@windriver.com> wrote:
>> Fixed when len(TMPDIR) = 410:
>> aclocal: error: cannot open echo [snip]: Argument list too long
>>
>> This is becuase it has a lot of m4 files, use relative path for them
>> can fix the problem.
>>
>> It doesn't happen when MACHINE="qemux86", I think it is because
>> intel-x86-64 is longer than qemux86.
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>> meta/recipes-extended/diffutils/diffutils_3.4.bb | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/meta/recipes-extended/diffutils/diffutils_3.4.bb b/meta/recipes-extended/diffutils/diffutils_3.4.bb
>> index cb7092b..be280ec 100644
>> --- a/meta/recipes-extended/diffutils/diffutils_3.4.bb
>> +++ b/meta/recipes-extended/diffutils/diffutils_3.4.bb
>> @@ -10,6 +10,9 @@ SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
>>
>> EXTRA_OECONF += "--without-libsigsegv-prefix"
>>
>> +# Fix "Argument list too long" error when len(TMPDIR) = 410
>> +acpaths = "-I ./m4"
>
> it looks ok if this work ok with externalsrc
Hi Khem,
What did mean about externalsrc, please ? Did you mean when B != S?
If yes, it works well since it is for aclocal, which always runs in S.
We have already such a fix in several recipes.
meta/recipes-extended/tar/tar.inc:acpaths = "-I ./m4"
meta/recipes-extended/wget/wget.inc:acpaths = "-I ./m4"
meta/recipes-core/coreutils/coreutils_6.9.bb:acpaths = "-I ./m4"
meta/recipes-core/coreutils/coreutils_8.25.bb:acpaths = "-I ./m4"
// Robert
>
>> +
>> do_configure_prepend () {
>> # Need to remove gettext macros with weird mix of versions
>> for i in codeset.m4 gettext_gl.m4 intlmacosx.m4 inttypes-pri.m4 lib-ld_gl.m4 lib-prefix_gl.m4 po_gl.m4 ssize_t.m4 wchar_t.m4 wint_t.m4; do
>> --
>> 2.9.0
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
^ permalink raw reply
* Re: [PATCH 3/5] libsdl2: add EXTRA_OECONF[vardepsexclude] = "MACHINE"
From: Khem Raj @ 2016-12-06 0:24 UTC (permalink / raw)
To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <1480983561-11437-3-git-send-email-schnitzeltony@googlemail.com>
[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]
There probably is no need to use this additional variable. We can just use
PKG_CONFIG_SYSROOT
On Dec 5, 2016 4:19 PM, "Andreas Müller" <schnitzeltony@googlemail.com>
wrote:
> fixes Martin's MACHINE checksum test [1]
>
> [1] http://lists.openembedded.org/pipermail/openembedded-core/
> 2016-November/129464.html
>
> Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
> ---
> meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb
> b/meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb
> index ac7312b..b104a43 100644
> --- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb
> +++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb
> @@ -34,6 +34,7 @@ EXTRA_OECONF = "--disable-oss --disable-esd
> --disable-arts \
> --enable-sdl-dlopen \
> --disable-rpath \
> WAYLAND_PROTOCOLS_SYSROOT_DIR=${STAGING_DIR}/${MACHINE}"
> +EXTRA_OECONF[vardepsexclude] = "MACHINE"
>
> # opengl packageconfig factored out to make it easy for distros
> # and BSP layers to pick either (desktop) opengl, gles2, or no GL
> --
> 2.5.5
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 2573 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox