Date   

[PATCH v7] [399231] Fix race conditions when reading using LocalShellOutputReader(s)

Ioana Grigoropol <ioanax.grigoropol@...>
 

When running a remote command with a Local connection from a Linux host a new LocalHostShell is created.
At this time, a new LocalHostThread is launched, along side with two LocalShellOutputReaders (output and error). The constructors for the OutputReaders will receive a reference to the reader created by the LocalHostThread.

When calling runCommandRemote, the newly created IHostShell is returned, making it possible to create an adapter(IHostShellProcessAdapter) that will then be used to read all available output from the readers.
When the LocalShellThread finishes running its run() method, it will perform a cleanup causing both readers (output and error) to be closed.
If at this point, there are any readers, or handlers to the readers that are still trying to read data (read using handlers readers), an error will be thrown saying that the the pipe to the stream is closed ("Ensure open stream"/ "Pipe closed" errors).
After inspecting the internalReadLine, it seems that it expects a null reference of the reader in order to consider that the reading is done.
In order to ensure that this will happen once the LocalShellThread closes the stream(s), we will make sure that the reference to the readers is set to null, and that LocalShellOutputReader(s) use the same reference of the reader as the LocalShellThread. For this to happen, a reference of the thread must be kept in the reader, in order to retrieve the correct reference of the underlying reader.
Since there can still be race conditions in this solution, all operations that involve the reference to now the only reader, must be performed under mutual exclusion using a shared lock between the LocalShellOutputReader and LocalShellThread.

[update]: do not modify any of the readers;use the shell instead

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@...>
---
.../services/dstore/shells/DStoreHostShell.java | 10 ++++++++
.../services/local/shells/LocalHostShell.java | 15 +++++++++++-
.../services/local/shells/LocalShellThread.java | 18 +++++++++++++++
.../.settings/.api_filters | 22 ++++++++++++++++++
.../services/shells/TerminalServiceHostShell.java | 24 ++++++++++++++------
.../eclipse/rse/services/shells/IHostShell.java | 14 ++++++++++--
6 files changed, 93 insertions(+), 10 deletions(-)

diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreHostShell.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreHostShell.java
index 06763d3..f220581 100644
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreHostShell.java
+++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreHostShell.java
@@ -14,10 +14,13 @@
* Contributors:
* David McKnight (IBM) [251619] [dstore] shell output readers not cleaned up on disconnect
* David McKnight (IBM) [244070] [dstore] DStoreHostShell#exit() does not terminate child processes
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.dstore.shells;

+import java.io.BufferedReader;
+import java.util.concurrent.locks.Lock;
import org.eclipse.dstore.core.model.DE;
import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.core.model.DataStore;
@@ -92,5 +95,12 @@ public class DStoreHostShell extends AbstractHostShell implements IHostShell

}

+ public Lock getLock() {
+ return null;
+ }
+
+ public BufferedReader getReader(boolean isErrorReader) {
+ return null;
+ }

}
diff --git a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java
index 250a904..1ddb0ae 100644
--- a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java
+++ b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java
@@ -13,10 +13,13 @@
*
* Contributors:
* Martin Oberhuber (Wind River) - [161838] local shell reports isActive() wrong
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.local.shells;

+import java.io.BufferedReader;
+import java.util.concurrent.locks.Lock;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.rse.internal.services.local.shells.LocalShellOutputReader;
import org.eclipse.rse.internal.services.local.shells.LocalShellThread;
@@ -38,7 +41,7 @@ public class LocalHostShell extends AbstractHostShell implements IHostShell
{
_shellThread = new LocalShellThread(initialWorkingDirectory, invocation, encoding, environment);
_stdoutHandler = new LocalShellOutputReader(this, _shellThread.getOutputStream(), false);
- _stderrHandler = new LocalShellOutputReader(this, _shellThread.getErrorStream(),true);
+ _stderrHandler = new LocalShellOutputReader(this, _shellThread.getErrorStream(), true);
}

protected void run(IProgressMonitor monitor)
@@ -84,5 +87,15 @@ public class LocalHostShell extends AbstractHostShell implements IHostShell
writeToShell("exit"); //$NON-NLS-1$
}

+ public Lock getLock() {
+ return _shellThread.getLock();
+ }
+
+ public BufferedReader getReader(boolean isErrorReader) {
+ if (isErrorReader)
+ return _shellThread.getErrorStream();
+ else
+ return _shellThread.getOutputStream();
+ }

}
diff --git a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java
index 0a33ad4..28e8ad9 100644
--- a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java
+++ b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java
@@ -17,6 +17,7 @@
* David McKnight (IBM) - [189387] Use specified encoding for shell output
* Martin Oberhuber (Wind River) - [161838] local shell reports isActive() wrong
* Anna Dushistova (MontaVsita) - [249354] Incorrect behaviour of local shells subsystem runCommand method
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.local.shells;
@@ -29,6 +30,8 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;

import org.eclipse.core.runtime.FileLocator;

@@ -62,6 +65,7 @@ public class LocalShellThread extends Thread
private BufferedReader _stdInput;
private BufferedReader _stdError;

