Date   

[PATCH 3/3] Validate Recipe autopopulated fields

Ioana Grigoropol <ioanax.grigoropol@...>
 

- validate that generated md5sums and sha256 sums are valid before populating the fields
- clear all previous commands output (like after source & bitbake -e) in order to limit output parsing

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@...>
---
.../org/yocto/bc/remote/utils/RemoteHelper.java | 3 --
.../remote/utils/YoctoHostShellProcessAdapter.java | 8 ++++--
.../ui/wizards/NewBitBakeFileRecipeWizardPage.java | 29 ++++++++++----------
3 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java
index 430dc6d..9c88ee7 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java
@@ -301,8 +301,6 @@ public class RemoteHelper {
}

public static void runBatchRemote(IHost connection, List<YoctoCommand> cmds, IProgressMonitor monitor, boolean waitForOutput) throws CoreException {
- connection.getHostName();
- connection.getDefaultUserId();
try {
String remoteCommand = "";
for (YoctoCommand cmd : cmds) {
@@ -364,5 +362,4 @@ public class RemoteHelper {
}
return false;
}
-
}
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java
index a772dc4..b75401c 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java
@@ -11,7 +11,6 @@ import org.eclipse.rse.services.shells.IHostOutput;
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
import org.eclipse.rse.services.shells.IHostShellOutputReader;
-import org.eclipse.swt.widgets.Display;

public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter{
private ProcessStreamBuffer processStreamBuffer;
@@ -75,7 +74,6 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter{

private void reportProgress(String info) {

-
if(calculator == null) {
updateMonitor(1);
} else {
@@ -125,7 +123,6 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter{
this.commandResponseHandler.response(value, false);
}
}
-
AbstractHostShellOutputReader absReader = (AbstractHostShellOutputReader)reader;
isAlive = absReader.isAlive();
isFinished = absReader.isFinished();
@@ -145,4 +142,9 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter{
public void setAlive(boolean isAlive) {
this.isAlive = isAlive;
}
+
+ public void clearProcessBuffer() {
+ this.processStreamBuffer.outputLines.clear();
+ this.processStreamBuffer.errorLines.clear();
+ }
}
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java
index f45158f..eac1211 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java
@@ -18,6 +18,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import java.util.regex.Pattern;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
@@ -95,6 +96,8 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {
private static final String CONFIGURE_IN = "configure.in";
private static final String CONFIGURE_AC = "configure.ac";
private static final String AUTOTOOLS = "autotools";
+ private static final String md5Pattern = "^[0-9a-e]{32}$";
+ protected static final String sha256Pattern = "^[0-9a-e]{64}$";

public NewBitBakeFileRecipeWizardPage(ISelection selection, IHost connection) {
super("wizardPage");
@@ -302,14 +305,6 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {
} catch (Exception e) {
e.printStackTrace();
}
-// populateRecipeName(srcURI);
-// populateSrcUriChecksum(srcURI, monitor);
-//
-// URI extractDir = extractPackage(srcURI, monitor);
-// populateLicenseFileChecksum(extractDir, monitor);
-// updateSrcUri(createMirrorLookupTable(monitor), srcURI);
-// populateInheritance(extractDir, monitor);
-
} else {
String packageName = getSrcFileName(false).replace("-", "_");
fileText.setText(packageName + BB_RECIPE_EXT);
@@ -318,10 +313,7 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {
}
} catch (URISyntaxException e) {
e.printStackTrace();
- } /*catch (MalformedURLException e) {
- e.printStackTrace();
- }*/
-
+ }
}

private void handleLocalPopulate(URI srcURI, IProgressMonitor monitor) {
@@ -330,6 +322,7 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {
}

private void handleRemotePopulate(URI srcURI, IProgressMonitor monitor) throws Exception {
+ RemoteHelper.clearProcessBuffer(connection);
populateRecipeName(srcURI);
List<YoctoCommand> commands = new ArrayList<YoctoCommand>();

@@ -363,9 +356,12 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {
updateSrcUri(createMirrorLookupTable(monitor), srcURI);
populateInheritance(extractDir, monitor);

- md5sumText.setText(retrieveSum(md5YCmd));
- sha256sumText.setText(retrieveSum(sha256YCmd));
- checksumText.setText(RemoteHelper.createNewURI(extractDir, COPYING_FILE).toString() + ";md5=" + retrieveSum(licenseChecksumCmd));
+ String md5Val = retrieveSum(md5YCmd);
+ md5sumText.setText(Pattern.matches(md5Pattern, md5Val) ? md5Val : "");
+ String sha256Val = retrieveSum(sha256YCmd);
+ sha256sumText.setText(Pattern.matches(sha256Pattern, sha256Val) ? sha256Val : "");
+ String checkSumVal = retrieveSum(licenseChecksumCmd);
+ checksumText.setText(RemoteHelper.createNewURI(extractDir, COPYING_FILE).toString() + ";md5=" + (Pattern.matches(md5Pattern, checkSumVal) ? checkSumVal : ""));
}

private String retrieveSum(YoctoCommand cmd) {
@@ -409,6 +405,9 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {

private void populateInheritance(URI extractDir, IProgressMonitor monitor) {
IHostFile[] hostFiles = RemoteHelper.getRemoteDirContent(connection, metaDirLoc.getPath(), "", IFileService.FILE_TYPE_FILES, monitor);
+ if (hostFiles == null)
+ return;
+
for (IHostFile file: hostFiles) {
String fileName = file.getName();
if (fileName.equalsIgnoreCase(CMAKE_LIST)){
--
1.7.9.5


[PATCH 2/3] Fix Bitbake commander project wizard

Ioana Grigoropol <ioanax.grigoropol@...>
 

- do not run git task in a loop
- wait for the command to finish - use ModalContext.allowReadAndDispatch(false) - (needs some fixes for upstream RSE API - TBA)

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@...>
---
.../yocto/bc/ui/wizards/install/InstallWizard.java | 27 ++++++++++----------
1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
index dd2074c..d780cbf 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
@@ -9,6 +9,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.ptp.remote.core.IRemoteConnection;
@@ -114,12 +115,12 @@ public class InstallWizard extends FiniteStateWizard implements IWorkbenchWizard

if (((Boolean)options.get(GIT_CLONE)).booleanValue()) {
String[] cmd = {"/usr/bin/git clone --progress", "git://git.yoctoproject.org/poky.git", uri.getPath()};
+// String[] cmd = {"md5sum /home/builder/socks-gw"};
LongtimeRunningTask runningTask = new LongtimeRunningTask("Checking out Yocto git repository", cmd,
((IRemoteConnection)model.get(InstallWizard.SELECTED_CONNECTION)),
((IRemoteServices)model.get(InstallWizard.SELECTED_REMOTE_SERVICE)));
+ ModalContext.setAllowReadAndDispatch(false);
this.getContainer().run(false, false, runningTask);
-// while (!runningTask.isFinished)
-// Thread.sleep(2);
}

CommandResponseHandler cmdHandler = RemoteHelper.getCommandHandler(RemoteHelper.getRemoteConnectionByName(((IRemoteConnection)model.get(InstallWizard.SELECTED_CONNECTION)).getName()));
@@ -183,7 +184,7 @@ public class InstallWizard extends FiniteStateWizard implements IWorkbenchWizard

synchronized public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
- boolean cancel = false;
+// boolean cancel = false;
try {
monitor.beginTask(taskName, TOTALWORKLOAD);

@@ -203,17 +204,17 @@ public class InstallWizard extends FiniteStateWizard implements IWorkbenchWizard
for (int i = 1; i < cmdArray.length; i++)
args += cmdArray[i] + " ";
try {
- while (!cancel) {
- if(monitor.isCanceled()) {
- cancel=true;
- throw new InterruptedException("User Cancelled");
- }
- boolean hasErrors = RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(connection.getName()), new YoctoCommand(cmdArray[0], "", args), monitor);
- if (hasErrors)
- break;
+// while (!cancel) {
+// if(monitor.isCanceled()) {
+// cancel=true;
+// throw new InterruptedException("User Cancelled");
+// }
+ RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(connection.getName()), new YoctoCommand(cmdArray[0], "", args), monitor);
+// if (hasErrors)
+// break;

- Thread.sleep(5000);
- }
+// Thread.sleep(5000);
+// }
} catch (Exception e) {
e.printStackTrace();
} finally {
--
1.7.9.5


[PATCH 1/3] Initialize bitbake session & environment parse variables

Ioana Grigoropol <ioanax.grigoropol@...>
 

- source oe-init-env for the connection shell
- parse environment variables

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@...>
---
.../src/org/yocto/bc/bitbake/BBSession.java | 13 +++--
.../src/org/yocto/bc/bitbake/ShellSession.java | 53 ++++++++------------
2 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/BBSession.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/BBSession.java
index e182d05..5f919c3 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/BBSession.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/BBSession.java
@@ -329,18 +329,17 @@ public class BBSession implements IBBSessionListener, IModelElement, Map {
}
}

- protected int checkExecuteError(String result, int code) {
+ protected void checkExecuteError(String result, boolean hasErrors) {
URI recipeURI = getDefaultDepends();
String text = "Parsing " + ((recipeURI != null) ? ("recipe " + recipeURI) : "base configurations");
- if (code != 0) {
+ if (hasErrors) {
text = text + " ERROR!\n" + result;
}else {
text = text + " SUCCESS.\n";
}
if(!silent) {
- displayInConsole(text, code, false);
+ displayInConsole(text, -1, false);
}
- return code;
}

protected void displayInConsole(final String result, final int code, boolean clear) {
@@ -377,9 +376,9 @@ public class BBSession implements IBBSessionListener, IModelElement, Map {
}
try {
if(!initialized) { //recheck
- int [] codes = {-1};
- String result = shell.execute(parsingCmd, codes);
- if(checkExecuteError(result, codes[0]) == 0) {
+ boolean hasErrors = false;
+ String result = shell.execute(parsingCmd, hasErrors);
+ if(!hasErrors) {
properties = parseBBEnvironment(result);
} else {
properties = parseBBEnvironment("");
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
index a7ed3d6..a8c46dd 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
@@ -20,6 +20,7 @@ import java.io.Writer;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.services.files.IHostFile;
import org.yocto.bc.remote.utils.RemoteHelper;
import org.yocto.bc.remote.utils.YoctoCommand;
@@ -92,43 +93,29 @@ public class ShellSession {
}

private void initializeShell(IProgressMonitor monitor) throws IOException {
-// try {
-// RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(projectInfo.getConnection().getName()), new YoctoCommand("source " + initCmd, root.getAbsolutePath(), ""), monitor);
-// } catch (CoreException e) {
-// e.printStackTrace();
-// }
-
-// process = Runtime.getRuntime().exec(shellPath);
-// pos = process.getOutputStream();
-//
-// if (root != null) {
-// out.write(execute("cd " + root.getAbsolutePath()));
-// }
-//
-// if (initCmd != null) {
-// out.write(execute("source " + initCmd));
-// }
+ try {
+ IHost connection = RemoteHelper.getRemoteConnectionByName(projectInfo.getConnection().getName());
+ RemoteHelper.runCommandRemote(connection, new YoctoCommand("source " + initCmd, root.getAbsolutePath(), ""), monitor);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}

synchronized
public String execute(String command) throws IOException {
- return execute(command, (int [])null);
+ return execute(command, false);
}

synchronized
- public String execute(String command, int[] retCode) throws IOException {
- //FIXME : parse output
-// try {
-// RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(projectInfo.getConnection().getName()), new YoctoCommand(command, root.getAbsolutePath(), ""), new NullProgressMonitor());
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
-//
-// String errorMessage = null;
-// interrupt = false;
-// out.write(command);
-// out.write(LT);
-//
+ public String execute(String command, boolean hasErrors) throws IOException {
+ try {
+ IHost connection = RemoteHelper.getRemoteConnectionByName(projectInfo.getConnection().getName());
+ hasErrors = RemoteHelper.runCommandRemote(connection, new YoctoCommand(command, root.getAbsolutePath(), ""), new NullProgressMonitor());
+ return RemoteHelper.getProcessBuffer(connection).getMergedOutputLines();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
// sendToProcessAndTerminate(command);
//
// if (process.getErrorStream().available() > 0) {
@@ -143,7 +130,7 @@ public class ShellSession {
// BufferedReader br = new BufferedReader(new InputStreamReader(process
// .getInputStream()));
//
- StringBuffer sb = new StringBuffer();
+// StringBuffer sb = new StringBuffer();
// String line = null;

// while (((line = br.readLine()) != null) && !line.endsWith(TERMINATOR) && !interrupt) {
@@ -169,8 +156,8 @@ public class ShellSession {
// if (errorMessage != null) {
// throw new IOException(errorMessage);
// }
-
- return sb.toString();
+//
+// return sb.toString();
}

synchronized
--
1.7.9.5


mail list for Xilinx Zynq platform?

Daniel Martinez Ramos <daniel.martinez@...>
 

Hi all,

I've found a bsp layer in Xilinx here http://forums.xilinx.com/t5/Embedded-Linux/Yocto-BSP-for-ZC-702/td-p/246932, which is pretty interesting.

Is any mail list under Yocto for the Xilinx Zinq platform?

Best regards,

Daniel Martinez


How to handle src.rpm packages

Christian Ege <chege@...>
 

Hello,

I am interested in how to handle source code inside of a src.rpm package. There had been a patch from Mark Hatle which handles the rpm packages inside the fetcher2. In his patch he suggests to handle Patches inside the rpm in the following way:


file://${WORKDIR}/mypatch.patch

When I tried this inside the SRC_URI declaration I always get en error like this:

NOTE: Running task 439 of 669 (ID: 4, /home/chris/src/poky-denzil/meta-stlinux/recipes-core/stslave/stslave_0.7.bb, do_fetch)
NOTE: package stslave-0.7-r1: task do_fetch: Started
ERROR: Function failed: Fetcher failure for URL: 'file:///home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/temp/log.do_fetch.25817
Log data follows:
| DEBUG: Trying PREMIRRORS
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['bzr', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['cvs', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['git', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['hg', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['osc', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['p4', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['svk', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: For url ['file', '', '/home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz', '', '', {}] comparing ['svn', '.*', '/.*', '', '', {}] to ['http', 'downloads.yoctoproject.org', '/mirror/sources/', '', '', {}]
| DEBUG: Trying Upstream
| ERROR: Function failed: Fetcher failure for URL: 'file:///home/chris/src/poky-denzil/spark7162-build/tmp/work/sh4-poky-linux/stslave-0.7-r1/stslave-0.7.tar.gz'. Unable to fetch URL from any source.

Yes of course I can just let fetcher2 extract all the files an afterwards apply the patches by hand. But I think there should be a more generic way to handle this. I hope I can get some hints how to solve this.




with kind regards,

Christian


[Package Report System]Upgrade recipes name list

Yocto Project Package Report System <package-reporting@...>
 

This mail was sent out by Package Report System.
This message list those recipes which need to be upgraded. If maintainers believe some of them needn't to upgrade this time, they can fill in RECIPE_NO_UPDATE_REASON_pn-"xxx" in upstream_tracking files to ignore this recipe remainder until newer upstream version was detected.
Example:
RECIPE_NO_UPDATE_REASON_pn-"xxx" = "Not upgrade to 2.0 because the new version is unstable"
You can check the detail information at http://packages.yoctoproject.org/upgradepkgname


PackageName Version UpVersion Maintainer NoUpgradeReason
Upgradable Count: 0
Upgrade Total Count: 0
The based commit merge time is:
Tue Nov 20 13:06:48 2012 -0800
The based commit is:
commit 9cb9eadb844a4e05551b2c5811908c848cd50e59
Author: Ross Burton <ross.burton@...>
Date: Tue Nov 20 18:18:11 2012 +0000
Any problem, please contact Saul Wold <sgw@...>


[Package Report System]Manual check recipes name list

Yocto Project Package Report System <package-reporting@...>
 

This mail was sent out by Package Report System.
It will list all the recipes which can't check upstream version by script, and will show how long it is since their last mannual version check.
You can check the detail information at http://packages.yoctoproject.org/manuallychkinfo


PackageName Version LastChkVersion LastChkTime Maintainer NoUpgradeReason
Manual Check Count: 0
Manual Need Check Count: 0
Any problem, please contact Saul Wold <sgw@...>


does meta-intel/meta-tlk layer require a README.sources file?

Robert P. J. Day
 

more annoying pedantry, but from what i read in the current yocto
BSP manual, a BSP layer *requires* a README.sources file, but there is
no such file in the meta-intel/meta-tlk layer, although i can
appreciate that that layer isn't *really* a BSP definition. or is it?

can someone clarify this? is there a clear explanation as to what
is required for a simple *layer* and what is required for an actual
BSP definition?

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================


Re: inconsistent pages out there for setting up your yocto dev host

Wolfgang Denk <wd@...>
 

Dear Paul,

In message <3038126.PEqOPPdATB@helios> you wrote:

if you're on an allegedly supported distro, and you do an upgrade,
it's entirely possible that one of those bits of software gets
upgraded in a way that breaks OE/yocto, and by using ASSUME_PROVIDED,
you'll automatically start using that newer utility. or is the list
of supported distros specifically only those installed out of the box
and never updated? if that's the case, then, yes, i agree with your
position.
That's why we test specific versions of distributions, and with the Poky distro
config we warn the user if the distro/distro version is untested. It's rare
that you get that kind of breakage between major versions; if there were then
other applications are likely to be affected so it would be considered a
regression in that distro.
But of course there have always been, and will always be, such
regressions. Just look at Fedora 17 (one of the supported versions of
distributions), if one of the updates pulls in git version 1.7.11.7
and suddenly all git downloads using HTTP protocol will fail for you
(due to bug 865692, see https://bugzilla.redhat.com/show_bug.cgi?id=865692)

Actually it may make a lot of sense for certain configurations to
bootstrap more tools from a known version of the sources.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@...
Beware of the Turing Tar-pit in which everything is possible but
nothing of interest is easy.


IMAGE_INSTALL_append workflow

Trevor Woerner
 

There have been many emails and lots of documentation describing how
to add a package to a build, and that's all great.

Today I was playing around with an image I had already built and
decided I wanted to add a new package to the mix: trace-cmd. I added "
trace-cmd" (with the required leading space) to IMAGE_INSTALL_append
and re-ran my "bitbake <image>" command.

It failed:

Unable to resolve package trace-cmd

If I perform:

$ bitbake trace-cmd

and then

$ bitbake <image>

it works fine. What am I missing?

As it turns out, if I knew before my first build that I wanted
trace-cmd, I could have just added it as described above and
everything would have worked as well.

Best regards,
Trevor


Re: inconsistent pages out there for setting up your yocto dev host

Robert P. J. Day
 

On Fri, 23 Nov 2012, Paul Eggleton wrote:

Well, we don't test with any other value of ASSUME_PROVIDED. If you
add tools to ASSUME_PROVIDED that we would have otherwise built so
that the host tools are used, we haven't tested the build with those
host tools. Equally if you remove items from the default value of
ASSUME_PROVIDED, we don't necessarily fully test the system with
native tools that we don't normally build (although that's less
likely to be an issue than the other case).

I'm not saying you can't change the value of ASSUME_PROVIDED - just
that if you do and the build breaks, you get to keep both pieces :)
completely understood. for the sake of classroom work, i'm going to
experiment with adding extra entries to speed things up, and watch if
anything breaks. my first choice would be to add subversion to
ASSUME_PROVIDED -- that seems fairly safe, any moderately current
version of subversion should work.

thanks.

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================


Re: inconsistent pages out there for setting up your yocto dev host

Paul Eggleton
 

On Friday 23 November 2012 09:31:39 Robert P. J. Day wrote:
On Thu, 22 Nov 2012, Paul Eggleton wrote:
On Thursday 22 November 2012 06:54:33 Robert P. J. Day wrote:
first, is ASSUME_PROVIDED technically completely superfluous?

it's clearly meant to speed up processing, but could one (if one
wanted) unset it and have the processing still work (albeit more
slowly, of course)?
If you like building things that you don't have to, sure, but I
wouldn't equate that to it being superfluous. Note that if you do
change this variable you are deviating from what has been tested, so
you do so at your own risk.
wait, this point interests me so indulge me for a minute.
obviously, there is a minimum collection of software one must install
before starting to use OE/yocto -- at the very least, say, the
fetching software -- so there will always be a page instructing a
developer to install that minimum.

afterwards, you can use ASSUME_PROVIDED to take advantage of that
software, correct? and that will certainly speed things up. but in
what way does that represent a "tested" configuration?
Well, we don't test with any other value of ASSUME_PROVIDED. If you add tools
to ASSUME_PROVIDED that we would have otherwise built so that the host tools
are used, we haven't tested the build with those host tools. Equally if you
remove items from the default value of ASSUME_PROVIDED, we don't necessarily
fully test the system with native tools that we don't normally build (although
that's less likely to be an issue than the other case).

I'm not saying you can't change the value of ASSUME_PROVIDED - just that if
you do and the build breaks, you get to keep both pieces :)

if you're on an allegedly supported distro, and you do an upgrade,
it's entirely possible that one of those bits of software gets
upgraded in a way that breaks OE/yocto, and by using ASSUME_PROVIDED,
you'll automatically start using that newer utility. or is the list
of supported distros specifically only those installed out of the box
and never updated? if that's the case, then, yes, i agree with your
position.
That's why we test specific versions of distributions, and with the Poky distro
config we warn the user if the distro/distro version is untested. It's rare
that you get that kind of breakage between major versions; if there were then
other applications are likely to be affected so it would be considered a
regression in that distro.

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre


Re: inconsistent pages out there for setting up your yocto dev host

Robert P. J. Day
 

On Thu, 22 Nov 2012, Paul Eggleton wrote:

On Thursday 22 November 2012 06:54:33 Robert P. J. Day wrote:
first, is ASSUME_PROVIDED technically completely superfluous?
it's clearly meant to speed up processing, but could one (if one
wanted) unset it and have the processing still work (albeit more
slowly, of course)?
If you like building things that you don't have to, sure, but I
wouldn't equate that to it being superfluous. Note that if you do
change this variable you are deviating from what has been tested, so
you do so at your own risk.
wait, this point interests me so indulge me for a minute.
obviously, there is a minimum collection of software one must install
before starting to use OE/yocto -- at the very least, say, the
fetching software -- so there will always be a page instructing a
developer to install that minimum.

afterwards, you can use ASSUME_PROVIDED to take advantage of that
software, correct? and that will certainly speed things up. but in
what way does that represent a "tested" configuration?

if you're on an allegedly supported distro, and you do an upgrade,
it's entirely possible that one of those bits of software gets
upgraded in a way that breaks OE/yocto, and by using ASSUME_PROVIDED,
you'll automatically start using that newer utility. or is the list
of supported distros specifically only those installed out of the box
and never updated? if that's the case, then, yes, i agree with your
position.

i'm not trying to be maddeningly pedantic, i am merely succeeding.

rday


--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================


Re: Wiki Main page terrible sparse

Maxin John <Maxin.John@...>
 

Hi Alex,
Hello all,
I can't help but notice that the main page of the Yocto Wiki looks somewhat underwhelming compared to the new site face.
Can we please have a volunteer to update and beautify a bit the main page ?
I am interested in this task. I have already sent a request for access to the Yocto Wiki.

I'd think that we need to list current 1.4 pages, add/verify links to all main sections, and the Yocto logo, etc...
We can discuss the list of activities in this mailing-list or in irc (nickname: maxin)

Cheers,
Alex
Best Regards,
Maxin


Wiki Main page terrible sparse

Damian, Alexandru <alexandru.damian@...>
 

Hello all,

I can't help but notice that the main page of the Yocto Wiki looks somewhat underwhelming compared to the new site face.

Can we please have a volunteer to update and beautify a bit the main page ?

I'd think that we need to list current 1.4 pages, add/verify links to all main sections, and the Yocto logo, etc...

Cheers,
Alex


[meta-xilinx] Update maintainers contact informaton

Adrian Alonso <aalonso00@...>
 

Hi all,

Please welcome Elvis Dowson as new maintainer for meta-xilinx bsp layer.

Elvis had provide fixes over the last months for this layer and I'm pretty
sure that he can improve and move forward this layer.

This BSP layer allows to create a custom Linux distro that can be
deployed in Xilinx FPGA's which can either have a soft-cpu model or a
traditional CPU like PowerPC or ARM Cortex A9.

@Richard, Jeffrey please help Elvis to get write access in this repo.

--
Regards
Adrian Alonso
http://aalonso.wordpress.com


Re: Ada layer for Yocto

Paul Eggleton
 

On Thursday 22 November 2012 14:00:33 Luke A. Guest wrote:
I managed to get my Ada layer going for the official gumstix repo. I had
the code in the wrong bbappend file, should be the gcc-cross, not the
gcc one.

The repo is here: https://github.com/Lucretia/meta-ada
Thanks, I've added the layer to the layerindex [1].

Cheers,
Paul

[1] http://www.openembedded.org/wiki/LayerIndex

--

Paul Eggleton
Intel Open Source Technology Centre


[PATCH] Add console fixes & run commands in a synchronous way

Ioana Grigoropol <ioanax.grigoropol@...>
 

- when creating a new Yocto Project, the window does not wait for the process to complete, and closes beforehand
- the long time running task will be created without forking and monitor will be updated when receiving events from the YoctoHostShellProcessAdapter
- use AbstractHostShellReader.isFinished to wait for command outputs

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@...>
---
.../src/org/yocto/bc/bitbake/ShellSession.java | 13 +-
.../org/yocto/bc/remote/utils/ConsoleHelper.java | 18 +--
.../bc/remote/utils/ConsoleHelperRunnable.java | 31 +++++
.../org/yocto/bc/remote/utils/ConsoleRunnable.java | 37 ++++++
.../org/yocto/bc/remote/utils/RemoteHelper.java | 34 +++--
.../org/yocto/bc/remote/utils/RemoteMachine.java | 6 +-
.../remote/utils/YoctoHostShellProcessAdapter.java | 140 +++++++++++++-------
.../bc/ui/wizards/NewBitBakeFileRecipeWizard.java | 2 +-
.../ui/wizards/NewBitBakeFileRecipeWizardPage.java | 10 +-
.../yocto/bc/ui/wizards/install/InstallWizard.java | 86 +++---------
10 files changed, 217 insertions(+), 160 deletions(-)
create mode 100644 plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelperRunnable.java
create mode 100644 plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleRunnable.java

diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
index 06978fb..a7ed3d6 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
@@ -18,7 +18,6 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Writer;

-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.rse.services.files.IHostFile;
@@ -119,12 +118,12 @@ public class ShellSession {
synchronized
public String execute(String command, int[] retCode) throws IOException {
//FIXME : parse output
- try {
- RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(projectInfo.getConnection().getName()), new YoctoCommand(command, root.getAbsolutePath(), ""), new NullProgressMonitor(), true);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
+// try {
+// RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(projectInfo.getConnection().getName()), new YoctoCommand(command, root.getAbsolutePath(), ""), new NullProgressMonitor());
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+//
// String errorMessage = null;
// interrupt = false;
// out.write(command);
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelper.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelper.java
index 4655fe0..25bd9f9 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelper.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelper.java
@@ -1,14 +1,9 @@
package org.yocto.bc.remote.utils;

-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.IConsoleView;
import org.eclipse.ui.console.MessageConsole;

public class ConsoleHelper {
@@ -28,15 +23,6 @@ public class ConsoleHelper {
}

public static void showConsole(MessageConsole console){
- IWorkbench wb = PlatformUI.getWorkbench();
- IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
- IWorkbenchPage page = win.getActivePage();
- String id = IConsoleConstants.ID_CONSOLE_VIEW;
- try {
- IConsoleView view = (IConsoleView) page.showView(id);
- view.display(console);
- } catch (Exception e) {
- e.printStackTrace();
- }
+ Display.getDefault().syncExec(new ConsoleRunnable(console));
}
}
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelperRunnable.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelperRunnable.java
new file mode 100644
index 0000000..36f6b70
--- /dev/null
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleHelperRunnable.java
@@ -0,0 +1,31 @@
+package org.yocto.bc.remote.utils;
+
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsoleView;
+import org.eclipse.ui.console.MessageConsole;
+
+public class ConsoleHelperRunnable implements Runnable {
+ MessageConsole console;
+
+ ConsoleHelperRunnable(MessageConsole console){
+ this.console = console;
+ }
+ @Override
+ public void run() {
+ IWorkbench wb = PlatformUI.getWorkbench();
+ IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
+ IWorkbenchPage page = win.getActivePage();
+ String id = IConsoleConstants.ID_CONSOLE_VIEW;
+ try {
+ IConsoleView view = (IConsoleView) page.showView(id);
+ view.display(console);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleRunnable.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleRunnable.java
new file mode 100644
index 0000000..b665fed
--- /dev/null
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleRunnable.java
@@ -0,0 +1,37 @@
+package org.yocto.bc.remote.utils;
+
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsoleView;
+import org.eclipse.ui.console.MessageConsole;
+
+public class ConsoleRunnable implements Runnable{
+ MessageConsole console;
+ ConsoleRunnable (MessageConsole console){
+ this.console = console;
+ }
+ @Override
+ public void run() {
+ IWorkbench wb = PlatformUI.getWorkbench();
+ if (wb == null)
+ return;
+ IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
+ if (win == null)
+ return;
+ IWorkbenchPage page = win.getActivePage();
+ if (page == null)
+ return;
+ String id = IConsoleConstants.ID_CONSOLE_VIEW;
+ try {
+ IConsoleView view = (IConsoleView) page.showView(id);
+ if (view == null)
+ return;
+ view.display(console);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java
index 18e216f..430dc6d 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteHelper.java
@@ -34,7 +34,6 @@ import org.eclipse.rse.services.IService;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.services.files.IHostFile;
-import org.eclipse.rse.services.shells.HostShellProcessAdapter;
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
@@ -46,6 +45,7 @@ import org.yocto.bc.ui.Activator;
import org.yocto.bc.ui.wizards.install.Messages;

public class RemoteHelper {
+ public static final int TOTALWORKLOAD = 100;
private static Map<IHost, RemoteMachine> machines;

public static RemoteMachine getRemoteMachine(IHost connection){
@@ -68,7 +68,7 @@ public class RemoteHelper {
return getRemoteMachine(connection).getCmdHandler();
}

- public static HostShellProcessAdapter getHostShellProcessAdapter(IHost connection) {
+ public static YoctoHostShellProcessAdapter getHostShellProcessAdapter(IHost connection) {
return getRemoteMachine(connection).getHostShellProcessAdapter();
}

@@ -270,24 +270,34 @@ public class RemoteHelper {
return null;
}

- public static void runCommandRemote(IHost connection, YoctoCommand cmd, IProgressMonitor monitor, boolean waitForOutput) throws Exception {
+ public static boolean runCommandRemote(IHost connection, YoctoCommand cmd, IProgressMonitor monitor) throws Exception {
String remoteCommand = cmd.getCommand() + " " + cmd.getArguments();
-
+ boolean hasErrors = false;
try {
if (!cmd.getInitialDirectory().isEmpty()) {
- writeToShell(connection, "cd " + cmd.getInitialDirectory(), waitForOutput);
+ hasErrors = writeToShell(connection, "cd " + cmd.getInitialDirectory(), monitor);
}
- writeToShell(connection, remoteCommand, waitForOutput);
+ if (!hasErrors)
+ return writeToShell(connection, remoteCommand, monitor);
} catch (Exception e) {
e.printStackTrace();
}
+ return hasErrors;
}

- public static void writeToShell(IHost connection, String remoteCommand, boolean waitForOutput){
- YoctoHostShellProcessAdapter hostShellProcessAdapter = ((YoctoHostShellProcessAdapter)getHostShellProcessAdapter(connection));
- hostShellProcessAdapter.setWaitForOutput(waitForOutput);
- hostShellProcessAdapter.setLastCommand(remoteCommand);
+ public static boolean writeToShell(IHost connection, String remoteCommand, IProgressMonitor monitor){
+ YoctoHostShellProcessAdapter hostShellProcessAdapter = getHostShellProcessAdapter(connection);
+ hostShellProcessAdapter.setMonitor(monitor);
getHostShell(connection).writeToShell(remoteCommand);
+
+ try {
+ while (!hostShellProcessAdapter.isFinished() && hostShellProcessAdapter.isAlive()) {
+ Thread.sleep(2);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return hostShellProcessAdapter.hasErrors();
}

public static void runBatchRemote(IHost connection, List<YoctoCommand> cmds, IProgressMonitor monitor, boolean waitForOutput) throws CoreException {
@@ -298,9 +308,9 @@ public class RemoteHelper {
for (YoctoCommand cmd : cmds) {
remoteCommand = cmd.getCommand() + " " + cmd.getArguments();
if (!cmd.getInitialDirectory().isEmpty()) {
- writeToShell(connection, "cd " + cmd.getInitialDirectory(), waitForOutput);
+ writeToShell(connection, "cd " + cmd.getInitialDirectory(), monitor);
}
- writeToShell(connection, remoteCommand, waitForOutput);
+ writeToShell(connection, remoteCommand, monitor);
}
} catch (Exception e1) {
e1.printStackTrace();
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteMachine.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteMachine.java
index 40e2c7e..a953ef7 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteMachine.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/RemoteMachine.java
@@ -12,7 +12,6 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.files.IFileService;
-import org.eclipse.rse.services.shells.HostShellProcessAdapter;
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IShellService;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
@@ -27,7 +26,7 @@ public class RemoteMachine {
private MessageConsole console;
private CommandResponseHandler cmdHandler;
private IHostShell hostShell;
- private HostShellProcessAdapter hostShellProcessAdapter;
+ private YoctoHostShellProcessAdapter hostShellProcessAdapter;
private IShellService shellService;
private ProcessStreamBuffer processBuffer;
private IHost connection;
@@ -61,7 +60,6 @@ public class RemoteMachine {
try {
if (hostShell == null) {
hostShell = getShellService(new NullProgressMonitor()).launchShell("", new String[]{}, new NullProgressMonitor());
- getHostShellProcessAdapter();
}
} catch (SystemMessageException e) {
e.printStackTrace();
@@ -71,7 +69,7 @@ public class RemoteMachine {
return hostShell;
}

- public HostShellProcessAdapter getHostShellProcessAdapter() {
+ public YoctoHostShellProcessAdapter getHostShellProcessAdapter() {
try {
if (hostShellProcessAdapter == null)
hostShellProcessAdapter = new YoctoHostShellProcessAdapter(getHostShell(), getProcessBuffer(), getCmdHandler());
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java
index 198d6a1..a772dc4 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java
@@ -1,65 +1,113 @@
package org.yocto.bc.remote.utils;

import java.io.IOException;
-import java.util.concurrent.Semaphore;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;

+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.rse.services.shells.AbstractHostShellOutputReader;
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
import org.eclipse.rse.services.shells.IHostOutput;
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
import org.eclipse.rse.services.shells.IHostShellOutputReader;
+import org.eclipse.swt.widgets.Display;

public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter{
- private String commandPrompt = null;
- private static final String ROOT = "root";
- private static final String PROMPT_USER_CH = "$";
- private static final String PROMPT_ROOT_CH = "#";
-
private ProcessStreamBuffer processStreamBuffer;
private CommandResponseHandler commandResponseHandler;
- private Semaphore sem;
- private String lastCommand;
- private boolean waitForOutput;
- private String endChar = null;
+ private boolean isFinished;
+ private ICalculatePercentage calculator;
+ private int reportedWorkload;
+ private IProgressMonitor monitor;
+ private boolean isAlive;

- public String getLastCommand() {
- return lastCommand;
+ public IProgressMonitor getMonitor() {
+ return monitor;
}

- public void setLastCommand(String lastCommand) {
- if (waitForOutput) {
- try {
- // there are still some processed that might take a long time and if we do not wait for them,
- // then the semaphore will not be released, because an interrupted exception will occur
- Thread.sleep(2000);
- sem.acquire();
- } catch (InterruptedException e) {
- e.printStackTrace();
+ public void setMonitor(IProgressMonitor monitor) {
+ this.monitor = monitor;
+ }
+
+ private interface ICalculatePercentage {
+ public float calWorkloadDone(String info) throws IllegalArgumentException;
+ }
+
+ private class GitCalculatePercentage implements ICalculatePercentage {
+ final Pattern pattern = Pattern.compile("^Receiving objects:\\s*(\\d+)%.*");
+ public float calWorkloadDone(String info) throws IllegalArgumentException {
+ Matcher m = pattern.matcher(info.trim());
+ if(m.matches()) {
+ return new Float(m.group(1)) / 100;
+ }else {
+ throw new IllegalArgumentException();
}
}
- this.lastCommand = lastCommand.trim();
}
-
+
public YoctoHostShellProcessAdapter(IHostShell hostShell, ProcessStreamBuffer processStreamBuffer, CommandResponseHandler commandResponseHandler) throws IOException {
super(hostShell);
this.processStreamBuffer = processStreamBuffer;
this.commandResponseHandler = commandResponseHandler;
- this.sem = new Semaphore(1);
- this.lastCommand = "";
+ this.calculator = new GitCalculatePercentage();
}

+ private void updateMonitor(final int work){
+// Display.getDefault().syncExec(new Runnable() {
+//
+// @Override
+// public void run() {
+// monitor.worked(work);
+// }
+// });
+ }
+
+ private void doneMonitor(){
+// Display.getCurrent().syncExec(new Runnable() {
+//
+// @Override
+// public void run() {
+// monitor.done();
+// }
+// });
+ }
+
+ private void reportProgress(String info) {
+
+
+ if(calculator == null) {
+ updateMonitor(1);
+ } else {
+ float percentage;
+ try {
+ percentage = calculator.calWorkloadDone(info);
+ } catch (IllegalArgumentException e) {
+ System.out.println(info);
+ //can't get percentage
+ return;
+ }
+ int delta = (int) (RemoteHelper.TOTALWORKLOAD * percentage - reportedWorkload);
+ if( delta > 0 ) {
+ updateMonitor(delta);
+ reportedWorkload += delta;
+ }
+
+ if (reportedWorkload == RemoteHelper.TOTALWORKLOAD)
+ doneMonitor();
+ }
+ }
+
@Override
public void shellOutputChanged(IHostShellChangeEvent event) {
IHostShellOutputReader reader = event.getReader();
IHostOutput[] lines = event.getLines();
-
if (reader.isErrorReader()) {
for (IHostOutput line : lines) {
String value = line.getString();
if (value.isEmpty()) {
continue;
}
- setCommandPrompt(value);
System.out.println(value);
this.processStreamBuffer.addErrorLine(value);
this.commandResponseHandler.response(value, false);
@@ -70,41 +118,31 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter{
if (value.isEmpty()) {
continue;
}
- setCommandPrompt(value);
- if (value.startsWith(commandPrompt) && value.endsWith(endChar) &&
- !value.endsWith(lastCommand) && processStreamBuffer.getLastOutputLineContaining(lastCommand) != null &&
- waitForOutput) {
- sem.release();
- }

+ reportProgress(value);
System.out.println(value);
this.processStreamBuffer.addOutputLine(value);
this.commandResponseHandler.response(value, false);
}
}
-// super.shellOutputChanged(event);
+
+ AbstractHostShellOutputReader absReader = (AbstractHostShellOutputReader)reader;
+ isAlive = absReader.isAlive();
+ isFinished = absReader.isFinished();
}

- private void setCommandPrompt(String value) {
- if (commandPrompt == null) {
- if (value.startsWith(ROOT) && value.indexOf(PROMPT_ROOT_CH) != -1) {
- int end = value.indexOf(PROMPT_ROOT_CH);
- commandPrompt = value.substring(0, end);
- endChar = PROMPT_ROOT_CH;
- } else if (value.indexOf(PROMPT_USER_CH) != -1) {
- int end = value.indexOf(PROMPT_USER_CH);
- commandPrompt = value.substring(0, end);
- endChar = PROMPT_USER_CH;
- }
-
- }
+ public boolean isFinished() {
+ return isFinished;
+ }
+ public boolean hasErrors(){
+ return this.processStreamBuffer.errorLines.size() != 0;
}

- public boolean isWaitForOutput() {
- return waitForOutput;
+ public boolean isAlive() {
+ return isAlive;
}

- public void setWaitForOutput(boolean waitForOutput) {
- this.waitForOutput = waitForOutput;
+ public void setAlive(boolean isAlive) {
+ this.isAlive = isAlive;
}
}
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizard.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizard.java
index f820e21..73b21f5 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizard.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizard.java
@@ -205,7 +205,7 @@ public class NewBitBakeFileRecipeWizard extends Wizard implements INewWizard {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
doFinish(element, monitor);
- RemoteHelper.runCommandRemote(connection, new YoctoCommand("rm -rf temp", element.getMetaDir() + "/temp", ""), monitor, true);
+ RemoteHelper.runCommandRemote(connection, new YoctoCommand("rm -rf temp", element.getMetaDir() + "/temp", ""), monitor);
} catch (Exception e) {
throw new InvocationTargetException(e);
} finally {
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java
index cea0724..f45158f 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/NewBitBakeFileRecipeWizardPage.java
@@ -352,11 +352,11 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {

String md5Cmd = "md5sum " + getSrcFileName(true);
YoctoCommand md5YCmd = new YoctoCommand(md5Cmd, tempFolderPath, "");
- RemoteHelper.runCommandRemote(connection, md5YCmd, monitor, true);
+ RemoteHelper.runCommandRemote(connection, md5YCmd, monitor);

String sha256Cmd = "sha256sum " + getSrcFileName(true);
YoctoCommand sha256YCmd = new YoctoCommand(sha256Cmd, tempFolderPath, "");
- RemoteHelper.runCommandRemote(connection, sha256YCmd, monitor, true);
+ RemoteHelper.runCommandRemote(connection, sha256YCmd, monitor);

URI extractDir = extractPackage(srcURI, monitor);
YoctoCommand licenseChecksumCmd = populateLicenseFileChecksum(extractDir, monitor);
@@ -388,7 +388,7 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {
tarCmd += "-xvf ";
}

- RemoteHelper.runCommandRemote(connection, new YoctoCommand(tarCmd + path, tempFolderPath, ""), monitor, true);
+ RemoteHelper.runCommandRemote(connection, new YoctoCommand(tarCmd + path, tempFolderPath, ""), monitor);

return RemoteHelper.createNewURI(metaDirLoc, TEMP_FOLDER_NAME + "/" + getSrcFileName(false));

@@ -427,7 +427,7 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {

try {
YoctoCommand catCmd = new YoctoCommand("md5sum " + COPYING_FILE, extractDir.getPath(), "");
- RemoteHelper.runCommandRemote(connection, catCmd, monitor, true);
+ RemoteHelper.runCommandRemote(connection, catCmd, monitor);
return catCmd;
} catch (Exception e) {
throw new RuntimeException("Unable to process file for MD5 calculation", e);
@@ -495,7 +495,7 @@ public class NewBitBakeFileRecipeWizardPage extends WizardPage {
HashMap<String, String> mirrorMap = new HashMap<String, String>();

YoctoCommand cmd = new YoctoCommand("cat " + MIRRORS_FILE, getMetaFolderPath() + CLASSES_FOLDER, "");
- RemoteHelper.runCommandRemote(connection, cmd, monitor, true);
+ RemoteHelper.runCommandRemote(connection, cmd, monitor);

if (!cmd.getProcessBuffer().hasErrors()){
String delims = "[\\t]+";
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
index 2401664..dd2074c 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/install/InstallWizard.java
@@ -1,12 +1,9 @@
package org.yocto.bc.ui.wizards.install;

-import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
import java.util.Hashtable;
import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -21,7 +18,6 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.console.MessageConsole;
-import org.yocto.bc.bitbake.ICommandResponseHandler;
import org.yocto.bc.remote.utils.CommandResponseHandler;
import org.yocto.bc.remote.utils.ConsoleWriter;
import org.yocto.bc.remote.utils.RemoteHelper;
@@ -118,23 +114,14 @@ public class InstallWizard extends FiniteStateWizard implements IWorkbenchWizard

if (((Boolean)options.get(GIT_CLONE)).booleanValue()) {
String[] cmd = {"/usr/bin/git clone --progress", "git://git.yoctoproject.org/poky.git", uri.getPath()};
- final Pattern pattern = Pattern.compile("^Receiving objects:\\s*(\\d+)%.*");
- LongtimeRunningTask runningTask = new LongtimeRunningTask("Checking out Yocto git repository", cmd, null, null,
+ LongtimeRunningTask runningTask = new LongtimeRunningTask("Checking out Yocto git repository", cmd,
((IRemoteConnection)model.get(InstallWizard.SELECTED_CONNECTION)),
- ((IRemoteServices)model.get(InstallWizard.SELECTED_REMOTE_SERVICE)),
- new ICalculatePercentage() {
- public float calWorkloadDone(String info) throws IllegalArgumentException {
- Matcher m = pattern.matcher(info.trim());
- if(m.matches()) {
- return new Float(m.group(1)) / 100;
- }else {
- throw new IllegalArgumentException();
- }
- }
- }
- );
- this.getContainer().run(true,true, runningTask);
+ ((IRemoteServices)model.get(InstallWizard.SELECTED_REMOTE_SERVICE)));
+ this.getContainer().run(false, false, runningTask);
+// while (!runningTask.isFinished)
+// Thread.sleep(2);
}
+
CommandResponseHandler cmdHandler = RemoteHelper.getCommandHandler(RemoteHelper.getRemoteConnectionByName(((IRemoteConnection)model.get(InstallWizard.SELECTED_CONNECTION)).getName()));
if (!cmdHandler.hasError()) {
String initPath = "";
@@ -177,62 +164,27 @@ public class InstallWizard extends FiniteStateWizard implements IWorkbenchWizard
public void init(IWorkbench workbench, IStructuredSelection selection) {
}

- private interface ICalculatePercentage {
- public float calWorkloadDone(String info) throws IllegalArgumentException;
- }
-
private class LongtimeRunningTask implements IRunnableWithProgress {
static public final int TOTALWORKLOAD = 100;

private String []cmdArray;
- private Process process;
private String taskName;
- private int reported_workload;
private IRemoteConnection connection;
private IRemoteServices remoteServices;

- ICalculatePercentage cal;
-
public LongtimeRunningTask(String taskName,
- String []cmdArray, String []envp, File dir,
- IRemoteConnection connection, IRemoteServices remoteServices,
- ICalculatePercentage calculator) {
+ String []cmdArray,
+ IRemoteConnection connection, IRemoteServices remoteServices) {
this.taskName = taskName;
this.cmdArray = cmdArray;
- this.process = null;
- this.cal = calculator;
this.connection = connection;
-// this.handler = RemoteHelper.getCommandHandler(RemoteHelper.getRemoteConnectionByName(connection.getName()));
this.remoteServices = remoteServices;
}

-// private void reportProgress(IProgressMonitor monitor,String info) {
-// if(cal == null) {
-// monitor.worked(1);
-// }else {
-// float percentage;
-// try {
-// percentage=cal.calWorkloadDone(info);
-// } catch (IllegalArgumentException e) {
-// //can't get percentage
-// return;
-// }
-// int delta=(int) (TOTALWORKLOAD * percentage - reported_workload);
-// if( delta > 0 ) {
-// monitor.worked(delta);
-// reported_workload += delta;
-// }
-// }
-// }
-
synchronized public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
-
-// boolean cancel = false;
- reported_workload = 0;
-
+ boolean cancel = false;
try {
-
monitor.beginTask(taskName, TOTALWORKLOAD);

if (!connection.isOpen()) {
@@ -251,18 +203,24 @@ public class InstallWizard extends FiniteStateWizard implements IWorkbenchWizard
for (int i = 1; i < cmdArray.length; i++)
args += cmdArray[i] + " ";
try {
- RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(connection.getName()), new YoctoCommand(cmdArray[0], "", args), monitor, true);
- RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(connection.getName()), new YoctoCommand("pwd", "", ""), monitor, true);
+ while (!cancel) {
+ if(monitor.isCanceled()) {
+ cancel=true;
+ throw new InterruptedException("User Cancelled");
+ }
+ boolean hasErrors = RemoteHelper.runCommandRemote(RemoteHelper.getRemoteConnectionByName(connection.getName()), new YoctoCommand(cmdArray[0], "", args), monitor);
+ if (hasErrors)
+ break;
+
+ Thread.sleep(5000);
+ }
} catch (Exception e) {
e.printStackTrace();
+ } finally {
+ monitor.done();
}
} catch (Exception e) {
e.printStackTrace();
- } finally {
- monitor.done();
- if (process != null ) {
- process.destroy();
- }
}
}
}
--
1.7.9.5


Re: inconsistent pages out there for setting up your yocto dev host

Paul Eggleton
 

On Thursday 22 November 2012 06:54:33 Robert P. J. Day wrote:
On Thu, 22 Nov 2012, Paul Eggleton wrote:
On Wednesday 21 November 2012 20:19:05 Robert P. J. Day wrote:
On Wed, 21 Nov 2012, Paul Eggleton wrote:
On Wednesday 21 November 2012 17:23:56 Robert P. J. Day wrote:
as i read it, the sanity.bbclass and ASSUME_PROVIDED will
dictate what needs to be there and what will be used if it's
installed natively, no? it certainly seems that that wiki
page is insructing the developer to install a lot of software
that OE will handle automatically, no?
Er, no. Well, if by "handle automatically" you mean "error out
when they are not present" then that's not very helpful - it's
much easier if people just get a list of what they need to
install up front.
at the risk of asking a dumb question, let me make sure i

understand the different categories of software.

first, there's what is absolutely *required* to be installed on

the development system already before doing any oe/yocto work.
those would the packages/utilities that are listed on the wiki
page as "you must install this", and that's what's represented in
the sanity.bbclass. is that about right?

on the other hand, there's what's listed in ASSUME_PROVIDED,

which represents software that, if it *is* natively installed,
will be used; otherwise, oe/yocto will download and build it as
part of the build process. correct? or have i misunderstood the
distinction here?
I think you may have. All ASSUME_PROVIDED does is tell bitbake that
dependencies on the things within it should be considered to be
satisfied - i.e. "assume these things are provided". If you add
something to ASSUME_PROVIDED that is genuinely needed by the build
process and it isn't actually provided by the host system, then you
will get build failures or at the very least undesirable changes in
build behaviour.
ok, after a good night's sleep, i re-read what i wrote above and i
sound like an idiot so let me try again.

first, there's sanity.bbclass, which contains:

SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar gzip
gawk chrpath wget cpio"

which represents the utilities that *must* already exist before
bitbake will offer to do anything. yes, it's obvious, but i just
confirmed that by removing "diffstat", whereupon i got:

ERROR: OE-core's config sanity checker detected a potential
misconfiguration. Either fix the cause of this error or at your own risk
disable the checker (see sanity.conf). Following is the list of potential
problems / advisories:

Please install the following missing utilities: diffstat

so that's good, it's what i expected. it also suggests that, in
terms of minimal software, it's valid to just point people at that
variable in sanity.bbclass -- technically, those utilities are the
ones developers should be ordered to install beforehand. so far, so
good.

now, regarding ASSUME_PROVIDED in bitbake.conf, as you say, that
represents any dependencies assumed to be satisfied for further
processing, and it's not surprising that those two lists are closely
related -- if, for example, the sanity checker requires bzip2 (as it
does), it's only natural that ASSUME_PROVIDED would contain
"bzip2-native." and so on, and so on. and now, a few questions that
probably have obvious answers but i'll ask them, anyway.

first, is ASSUME_PROVIDED technically completely superfluous? it's
clearly meant to speed up processing, but could one (if one wanted)
unset it and have the processing still work (albeit more slowly, of
course)?
If you like building things that you don't have to, sure, but I wouldn't
equate that to it being superfluous. Note that if you do change this variable
you are deviating from what has been tested, so you do so at your own risk.

next, what about this in bitbake.conf, right after the setting of
ASSUME_PROVIDED?

# gzip-native should be listed above?

should it? seems to make sense -- why did someone feel the need to
leave a comment asking that question?
Not sure. We do now build pigz-native instead of using the system gzip though,
that might have something to do with it not being in the list.

next, while ASSUME_PROVIDED contains "grep-native", the sanity check
doesn't list grep. should it? it just seems natural that anything
you assume to be provided should be listed as an installation
requirement first.
Probably yes.

finally (and because i don't read python all that well, i can't
check the code as quickly as i would like), how would one add
subversion to one or both of the above? after all, the utility name
is "svn" but the package name (used by recipes) is "subversion".
(sure seems like subversion would be a good requirement to avoid
building it.)
The important thing to remember is SANITY_REQUIRED_UTILITIES is a list of
commands, and ASSUME_PROVIDED is a list of targets that the build system
understands; items in each must be specified accordingly. For subversion the
command is "svn" and the target is "subversion-native". Specifically in the
case of subversion, if I recall corectly we used to list it there but a few
versions ago we found that some people's installed versions of subversion were
too old to handle the new repository format that upstream projects have
upgraded to, so we had little choice but to build it ourselves.

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre


Ada layer for Yocto

Luke A. Guest <laguest@...>
 

Hi,

I managed to get my Ada layer going for the official gumstix repo. I had
the code in the wrong bbappend file, should be the gcc-cross, not the
gcc one.

The repo is here: https://github.com/Lucretia/meta-ada

This is currently very basic support and I will be adding more. Please
see the README for problems. Please test and help me refine it.

Luke.