+ private Lock _lock;
/**
* constructor for local command shell monitor
*
@@ -260,6 +264,7 @@ public class LocalShellThread extends Thread

_stdError = new BufferedReader(new InputStreamReader(_theProcess.getErrorStream()));

+ _lock = new ReentrantLock();
}
catch (IOException e)
{
@@ -438,9 +443,14 @@ public class LocalShellThread extends Thread
_isDone = true;
try
{
+ _lock.lock();
_stdInput.close();
_stdError.close();

+ _stdInput = null;
+ _stdError = null;
+
+ _lock.unlock();
if (_theProcess != null)
{

@@ -511,4 +521,12 @@ public class LocalShellThread extends Thread
}


+ public Lock getLock() {
+ return _lock;
+ }
+
+ public void setLock(Lock _lock) {
+ this._lock = _lock;
+ }
+
}
diff --git a/rse/plugins/org.eclipse.rse.services/.settings/.api_filters b/rse/plugins/org.eclipse.rse.services/.settings/.api_filters
index 19273c2..11a5ad4 100644
--- a/rse/plugins/org.eclipse.rse.services/.settings/.api_filters
+++ b/rse/plugins/org.eclipse.rse.services/.settings/.api_filters
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.rse.services" version="2">
+ <resource path="META-INF/MANIFEST.MF">
+ <filter id="923795461">
+ <message_arguments>
+ <message_argument value="3.2.200"/>
+ <message_argument value="3.2.200"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.rse.internal.services.terminals.AbstractTerminalService">
<filter id="305324134">
<message_arguments>
@@ -119,4 +127,18 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/rse/services/shells/IHostShell.java" type="org.eclipse.rse.services.shells.IHostShell">
+ <filter id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.rse.services.shells.IHostShell"/>
+ <message_argument value="getLock()"/>
+ </message_arguments>
+ </filter>
+ <filter id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.rse.services.shells.IHostShell"/>
+ <message_argument value="getReader(boolean)"/>
+ </message_arguments>
+ </filter>
+ </resource>
</component>
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceHostShell.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceHostShell.java
index 2a461ad..9699e3a 100644
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceHostShell.java
+++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceHostShell.java
@@ -22,6 +22,7 @@
* Anna Dushistova (MontaVista) - [258720] SshHostShell fails to run command if initialWorkingDirectory supplied
* Rob Stryker (JBoss) - [335059] TerminalServiceShellOutputReader logs error when hostShell.exit() is called
* Martin Oberhuber (Wind River) - [356132] wait for initial output
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.shells;
@@ -32,6 +33,8 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.Charset;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Pattern;

import org.eclipse.rse.services.clientserver.PathUtility;
@@ -54,27 +57,27 @@ public class TerminalServiceHostShell extends AbstractHostShell {

private TerminalServiceShellWriterThread fShellWriter;

+ private BufferedReader fBufReader;
public TerminalServiceHostShell(ITerminalShell terminalShell,
String initialWorkingDirectory, String commandToRun,
String[] environment) {
try {
fTerminalShell = terminalShell;
String encoding = fTerminalShell.getDefaultEncoding();
- BufferedReader bufReader;
if (encoding != null) {
- bufReader = new BufferedReader(new InputStreamReader(fTerminalShell
+ fBufReader = new BufferedReader(new InputStreamReader(fTerminalShell
.getInputStream(), encoding));
} else {
- bufReader = new BufferedReader(new InputStreamReader(fTerminalShell
+ fBufReader = new BufferedReader(new InputStreamReader(fTerminalShell
.getInputStream()));
}
//bug 356132: wait for initial output before sending any command
//FIXME this should likely move into the TerminalServiceShellWriterThread, so wait can be canceled
- bufReader.mark(1);
- bufReader.read();
- bufReader.reset();
+ fBufReader.mark(1);
+ fBufReader.read();
+ fBufReader.reset();

- fStdoutHandler = new TerminalServiceShellOutputReader(this, bufReader, false);
+ fStdoutHandler = new TerminalServiceShellOutputReader(this, fBufReader, false);
fStderrHandler = new TerminalServiceShellOutputReader(this, null, true);
OutputStream outputStream = fTerminalShell.getOutputStream();
if (encoding != null) {
@@ -170,4 +173,11 @@ public class TerminalServiceHostShell extends AbstractHostShell {
return "echo $PWD'>'"; //$NON-NLS-1$
}

+ public Lock getLock() {
+ return new ReentrantLock();
+ }
+
+ public BufferedReader getReader(boolean isErrorReader) {
+ return fBufReader;
+ }
}
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java
index 8139cfc..ed49c1d 100644
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java
+++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShell.java
@@ -11,11 +11,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
- * {Name} (company) - description of contribution.
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
********************************************************************************/

package org.eclipse.rse.services.shells;

+import java.io.BufferedReader;
+import java.util.concurrent.locks.Lock;

public interface IHostShell
{
@@ -28,5 +30,13 @@ public interface IHostShell
public IHostShellOutputReader getStandardErrorReader();

public void exit();
+ /**
+ * @since 3.2
+ */
+ public Lock getLock();
+ /**
+ * @since 3.2
+ */
+ public BufferedReader getReader(boolean isErrorReader);

-}
\ No newline at end of file
+}
--
1.7.9.5


Re: Build external module against Yocto kernel

Bruce Ashfield <bruce.ashfield@...>
 

On 13-01-23 10:17 AM, Patrick Turley wrote:

On Jan 23, 2013, at 7:48 AM, Bruce Ashfield<bruce.ashfield@...>
wrote:
On 13-01-23 12:34 AM, Patrick Turley wrote:

On Jan 22, 2013, at 11:17 PM, Bruce Ashfield<bruce.ashfield@...> wrote:

On 13-01-23 12:14 AM, Patrick Turley wrote:
On Jan 22, 2013, at 10:43 PM, Bruce Ashfield<bruce.ashfield@...> wrote:
On 13-01-22 9:26 PM, Patrick Turley wrote:
Argh. I'll have to just run the commands myself and stop spamming the
list with ideas :) It's just a matter of making lkc accept the defaults
(i.e. you could also use allyesconfig, or allnoconfig) or even better
not trigger that config check at all.
You're very kind to have spent so much time on my problem already. I look forward to hearing back.
I'm not sure if you are still interested in this topic, but I took
a few minutes to look into this more today .. just to understand
exactly what is happening.

It is what was discussed on the thread already, when you invoke
make scripts, there is an explicit dependency on auto.conf and
that is what triggers the make oldconfig if the .config is newer
than it is. Technically we are safe from this, assuming that the
.config and captured auto.conf match, and that auto.conf is in the
SDK.

The other way that oldconfig is triggered in my experience (and
testing today) is what we mentioned before. If your .config was
generated with ARCH=<foo> (even ARCH=i386 the default) and you then
execute 'make scripts', you'll trigger the oldconfig.

So to avoid it, you should execute your make scripts with ARCH=<your arch>
on the command line.

As for saving ARCH in the .config, it has been considered in the past,
but never implemented. Other elements such as CROSS_COMPILE are now
saved, but not ARCH= since it isn't directly used in the .config, it's
a Makefile construct.

Cheers,

Bruce


Re: [RFC v4 00/13][eclipse-poky] Integrate yocto documentation into eclipse

Zhang, Jessica
 

Hi Timo,

Thanks for the patch and everything looks good. So question to you and Scott, what's the plan from the doc site that we need to coordinate to have this merged into master.

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@... [mailto:yocto-bounces@...] On Behalf Of Timo Mueller
Sent: Wednesday, January 30, 2013 6:01 AM
To: yocto@...
Cc: Timo Mueller
Subject: [yocto] [RFC v4 00/13][eclipse-poky] Integrate yocto documentation into eclipse

From: Timo Mueller <timo.mueller@...>

Hi,

the last proposal integrated the yocto documentation into the existing doc plugin of the yocto ADT feature. As Jessica pointed out is does not make sense to bundle all parts of the yocto documentation with the ADT feature. As some parts of the documentation could also be helpful with the BitBake Commander feature, we agreed to encapsulate the yocto documentation into its own feature.

01..02: Fixing typos in build and site scripts
03..12: Adding the yocto documentation as a new feature
13: Temporary patch to use timo branch of docs project - DO NOT MERGE

From the last propsal:
<snip>
One major change in this patch series is that I extended the plugin build system to integrate the generation into the build process. Thus keeping the eclipse help and the official documentation in sync is now automated.
</snip>

<snip>
the documentation of the yocto project can currently be viewed online or as a separate pdf. When using the eclipse ide to develop software on base of a yocto sysroot and toolchain it would be convenient to access the relevant parts of the documentation from within the ide.
</snip>

<snip>
I have intergrated this
documentation in the ide and it can now be accessed through the eclipse help center (Help -> Help Contents).
</snip>

Best regards
Timo

Timo Mueller (13):
features/sdk.site: Fixed typo in category name
Fixed typo in version variable name
plugins/sdk.ide.doc.user: Add empty eclipse help
plugins/sdk.ide.doc.user: Add about.html to prepare addition of yocto
documentation
features/org.yocto.doc: Add new feature containing yocto project
documentation
features/doc.headless.build: Added headless build for yocto.doc
feature
features/sdk.site: Added yocto.doc feature to update site
scripts/build.sh: Added yocto.doc feature to build
scripts/generate-doc.sh: Add script to handle eclipse help generation
plugins/sdk.ide.doc.user: Add yocto documentation to the table of
contents
scripts/generate-doc.sh: Copy generated eclipse help into the
user.doc plugin
scripts/build.sh: Add documentation generation to the default build
(TEMPORARY): Use origin/timo branch of yocto docs project

.../org.yocto.bc.headless.build/customTargets.xml | 4 +-
features/org.yocto.doc.headless.build/.project | 11 +
.../org.yocto.doc.headless.build/build.properties | 262 +++++++++++++++++++++ .../org.yocto.doc.headless.build/customTargets.xml | 212 +++++++++++++++++
features/org.yocto.doc/.project | 17 ++
features/org.yocto.doc/build.properties | 3 +
features/org.yocto.doc/feature.properties | 163 +++++++++++++
features/org.yocto.doc/feature.xml | 35 +++
features/org.yocto.doc/license.html | 107 +++++++++
.../org.yocto.sdk.headless.build/customTargets.xml | 4 +-
features/org.yocto.sdk.site/category.xml | 10 +-
features/org.yocto.sdk.site/site.xml | 10 +-
plugins/org.yocto.doc.user/.classpath | 6 +
plugins/org.yocto.doc.user/.project | 28 +++
plugins/org.yocto.doc.user/META-INF/MANIFEST.MF | 8 +
.../OSGI-INF/l10n/bundle.properties | 3 +
plugins/org.yocto.doc.user/about.html.in | 166 +++++++++++++
plugins/org.yocto.doc.user/build.properties | 9 +
plugins/org.yocto.doc.user/html/book.css | 1 +
plugins/org.yocto.doc.user/plugin.xml | 35 +++
plugins/org.yocto.doc.user/toc.xml | 21 ++
scripts/build.sh | 18 +-
scripts/generate-doc.sh | 91 +++++++
23 files changed, 1212 insertions(+), 12 deletions(-) create mode 100644 features/org.yocto.doc.headless.build/.project
create mode 100644 features/org.yocto.doc.headless.build/build.properties
create mode 100644 features/org.yocto.doc.headless.build/customTargets.xml
create mode 100644 features/org.yocto.doc/.project create mode 100644 features/org.yocto.doc/build.properties
create mode 100644 features/org.yocto.doc/feature.properties
create mode 100644 features/org.yocto.doc/feature.xml
create mode 100644 features/org.yocto.doc/license.html
create mode 100644 plugins/org.yocto.doc.user/.classpath
create mode 100644 plugins/org.yocto.doc.user/.project
create mode 100644 plugins/org.yocto.doc.user/META-INF/MANIFEST.MF
create mode 100644 plugins/org.yocto.doc.user/OSGI-INF/l10n/bundle.properties
create mode 100644 plugins/org.yocto.doc.user/about.html.in
create mode 100644 plugins/org.yocto.doc.user/build.properties
create mode 100644 plugins/org.yocto.doc.user/html/book.css
create mode 100644 plugins/org.yocto.doc.user/plugin.xml
create mode 100644 plugins/org.yocto.doc.user/toc.xml
create mode 100755 scripts/generate-doc.sh

--
1.7.11.7

_______________________________________________
yocto mailing list
yocto@...
https://lists.yoctoproject.org/listinfo/yocto


1.4_M3.rc2 ready for QA

Michael Halstead
 

The 1.4_M3.rc2 is available at:

http://autobuilder.yoctoproject.org/pub/nightly/20130131-4/

Built from:
poky: 3ae1a4ba972cfc17ff3f2fda632da8ecc3414885
eclipse-poky: 65f1b736b719ad5284281ccd88a33a5a92724da2
meta-qt3: 06e2fe600de962cdba53c23de1207501439a9c9f


Please begin testing against this RC. Please note that tag and branch names for this milestone will be named as if it was M3. Branches have already been created since some commits needed to be cherry-picked for the build. I will tag, sign and release the milestone if/when given the all clear.

--
Michael Halstead
Yocto Project / Sys Admin


Re: lmsensors-apps builds, but not in final image?

Marc Ferland <ferlandm@...>
 

r10kindsofpeople <r10kindsofpeople@...> writes:

Thanks, Marc, that's got me moving forward.  However, it may not be
strictly true that lmsensors-apps is empty or at least has no effect.
 So far, I'm up to "lmsensors lmsensors-scripts lmsensors-apps" with
the last being needed {sufficient?} to get strict.pm, needed to do
"sensors-detect".  
You could also use the new lmsensors recipe which I updated from the old
one (the one you're using atm).

It's available here:
https://github.com/openembedded/meta-oe/blob/master/meta-oe/recipes-support/lm_sensors/lmsensors_3.3.2.bb

Marc


Re: lmsensors-apps builds, but not in final image?

r10kindsofpeople <r10kindsofpeople@...>
 

Thanks, Marc, that's got me moving forward.  However, it may not be strictly true that lmsensors-apps is empty or at least has no effect.  So far, I'm up to "lmsensors lmsensors-scripts lmsensors-apps" with the last being needed {sufficient?} to get strict.pm, needed to do "sensors-detect".  

Now I'm off to find module cpuid.  Thanks again,

John


On Thu, Jan 31, 2013 at 2:20 PM, Marc Ferland <ferlandm@...> wrote:
r10kindsofpeople <r10kindsofpeople@...> writes:

> I'm hoping someone can quickly spot my mistake.  I'm attempting to use
> this recipe:
> http://git.yoctoproject.org/cgit/cgit.cgi/meta-fsl-ppc/tree/recipes-extended/lm_
> sensors/lmsensors-apps_3.3.2.bb
>
> with my meta-intel/crownbay build under denzil 7.0.1.  
>
> I put the recipe in my layer, and added "lmsensors-apps" to my
> IMAGE_INSTALL_append in my layer's layer.conf.  
>
> The software builds, and I can see the files in
> tmp/work/crownbay-poky-linux/lmsensors-apps-3.3.2-r2.
>
> But it doesn't make it into tmp/work/core-image-minimal-1.0-r0/rootfs
> or the .hddimage file.
>

You have to use one of the packages specified in the recipe. Like
'libsensors' or 'lmsensors-sensors'. lmsensors-apps is empty.

Marc


Re: [RFC v2 00/18][eclipse-poky] Storing yocto settings as target profiles

Zhang, Jessica
 

Hi Timo,

I'm having a hard time figuring out the sequence of this patch series. You have 01/18-09/18, then 10/17 is obsolete, then you have things like 12/18 and 12/17 and some have XX/18 and some have XX/17. Can you do some cleanup and resend?

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@... [mailto:yocto-bounces@...] On Behalf Of Timo Mueller
Sent: Wednesday, January 30, 2013 5:56 AM
To: yocto@...
Cc: Timo Mueller
Subject: [yocto] [RFC v2 00/18][eclipse-poky] Storing yocto settings as target profiles

From: Timo Mueller <timo.mueller@...>

Hi,

thanks for the feedback, I did some changes to the patch series accordingly.

First of all I've fixed the issues with the patches (duplicate method, missing fix for NewYoctoCProjectTemplate.java).

I also changed the functionality of the "new" button according to Jessica's feedback. The logic is changed to a "Save as ..."
approach. If the button is clicked the current values of the form are checked. If these are valid, the user can enter a name to store them as a new profile.

The last patch moves the "Save as ..." button to the bottom of the preference page alongside with the "perform defaults" and the "apply"
button. I created this patch as a proof of concept because I thought it would be a good idea to move it.
I used the contributeButtons hook of the preference page to achieve this, but this only allows adding the "Save as ..." button left to the "perform defaults" button. So the order of the buttons is a bit confusing.
I further checked several other preference pages of eclipse and it seems like none of them is using this hook to add new buttons. Instead all have a new button next to the comboboxes (e.g. Formatter for CDT and JDT).
So I would plead against moving it to the bottom to have a more consistent and less confusing ui.

From the original cover letter:
<snip>
currently the yocto settings can be changed globally through eclipse's preferences or locally in the project properties. But the standard configuration stored in the global preferences sometimes changes, e.g. if a new version of the toolchain or the sysroot is released.
If you change the global settings to the updated toolchain or sysroot your old working configuration is gone. If you want to reuse this configuration at a later point in time you have to (remember and) re-enter everthing.
This patch set introduces the possiblity to store a configuration under a unique name, a so called target profile, and be able to select the default target profile that is used for new projects.
Building upon this change the target profiles could later also be used in the project settings and be able to quickly build and debug your software for different hard- and software combinations.
</snip>

Best regards,
Timo

Atanas Gegov (4):
plugins/sdk.ide: Extract labels to private members
plugins/sdk.ide: Add method to enable and disable form
plugins/sdk.ide: Set value of target array on input change
plugins/sdk.ide: Create UI element for managing target profiles.

Timo Mueller (14):
plugins/sdk.ide: Removed unused message
plugins/sdk.ide: Changed method signature to be more consistent
plugins/sdk.ide: Modified preferences storage to support profiles.
plugins/sdk.ide: Set profile on selection change
plugins/sdk.ide: Add method to allow storing the current settings
plugins/sdk.ide: Add UI method to create a new profile
plugins/sdk.ide: Add UI method to delete a profile
plugins/sdk.ide: Add UI method to rename a profile
plugins/sdk.ide: Add method to change values of the preference page
plugins/sdk.ide: Add method to rename a profile and its preference
store
plugins/sdk.ide: Add method to delete a profile
plugins/sdk.ide: Use profiles for the preference page
plugins/sdk.ide: Added profile UI to the preference page
plugins/sdk.ide: Moved save as button to bottom of preference page

.../src/org/yocto/sdk/ide/YoctoProfileElement.java | 104 ++++++++++ .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 211 +++++++++++++++++++++ .../org/yocto/sdk/ide/YoctoSDKMessages.properties | 19 +-
.../src/org/yocto/sdk/ide/YoctoSDKPlugin.java | 9 +
.../org/yocto/sdk/ide/YoctoSDKProjectNature.java | 10 +-
.../src/org/yocto/sdk/ide/YoctoSDKUtils.java | 62 ++++--
.../src/org/yocto/sdk/ide/YoctoUISetting.java | 60 +++++-
.../sdk/ide/preferences/PreferenceConstants.java | 5 +
.../sdk/ide/preferences/PreferenceInitializer.java | 22 ++- .../ide/preferences/ProfileNameInputValidator.java | 63 ++++++
.../ide/preferences/YoctoSDKPreferencePage.java | 133 ++++++++++---
.../preferences/YoctoSDKProjectPropertyPage.java | 6 +-
.../sdk/ide/wizard/NewYoctoCProjectTemplate.java | 7 +-
13 files changed, 646 insertions(+), 65 deletions(-) create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
create mode 100644 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java

--
1.7.11.7

_______________________________________________
yocto mailing list
yocto@...
https://lists.yoctoproject.org/listinfo/yocto


Re: lmsensors-apps builds, but not in final image?

Marc Ferland <ferlandm@...>
 

r10kindsofpeople <r10kindsofpeople@...> writes:

I'm hoping someone can quickly spot my mistake.  I'm attempting to use
this recipe:
http://git.yoctoproject.org/cgit/cgit.cgi/meta-fsl-ppc/tree/recipes-extended/lm_
sensors/lmsensors-apps_3.3.2.bb

with my meta-intel/crownbay build under denzil 7.0.1.  

I put the recipe in my layer, and added "lmsensors-apps" to my
IMAGE_INSTALL_append in my layer's layer.conf.  

The software builds, and I can see the files in
tmp/work/crownbay-poky-linux/lmsensors-apps-3.3.2-r2.

But it doesn't make it into tmp/work/core-image-minimal-1.0-r0/rootfs
or the .hddimage file.
You have to use one of the packages specified in the recipe. Like
'libsensors' or 'lmsensors-sensors'. lmsensors-apps is empty.

Marc


lmsensors-apps builds, but not in final image?

r10kindsofpeople <r10kindsofpeople@...>
 

I'm hoping someone can quickly spot my mistake.  I'm attempting to use this recipe:

with my meta-intel/crownbay build under denzil 7.0.1.  

I put the recipe in my layer, and added "lmsensors-apps" to my IMAGE_INSTALL_append in my layer's layer.conf.  

The software builds, and I can see the files in tmp/work/crownbay-poky-linux/lmsensors-apps-3.3.2-r2.

But it doesn't make it into tmp/work/core-image-minimal-1.0-r0/rootfs or the .hddimage file.

Help, please?

John


menuconfig fails using SSTATE_MIRRORS and SOURCE_MIRROR_URL

Daniel Kenji Morgan <daniel.kenji.morgan@...>
 

To explain my environment:

I am building images for the machine "imx6qsabrelite" in the "meta-fsl-arm" BSP layer using Poky 1.3 (danny).
The kernel recipe is linux-imx which is fetched from Freescale's git repository.

On host machine A, I build an image and copy all the sstate cache and download files into a different directory.
I've setup this directory as a Samba share so it can be accessed via the local network.

On host machine B, I have local.conf set to use the shared sstate cache and source download mirror (SSTATE_MIRRORS and SOURCE_MIRROR_URL
).
They are both utilized without any problems when I build an image.
However, when I "bitbake -c menuconfig virtual/kernel", I get the following error in the kconfig terminal:

scripts/kconfig/mconf Kconfig
Error opening terminal: xterm.
make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2
Command failed.
Press any key to continue...

The same "bitbake -c menuconfig virtual/kernel" on host machine A works.
It also works on host machine B when I disable using the shared sstate cache and source download mirror.

Is anyone aware of such issues?


Re: what's the best distro to pick for adding packages to yocto

Burton, Ross <ross.burton@...>
 

On 31 January 2013 11:16, Tim Coote <tim+yoctoproject.org@...> wrote:
Hullo
I'm trying to add a package to yocto (an AMQP implementation). There are various packaged versions, so I started with the one that I'm most familiar (RH). However, it's pretty clear that yocto's not based on that as the initscripts are totally different and missing the framework (there isn't even a /etc/rc.d/init.d, although it looks like there used to be).

What's the best starting point for picking a prepackaged version for a distro? debian? suse?
Historically Debian is fairly close, but these days that isn't really
true. It's probably best to look at an existing init script to see
*what* needs to be done, and then copy the style of existing scripts
in Yocto for *how* to do it.

Ross


[PATCH v6] [399231] Fix race conditions when reading using LocalShellOutputReader(s)

Ioana Grigoropol <ioanax.grigoropol@...>
 

When running a remote command with a Local connection from a Linux host a new LocalHostShell is created.
At this time, a new LocalHostThread is launched, along side with two LocalShellOutputReaders (output and error). The constructors for the OutputReaders will receive a reference to the reader created by the LocalHostThread.

When calling runCommandRemote, the newly created IHostShell is returned, making it possible to create an adapter(IHostShellProcessAdapter) that will then be used to read all available output from the readers.
When the LocalShellThread finishes running its run() method, it will perform a cleanup causing both readers (output and error) to be closed.
If at this point, there are any readers, or handlers to the readers that are still trying to read data (read using handlers readers), an error will be thrown saying that the the pipe to the stream is closed ("Ensure open stream"/ "Pipe closed" errors).
After inspecting the internalReadLine, it seems that it expects a null reference of the reader in order to consider that the reading is done.
In order to ensure that this will happen once the LocalShellThread closes the stream(s), we will make sure that the reference to the readers is set to null, and that LocalShellOutputReader(s) use the same reference of the reader as the LocalShellThread. For this to happen, a reference of the thread must be kept in the reader, in order to retrieve the correct reference of the underlying reader.
Since there can still be race conditions in this solution, all operations that involve the reference to now the only reader, must be performed under mutual exclusion using a shared lock between the LocalShellOutputReader and LocalShellThread.

[update] : there is no need to protect internalReadLine with locks as long as we do it when reading.

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@...>
---
.../dstore/shells/DStoreShellOutputReader.java | 12 ++++++++
.../services/local/shells/LocalHostShell.java | 5 ++--
.../local/shells/LocalShellOutputReader.java | 29 +++++++++++++-------
.../services/local/shells/LocalShellThread.java | 18 ++++++++++++
.../.settings/.api_filters | 22 +++++++++++++++
.../shells/TerminalServiceShellOutputReader.java | 14 ++++++++++
.../services/shells/IHostShellOutputReader.java | 13 ++++++++-
7 files changed, 100 insertions(+), 13 deletions(-)

diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreShellOutputReader.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreShellOutputReader.java
index 84c9bb9..35dbea4 100644
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreShellOutputReader.java
+++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shells/DStoreShellOutputReader.java
@@ -13,10 +13,13 @@
*
* Contributors:
* David McKnight (IBM) - [286671] return null when status is null
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.dstore.shells;

+import java.io.BufferedReader;
+import java.util.concurrent.locks.Lock;
import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.extra.DomainEvent;
import org.eclipse.dstore.extra.IDomainListener;
@@ -168,6 +171,15 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple
notifyResponse();
}

+ public BufferedReader getReader() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Lock getReaderLock() {
+ return null;
+ }
+
/*
private void handleInput()
{
diff --git a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java
index 250a904..213bf2e 100644
--- a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java
+++ b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalHostShell.java
@@ -13,6 +13,7 @@
*
* Contributors:
* Martin Oberhuber (Wind River) - [161838] local shell reports isActive() wrong
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.local.shells;
@@ -37,8 +38,8 @@ public class LocalHostShell extends AbstractHostShell implements IHostShell
public LocalHostShell(String initialWorkingDirectory, String invocation, String encoding, String[] environment)
{
_shellThread = new LocalShellThread(initialWorkingDirectory, invocation, encoding, environment);
- _stdoutHandler = new LocalShellOutputReader(this, _shellThread.getOutputStream(), false);
- _stderrHandler = new LocalShellOutputReader(this, _shellThread.getErrorStream(),true);
+ _stdoutHandler = new LocalShellOutputReader(this, _shellThread, false);
+ _stderrHandler = new LocalShellOutputReader(this, _shellThread, true);
}

protected void run(IProgressMonitor monitor)
diff --git a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellOutputReader.java b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellOutputReader.java
index ab8ff5c..fd7096c 100644
--- a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellOutputReader.java
+++ b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellOutputReader.java
@@ -12,13 +12,14 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
- * {Name} (company) - description of contribution.
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.local.shells;

import java.io.BufferedReader;
import java.io.IOException;
+import java.util.concurrent.locks.Lock;

import org.eclipse.rse.internal.services.local.Activator;
import org.eclipse.rse.services.shells.AbstractHostShellOutputReader;
@@ -33,14 +34,14 @@ import org.eclipse.rse.services.shells.SimpleHostOutput;
*/
public class LocalShellOutputReader extends AbstractHostShellOutputReader implements IHostShellOutputReader
{
- protected BufferedReader _reader;
+ private LocalShellThread _shellThread;
private String fPromptChars = ">$%#]"; //Characters we accept as the end of a prompt //$NON-NLS-1$;


- public LocalShellOutputReader(IHostShell hostShell, BufferedReader reader, boolean isErrorReader)
+ public LocalShellOutputReader(IHostShell hostShell, LocalShellThread shellThread, boolean isErrorReader)
{
super(hostShell, isErrorReader);
- _reader = reader;
+ _shellThread = shellThread;
}
/*
protected Object internalReadLine()
@@ -137,7 +138,7 @@ public class LocalShellOutputReader extends AbstractHostShellOutputReader implem
}
*/
protected IHostOutput internalReadLine() {
- if (_reader == null) {
+ if (getReader() == null) {
//Our workaround sets the stderr reader to null, so we never give any stderr output.
//TODO Check if ssh supports some method of having separate stdout and stderr streams
return null;
@@ -149,7 +150,7 @@ public class LocalShellOutputReader extends AbstractHostShellOutputReader implem
boolean done = false;
while (!done && !isFinished()) {
try {
- ch = _reader.read();
+ ch = getReader().read();
switch (ch) {
case -1:
case 65535:
@@ -185,13 +186,13 @@ public class LocalShellOutputReader extends AbstractHostShellOutputReader implem
theLine.append(tch); // Any other character
} else if (ch == 27) {
// Escape: ignore next char too
- int nch = _reader.read();
+ int nch = getReader().read();
if (theDebugLine!=null) theDebugLine.append((char)nch);
if (nch == 91) {
//vt100 escape sequence: read until end-of-command (skip digits and semicolon)
//e.g. \x1b;13;m --> ignore the entire command, including the trailing m
do {
- nch = _reader.read();
+ nch = getReader().read();
if (theDebugLine!=null) theDebugLine.append((char)nch);
} while (Character.isDigit((char)nch) || nch == ';');
}
@@ -202,7 +203,7 @@ public class LocalShellOutputReader extends AbstractHostShellOutputReader implem
// there are more characters
// in the Buffer...If not, then we assume it is waiting for
// input.
- if (!done && !_reader.ready()) {
+ if (!done && !getReader().ready()) {
// wait to make sure -- max. 500 msec to wait for new chars
// if we are not at a CRLF seems to be appropriate for the
// Pipes and Threads in ssh.
@@ -219,7 +220,7 @@ public class LocalShellOutputReader extends AbstractHostShellOutputReader implem
Thread.sleep(waitIncrement);
} catch (InterruptedException e) {
}
- if (!_reader.ready()) {
+ if (!getReader().ready()) {
done = true;
}
}
@@ -237,6 +238,14 @@ public class LocalShellOutputReader extends AbstractHostShellOutputReader implem
}
return new SimpleHostOutput(theLine.toString());
}
+ public BufferedReader getReader() {
+ if (isErrorReader())
+ return _shellThread.getErrorStream();
+ return _shellThread.getOutputStream();
+ }
+ public Lock getReaderLock() {
+ return _shellThread.getLock();
+ }


}
diff --git a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java
index 0a33ad4..28e8ad9 100644
--- a/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java
+++ b/rse/plugins/org.eclipse.rse.services.local/src/org/eclipse/rse/internal/services/local/shells/LocalShellThread.java
@@ -17,6 +17,7 @@
* David McKnight (IBM) - [189387] Use specified encoding for shell output
* Martin Oberhuber (Wind River) - [161838] local shell reports isActive() wrong
* Anna Dushistova (MontaVsita) - [249354] Incorrect behaviour of local shells subsystem runCommand method
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.local.shells;
@@ -29,6 +30,8 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;

import org.eclipse.core.runtime.FileLocator;

@@ -62,6 +65,7 @@ public class LocalShellThread extends Thread
private BufferedReader _stdInput;
private BufferedReader _stdError;

+ private Lock _lock;
/**
* constructor for local command shell monitor
*
@@ -260,6 +264,7 @@ public class LocalShellThread extends Thread

_stdError = new BufferedReader(new InputStreamReader(_theProcess.getErrorStream()));

+ _lock = new ReentrantLock();
}
catch (IOException e)
{
@@ -438,9 +443,14 @@ public class LocalShellThread extends Thread
_isDone = true;
try
{
+ _lock.lock();
_stdInput.close();
_stdError.close();

+ _stdInput = null;
+ _stdError = null;
+
+ _lock.unlock();
if (_theProcess != null)
{

@@ -511,4 +521,12 @@ public class LocalShellThread extends Thread
}


+ public Lock getLock() {
+ return _lock;
+ }
+
+ public void setLock(Lock _lock) {
+ this._lock = _lock;
+ }
+
}
diff --git a/rse/plugins/org.eclipse.rse.services/.settings/.api_filters b/rse/plugins/org.eclipse.rse.services/.settings/.api_filters
index 19273c2..da67bc9 100644
--- a/rse/plugins/org.eclipse.rse.services/.settings/.api_filters
+++ b/rse/plugins/org.eclipse.rse.services/.settings/.api_filters
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.rse.services" version="2">
+ <resource path="META-INF/MANIFEST.MF">
+ <filter id="923795461">
+ <message_arguments>
+ <message_argument value="3.2.200"/>
+ <message_argument value="3.2.200"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.rse.internal.services.terminals.AbstractTerminalService">
<filter id="305324134">
<message_arguments>
@@ -119,4 +127,18 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/rse/services/shells/IHostShellOutputReader.java" type="org.eclipse.rse.services.shells.IHostShellOutputReader">
+ <filter id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.rse.services.shells.IHostShellOutputReader"/>
+ <message_argument value="getReader()"/>
+ </message_arguments>
+ </filter>
+ <filter id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.rse.services.shells.IHostShellOutputReader"/>
+ <message_argument value="getReaderLock()"/>
+ </message_arguments>
+ </filter>
+ </resource>
</component>
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceShellOutputReader.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceShellOutputReader.java
index 16364e1..9b01c10 100644
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceShellOutputReader.java
+++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/internal/services/shells/TerminalServiceShellOutputReader.java
@@ -17,12 +17,15 @@
* Anna Dushistova (MontaVista) - adapted from SshShellOutputReader
* Anna Dushistova (MontaVista) - [240523] [rseterminals] Provide a generic adapter factory that adapts any ITerminalService to an IShellService
* Rob Stryker (JBoss) - [335059] TerminalServiceShellOutputReader logs error when hostShell.exit() is called
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
*******************************************************************************/

package org.eclipse.rse.internal.services.shells;

import java.io.BufferedReader;
import java.io.IOException;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;

import org.eclipse.rse.internal.services.Activator;
import org.eclipse.rse.services.shells.AbstractHostShellOutputReader;
@@ -36,6 +39,7 @@ import org.eclipse.rse.services.shells.SimpleHostOutput;
public class TerminalServiceShellOutputReader extends
AbstractHostShellOutputReader {
protected BufferedReader fReader;
+ protected Lock lock;
private volatile Thread fReaderThread = null;
private volatile boolean isCanceled = false;
private String fPromptChars = ">$%#]"; //Characters we accept as the end of a prompt //$NON-NLS-1$;
@@ -174,4 +178,14 @@ public class TerminalServiceShellOutputReader extends
fReaderThread.interrupt();
}
}
+
+ public BufferedReader getReader() {
+ return fReader;
+ }
+
+ public Lock getReaderLock() {
+ if (lock == null)
+ lock = new ReentrantLock();
+ return lock;
+ }
}
diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java
index 103c31f..b70b3db 100644
--- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java
+++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/shells/IHostShellOutputReader.java
@@ -11,11 +11,14 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
- * {Name} (company) - description of contribution.
+ * Ioana Grigoropol (Intel) - [399231] Race conditions occur when trying to read from local processes using LocalShellOutputReader
********************************************************************************/

package org.eclipse.rse.services.shells;

+import java.io.BufferedReader;
+import java.util.concurrent.locks.Lock;
+
public interface IHostShellOutputReader extends IHostShellOutputNotifier
{
public IHostOutput readLine();
@@ -23,4 +26,12 @@ public interface IHostShellOutputReader extends IHostShellOutputNotifier
public void addOutputListener(IHostShellOutputListener listener);
public boolean isErrorReader();
public void finish();
+ /**
+ * @since 3.2
+ */
+ public BufferedReader getReader();
+ /**
+ * @since 3.2
+ */
+ public Lock getReaderLock();
}
\ No newline at end of file
--
1.7.9.5


what's the best distro to pick for adding packages to yocto

Tim Coote <tim+yoctoproject.org@...>
 

Hullo
I'm trying to add a package to yocto (an AMQP implementation). There are various packaged versions, so I started with the one that I'm most familiar (RH). However, it's pretty clear that yocto's not based on that as the initscripts are totally different and missing the framework (there isn't even a /etc/rc.d/init.d, although it looks like there used to be).

What's the best starting point for picking a prepackaged version for a distro? debian? suse?

thanks
Tim


Re: install and use "bitbake -c populate_sdk"

Zhang, Jessica
 

Hi Eddy,

 

I don’t think build core-image-sato-sdk is the right approach.  Have you looked into following the example of hello-mod under meta-skeleton, to use bitbake to build your kernel module?

 

-          Jessica

From: Lai Eddy [mailto:eddy.lai.tw@...]
Sent: Wednesday, January 30, 2013 7:54 PM
To: Zhang, Jessica
Cc: yocto@...
Subject: Re: [yocto] install and use "bitbake -c populate_sdk"

 

Thanks Jessica,

 

why I tried to use "-c populate-sdk" is because that I can find "core-image-sato-sdk"  but no "core-image-basic-sdk" available, and my hardware is a samll jasperforest x86_64 target with 2 serial port and 1 ethernet port only, no display interface.

I'm trying to find if any of following configuration suitable for my kernel module driver develop/debug:

1. with the x86_64 toolchain sdk installed on my x86_64 host , build my kernel module driver, then scp ".ko" binary to target for insmod/debugging, but the problem I have now is the "make" always pointing to /usr/src/3.2.x kernel source path (my host OS's kernel version), but not the linux-yocto target kernel (3.4.x) source/header path (and I don't know where's the proper 3.4.x target kernel header/source files, is it inside tmp/work/...? )

2.build and run the "core-image-basic" on my target, and install the sdk created with "bitbake core-image-basic -c populate-sdk", but there's no "/usr/src/.." , "/lib/modules/3.4.x-yocto-stand/build" exist

 

trying to build the "core-image-sato-sdk to see if that help for target develop now...

 

Eddy

 

2013/1/31 Zhang, Jessica <jessica.zhang@...>

Hi Eddy,

The SDK is meant to be used on development host for cross development instead of target.  Sounds like you need an sdk image which contains the development tools and needed development library and kernel sources.  Please refer to  core-image-sato-sdk for how to customize your image to allow your do development work on target.

Thanks,
Jessica


-----Original Message-----
From: yocto-bounces@... [mailto:yocto-bounces@...] On Behalf Of Eddy Lai GMail
Sent: Thursday, January 24, 2013 5:49 AM
To: yocto@...
Subject: Re: [yocto] install and use "bitbake -c populate_sdk"

Hi,

I have build and boot the image from USB flash disk with the .hddimg created by "bitbake -k core-image-basic"
have added ssh server inside and make sure the ethernet works well, then use "bitbake -c populate_sdk core-image-basic" to create the "poky_eglibc_xx.sh" under "tmp/deploy/sdk" directory, my plan is to install the sdk into the target system and compile my kernel module there, but now the problem is:
1. even I have 8GB USB flash disk, the .hddimg is 420MB only, "df"
command from target said there's 85MB available only,
     but the sdk .sh installer image is about 300MB, how can I "extend"
the target system to use the rest USB disk space? ( it's FAT file system)
     or how to modify configuration to force build the .hddimg create ~"8GB" file system?
2. after that SDK installed into my target system, can I copy (scp) my own kernel module driver source code into the target system then
     make/compile and try insmod/debug the .ko there?
     or should I install the sdk on host system, then copy only the compiled .ko into target system for test/debugging?

Eddy

_______________________________________________
yocto mailing list
yocto@...
https://lists.yoctoproject.org/listinfo/yocto

 


Re: install and use "bitbake -c populate_sdk"

Eddy Lai
 

Thanks Jessica,

why I tried to use "-c populate-sdk" is because that I can find "core-image-sato-sdk"  but no "core-image-basic-sdk" available, and my hardware is a samll jasperforest x86_64 target with 2 serial port and 1 ethernet port only, no display interface.
I'm trying to find if any of following configuration suitable for my kernel module driver develop/debug:
1. with the x86_64 toolchain sdk installed on my x86_64 host , build my kernel module driver, then scp ".ko" binary to target for insmod/debugging, but the problem I have now is the "make" always pointing to /usr/src/3.2.x kernel source path (my host OS's kernel version), but not the linux-yocto target kernel (3.4.x) source/header path (and I don't know where's the proper 3.4.x target kernel header/source files, is it inside tmp/work/...? )
2.build and run the "core-image-basic" on my target, and install the sdk created with "bitbake core-image-basic -c populate-sdk", but there's no "/usr/src/.." , "/lib/modules/3.4.x-yocto-stand/build" exist

trying to build the "core-image-sato-sdk to see if that help for target develop now...

Eddy

2013/1/31 Zhang, Jessica <jessica.zhang@...>

Hi Eddy,

The SDK is meant to be used on development host for cross development instead of target.  Sounds like you need an sdk image which contains the development tools and needed development library and kernel sources.  Please refer to  core-image-sato-sdk for how to customize your image to allow your do development work on target.

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@... [mailto:yocto-bounces@...] On Behalf Of Eddy Lai GMail
Sent: Thursday, January 24, 2013 5:49 AM
To: yocto@...
Subject: Re: [yocto] install and use "bitbake -c populate_sdk"

Hi,

I have build and boot the image from USB flash disk with the .hddimg created by "bitbake -k core-image-basic"
have added ssh server inside and make sure the ethernet works well, then use "bitbake -c populate_sdk core-image-basic" to create the "poky_eglibc_xx.sh" under "tmp/deploy/sdk" directory, my plan is to install the sdk into the target system and compile my kernel module there, but now the problem is:
1. even I have 8GB USB flash disk, the .hddimg is 420MB only, "df"
command from target said there's 85MB available only,
     but the sdk .sh installer image is about 300MB, how can I "extend"
the target system to use the rest USB disk space? ( it's FAT file system)
     or how to modify configuration to force build the .hddimg create ~"8GB" file system?
2. after that SDK installed into my target system, can I copy (scp) my own kernel module driver source code into the target system then
     make/compile and try insmod/debug the .ko there?
     or should I install the sdk on host system, then copy only the compiled .ko into target system for test/debugging?

Eddy
_______________________________________________
yocto mailing list
yocto@...
https://lists.yoctoproject.org/listinfo/yocto


Re: install and use "bitbake -c populate_sdk"

Zhang, Jessica
 

Hi Eddy,

The SDK is meant to be used on development host for cross development instead of target. Sounds like you need an sdk image which contains the development tools and needed development library and kernel sources. Please refer to core-image-sato-sdk for how to customize your image to allow your do development work on target.

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@... [mailto:yocto-bounces@...] On Behalf Of Eddy Lai GMail
Sent: Thursday, January 24, 2013 5:49 AM
To: yocto@...
Subject: Re: [yocto] install and use "bitbake -c populate_sdk"

Hi,

I have build and boot the image from USB flash disk with the .hddimg created by "bitbake -k core-image-basic"
have added ssh server inside and make sure the ethernet works well, then use "bitbake -c populate_sdk core-image-basic" to create the "poky_eglibc_xx.sh" under "tmp/deploy/sdk" directory, my plan is to install the sdk into the target system and compile my kernel module there, but now the problem is:
1. even I have 8GB USB flash disk, the .hddimg is 420MB only, "df"
command from target said there's 85MB available only,
but the sdk .sh installer image is about 300MB, how can I "extend"
the target system to use the rest USB disk space? ( it's FAT file system)
or how to modify configuration to force build the .hddimg create ~"8GB" file system?
2. after that SDK installed into my target system, can I copy (scp) my own kernel module driver source code into the target system then
make/compile and try insmod/debug the .ko there?
or should I install the sdk on host system, then copy only the compiled .ko into target system for test/debugging?

Eddy
_______________________________________________
yocto mailing list
yocto@...
https://lists.yoctoproject.org/listinfo/yocto


[meta-raspberrypi][PATCH 2/2] Add RPROVIDES for OpenGL libraries

Philipp Wagner <lists@...>
 

From: Philipp Wagner <mail@...>

Often the OpenGL libraries are dlopen'ed rather than linked against,
which makes it necessary to add OpenGL libraries to RDEPENDS of the
package. This of course requires that they are RPROVIDE'd somewhere.

I've seen a bug report about this at
https://github.com/djwillis/meta-raspberrypi/issues/55
but I don't know enough to judge how/why virtual/libgl is required,
so I'm leaving it in for now and only adding the runtime library
provider.

Signed-off-by: Philipp Wagner <mail@...>
---
recipes-bcm/vc-graphics/vc-graphics.inc | 1 +
1 file changed, 1 insertion(+)

diff --git a/recipes-bcm/vc-graphics/vc-graphics.inc b/recipes-bcm/vc-graphics/vc-graphics.inc
index 915b7c1..36cbdf9 100644
--- a/recipes-bcm/vc-graphics/vc-graphics.inc
+++ b/recipes-bcm/vc-graphics/vc-graphics.inc
@@ -4,6 +4,7 @@ LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://LICENCE;md5=86e53f5f5909ee66900418028de11780"

PROVIDES = "virtual/libgl virtual/libgles2 virtual/egl"
+RPROVIDES = "virtual/libgl virtual/libgles2 virtual/egl"
COMPATIBLE_MACHINE = "raspberrypi"

include ../common/firmware.inc
--
1.7.9.5


[meta-raspberrypi][PATCH 1/2] Choose correct ABI version of graphics binaries

Philipp Wagner <lists@...>
 

From: Philipp Wagner <mail@...>

Depending on the used calling convention use the hardfp or
the softfp binary graphics libraries.

Signed-off-by: Philipp Wagner <mail@...>
---
conf/machine/include/rpi-default-providers.inc | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/conf/machine/include/rpi-default-providers.inc b/conf/machine/include/rpi-default-providers.inc
index ce963b3..83292df 100644
--- a/conf/machine/include/rpi-default-providers.inc
+++ b/conf/machine/include/rpi-default-providers.inc
@@ -2,7 +2,11 @@

PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi"
PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
-PREFERRED_PROVIDER_virtual/egl ?= "vc-graphics-hardfp"
-PREFERRED_PROVIDER_virtual/libgles2 ?= "vc-graphics-hardfp"
-PREFERRED_PROVIDER_virtual/libgl ?= "vc-graphics-hardfp"
PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers-raspberrypi"
+
+# The graphics libraries are closed source and provided as binaries with either
+# hardfp and softfp calling conventions. We need to choose the one that fits
+# in with the rest of the system.
+PREFERRED_PROVIDER_virtual/egl ?= "${@bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "vc-graphics-hardfp", "vc-graphics", d)}"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "${@bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "vc-graphics-hardfp", "vc-graphics", d)}"
+PREFERRED_PROVIDER_virtual/libgl ?= "${@bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "vc-graphics-hardfp", "vc-graphics", d)}"
--
1.7.9.5


[meta-raspberrypi][PATCH 0/2] Binary graphics library fixes

Philipp Wagner <lists@...>
 

Hi,

I'm working on an application that needs the graphics libraries. Right now
I'm still using the binary libraries (which are still default in
meta-raspberrypi). Unfortunately, the current default configuration has
two problems:
a) It chooses the wrong ABI version (hardfp instead of softfp). To reduce
the possibility for error here I changed the recipe to automatically
select the right version.
b) Many applications dlopen the OpenGL libraries. For that to work, they
need to be listed in the RPROVIDES list. The second patch does that.

I'm aware of the fact that those binary graphics libraries will be
replaced with the new "userland" libraries, but until this is all ready
I'd be grat if those patches could be accepted to have a working-by-default
configuration in the meta-raspberrypi tree.

Philipp

Philipp Wagner (2):
Choose correct ABI version of graphics binaries
Add RPROVIDES for OpenGL libraries

conf/machine/include/rpi-default-providers.inc | 10 +++++++---
recipes-bcm/vc-graphics/vc-graphics.inc | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)

--
1.7.9.5


Status of 1.4 M3 rc2 - slightly delayed

Saul Wold <sgw@...>
 

Folks,

We would normally start the Milestone Build in the morning, so that it would be available by the afternoon and next day in Asia and Europe, at this point the release is ready, we are waiting for the autobuilder to complete the current master build.

We expect the build to start sometime this afternoon with the build completing later this evening (after 22:00). Michael Halstead will send an email with the build details when it completes.

If testing can be started with the source tests, Poky has been branched to 1.4_M3 (git hash: b47d0b23d99a9f72c035c03883b36258da357426)

Thanks for your patience.

--
Sau!

Saul Wold
Yocto Component Wrangler @ Intel
Yocto Project / Poky Build System