Date   

[PATCH 5/8] Fix remote deletion of files

Ioana Grigoropol <ioanax.grigoropol@...>
 

- when deleting a file from a remote directory use the URI and not the location of the file which is null

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@intel.com>
---
.../src/org/yocto/bc/bitbake/BBSession.java | 6 +++---
1 file changed, 3 insertions(+), 3 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 5f919c3..c5354a4 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
@@ -80,7 +80,7 @@ public class BBSession implements IBBSessionListener, IModelElement, Map {
this.pinfo = new ProjectInfo();
pinfo.setLocation(projectRoot);
pinfo.setInitScriptPath(ProjectInfoHelper.getInitScriptPath(projectRoot));
- this.parsingCmd = "DISABLE_SANITY_CHECKS=1 bitbake -e";
+ this.parsingCmd = "DISABLE_SANITY_CHECKS=\"1\" bitbake -e";
}

public BBSession(ShellSession ssession, URI projectRoot, boolean silent) throws IOException {
@@ -376,7 +376,7 @@ public class BBSession implements IBBSessionListener, IModelElement, Map {
}
try {
if(!initialized) { //recheck
- boolean hasErrors = false;
+ boolean hasErrors = false;
String result = shell.execute(parsingCmd, hasErrors);
if(!hasErrors) {
properties = parseBBEnvironment(result);
@@ -725,7 +725,7 @@ public class BBSession implements IBBSessionListener, IModelElement, Map {
try {
if (initialized && (removed != null || changed != null)) {
for(int i=0;removed != null && i<removed.length;i++) {
- if (this.depends.contains(removed[i].getLocation().toString())) {
+ if (this.depends.contains(removed[i].getLocationURI())) {
initialized = false;
return;
}
--
1.7.9.5


[PATCH 4/8] 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@intel.com>
---
.../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 3/8] 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@intel.com>
---
.../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 2/8] 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@intel.com>
---
.../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


[PATCH 1/8] 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@intel.com>
---
.../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


[PATCH 0/8] [eclipse-poky-windows] Multiple fixes against eclipse plugin for working on Windows agains Build Appliance

Ioana Grigoropol <ioanax.grigoropol@...>
 

- Add fixes for Recipe wizard & Bitbake Project Wizard
- Wait for command output in a synchronous way using semaphores
- Fix remote deletion of files
- Initialize Bitbake session & parse environment variables

Ioana Grigoropol (8):
Add console fixes & run commands in a synchronous way
Initialize bitbake session & environment parse variables
Fix Bitbake commander project wizard
Validate Recipe autopopulated fields
Fix remote deletion of files
Fix md5sum & sha256sum pattern checks
Fix bitbake session by disabling sanity checks
Do not rely on AbstractHostShellOutputReader for waiting for command
outputs

.../src/org/yocto/bc/bitbake/BBRecipe.java | 10 +-
.../src/org/yocto/bc/bitbake/BBSession.java | 17 ++-
.../src/org/yocto/bc/bitbake/ShellSession.java | 58 ++++-----
.../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 | 41 ++++--
.../org/yocto/bc/remote/utils/RemoteMachine.java | 6 +-
.../remote/utils/YoctoHostShellProcessAdapter.java | 132 +++++++++++++++++---
.../bc/ui/wizards/NewBitBakeFileRecipeWizard.java | 2 +-
.../ui/wizards/NewBitBakeFileRecipeWizardPage.java | 40 +++---
.../yocto/bc/ui/wizards/install/InstallWizard.java | 85 ++++---------
12 files changed, 297 insertions(+), 180 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

--
1.7.9.5


Qt and OpenGLE package

Kamel BOUHARA <k.bouhara@...>
 

Hi all,

Im trying to build a qt application whitch use qt4e class. Here is the result of the compilation:

.../build/tmp/sysroots/i686-linux/usr/libexec/armv7a-vfp-neon-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.6.4/ld: cannot find -lQtOpenGLE 

So I'am wondering if a package "libqt-embeddedopengl4" exist and can be added to the task-qt4e.bb recipe ? 

--
Best Regards
_______________________________
Kamel BOUHARA







Re: Preempt-rt kernel build for beagleboard

Yu Pan <panyu2000@...>
 

Hi Bruce,

Thanks for commenting :-)

You shouldn't have needed to do this part, since the board already has
a preempt-rt BSP description:

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.4/tree/meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc?h=meta

And when you build the linux-yocto-rt kernel with that board, that
description should be found, and it enables all the base options already.

If you look in your build, what does the file 'linux/meta/top_tgt'
contain ?

This was what puzzles me as well. I thought bitbake should pickup what is specified in beagleboard-preempt-rt.scc to produce the .config in the kernel build directory. But it did not, at least for the PREEMPT part. Below is the PREEMPT related configs in the .config without manually doing the menuconfig:

# CONFIG_PREEMPT_RCU is not set
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT__LL is not set
# CONFIG_PREEMPT_RTB is not set
# CONFIG_PREEMPT_RT_FULL is not set

Follow your pointer, I checked linux/meta/top_tgt, it indeed points to meta/cfg/kernel-cache/bsp/beagleboard/beagleboard-preempt-rt.scc, which includes ktypes/preempt-rt (why not ktypes/preempt-rt.scc?). In ktypes/preempt-rt.cfg (included by ktypes/preempt-rt.scc), CONFIG_PREEMPT_RT_FULL=y is there. So why not this configuration fragment not picked up in the final .config?

Cheers
Pan Yu


Re: IMAGE_INSTALL_append workflow

Trevor Woerner
 

This issue has been entered into the yocto bugzilla as:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=3503


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

Zhang, Jessica
 

Hi Ioana,

The patched won't apply and please rebase against eclipse-poky-windows and resubmit.

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Ioana Grigoropol
Sent: Monday, November 26, 2012 2:05 AM
To: yocto@yoctoproject.org
Subject: [yocto] [PATCH 1/3] Initialize bitbake session & environment parse variables

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

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol@intel.com>
---
.../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

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


Minutes: Yocto Project Technical Team Meeting - Tuesday, November 27, 2012 8:00 AM-9:00 AM (UTC-08:00) Pacific Time (US & Canada).

Liu, Song <song.liu@...>
 

Attendees:
Dave, MichaelH, Ciby, PaulE, ScottG, BjörnS, Ramana, KevinS, TomZ, Eren, AlexG, ALexD, Richard, BrianR,Jefro, LaurentiuP, Nitin, BruceA, RossB, ScottR, JeffP, MarkH, CristianI, DarrenH, DaveST, JessicaZ, Beth, Song, IoanaG.
 
Agenda:
 
* Opens collection - 5 min (Song)
* Yocto 1.4 status - 20 min (Song/team)
- This week will have RC1 for QA to run a full pass testing.
- QA will send out report on the full pass testing on last weekly build.
- M1 feature complete has come and gone. This week is the planning week for M2. Please schedule your features into M2 and make sure you understand the requirement and please consider holidays and your vacation.
- Master status: Ross: a couple of problems, mostly green. Saul: connman issue. Mihai: looking at it. Seems to be autobuilder issue. Can fix it by increasing the timeout.
 
* SWAT team rotation: Ross -> LaurentiuP (Friday, RO national holiday, Beth will cover that day)
* Opens - 10 min
- Ramana: offline configuration tool. Have some ideas and thoughts, would like to hear more feedback on it. Especially from Mark.
. Dave: It is a good idea.
. RP: would like to do it in bitbake. Darren and Mark are working on similar things.
. Mark: Initial idea is to use bitbake. Pass in packages, etc. without all recipe parsing, etc.
. RP: The good place to discuss this is the mailing list.
. Mark will respond this week. Darren will do so too.
- Eren - location of the team.
. Song: we have teams in US, UK, Romania, Canada, China. There are people here from Sweden, India, etc. We are across the globe.
- Jefro: website and wiki. Thanks for everyone who provided feedback, new website was launched. We are going to setup engineering process for maintenance and production. Anyone interested to help, please let Jefro know.
 
* Team Sharing - 20 min
- Darren: have been working on ext for file generation code. Got a prototype for pre-populating files/directories, basic frameworks is there. Will have patches out soon.
- RP: traveling, fixing bugs on autobuilder, sstates, etc. Been an interesting week, the autobuilder is mostly green now.
- Cristian: trying to improve build appliance. Updated to a more recent version of poky repos. Network testing is fixed. Produced some build to test it. Tested in vmware player. Working on virualbox.
- Radu: working system D. fixing some issues and failures on core-image-minimal. Will work on sato. Code is in contrib branch with my name and 'systemd', welcome comments and feedback.
- LaurentiuP: working on package upgrades. Struggling with some relocation issues. It's fixed. Hopefully to move on to the next stage.
- Iona: working on Eclipse for windows. Committed a few patches. A few other issues to be addressed, will send patches today.
- MichaelH: Worked on bugzilla field description, newest version of Bugzilla has the feature. Making sure we have more hard drives. Holiday networking maintenance. Had 4 short network outages. Coming week, generation of the graphs RP asked. Recofnigration for testopia, etc.


Re: IMAGE_INSTALL_append workflow

Robert P. J. Day
 

On Tue, 27 Nov 2012, Trevor Woerner wrote:

On Tue, Nov 27, 2012 at 12:24 PM, Robert P. J. Day
<rpjday@crashcourse.ca> wrote:
and ran the fetchall again. this time, no strace source was fetched,
so it looks like an issue with simple fetching.
Thank you for your testing and observations.

But I'd like to point out that in my tests, all the relevant files
have already been fetched. My DL_DIR already contains everything to
do with bash, trace-cmd, and various others that I have been
testing. The errors I am getting are not fetching-related errors,
but are errors because do_rootfs can't find any packages (since
packages relating to the recently-appended recipes have not been
built).

Somewhere in the guts of bitbake a modified IMAGE_INSTALL_append
variable is not being noticed; packages aren't being created (as
I've noticed) and sources aren't being downloaded (as you have just
noticed). But somehow do_rootfs is noticing the change and
complaining it can't find the necessary packages.
for what it's worth, if you're building an image that's a variation
of a "core" image, an alternate way of adding packages after the fact
is:

CORE_IMAGE_EXTRA_INSTALL = "sysfsutils strace bash"

i just tested it and, when i added a new entry in that list, at least
the fetching understood and fetched that new source and patched it.
so it doesn't solve the original problem with IMAGE_INSTALL_append,
but feel free to see if that variation works for you.

again, it's only valid if you're building a core image or some
variation thereof.

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 Jeff,

Hi Maxin - it would be good to coordinate your effort with the rest of the community.
Sure :)

Can you let us know what you have in mind before starting?
At first, I will try to address the suggestions of Alex along with other modifications based on our requirements.

Also, please let me know if you have trouble with access. I don't see any account requests being held.
I have checked the access rights and it works fine. Thanks!

thanks
Thanks and Regards,
Maxin

On Fri, Nov 23, 2012 at 6:16 AM, Maxin John <Maxin.John@enea.com> wrote:
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
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


--
Jeff Osier-Mixon http://jefro.net/blog
Yocto Project Community Manager @Intel http://yoctoproject.org


Re: IMAGE_INSTALL_append workflow

Robert P. J. Day
 

On Tue, 27 Nov 2012, Trevor Woerner wrote:

On Tue, Nov 27, 2012 at 12:24 PM, Robert P. J. Day
<rpjday@crashcourse.ca> wrote:
and ran the fetchall again. this time, no strace source was fetched,
so it looks like an issue with simple fetching.
Thank you for your testing and observations.

But I'd like to point out that in my tests, all the relevant files
have already been fetched. My DL_DIR already contains everything to
do with bash, trace-cmd, and various others that I have been
testing. The errors I am getting are not fetching-related errors,
but are errors because do_rootfs can't find any packages (since
packages relating to the recently-appended recipes have not been
built).

Somewhere in the guts of bitbake a modified IMAGE_INSTALL_append
variable is not being noticed; packages aren't being created (as
I've noticed) and sources aren't being downloaded (as you have just
noticed). But somehow do_rootfs is noticing the change and
complaining it can't find the necessary packages.
ah, quite so ... but it's still useful to note that the problem
extends even to the act of fetching. weird.

rday

--

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

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


Re: IMAGE_INSTALL_append workflow

Eric Bénard <eric@...>
 

Le Tue, 27 Nov 2012 12:24:06 -0500 (EST),
"Robert P. J. Day" <rpjday@crashcourse.ca> a écrit :
and ran the fetchall again. this time, no strace source was fetched,
so it looks like an issue with simple fetching.
It's not fetched because the build system fails to see the new package
as a dependencie of the image so that's not a fetching issue but a
more global one.

Eric


Re: IMAGE_INSTALL_append workflow

Trevor Woerner
 

On Tue, Nov 27, 2012 at 12:24 PM, Robert P. J. Day
<rpjday@crashcourse.ca> wrote:
and ran the fetchall again. this time, no strace source was fetched,
so it looks like an issue with simple fetching.

Thank you for your testing and observations.

But I'd like to point out that in my tests, all the relevant files
have already been fetched. My DL_DIR already contains everything to do
with bash, trace-cmd, and various others that I have been testing. The
errors I am getting are not fetching-related errors, but are errors
because do_rootfs can't find any packages (since packages relating to
the recently-appended recipes have not been built).

Somewhere in the guts of bitbake a modified IMAGE_INSTALL_append
variable is not being noticed; packages aren't being created (as I've
noticed) and sources aren't being downloaded (as you have just
noticed). But somehow do_rootfs is noticing the change and complaining
it can't find the necessary packages.


Re: [oe] patchwork support for meta-freescale

McClintock Matthew-B29882 <B29882@...>
 

On Tue, Nov 27, 2012 at 5:21 AM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
On Fri, Nov 23, 2012 at 5:13 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
Hi,

Could patchwork support be added to meta-freescale? It'd allow for
easy handle of patches.
Ping?
These are hosted on different organizations... I don't see any repos
from git.yoctoproject.org on http://patches.openembedded.org/.
Although it would be nice to have.

-M


Re: IMAGE_INSTALL_append workflow

Robert P. J. Day
 

On Tue, 27 Nov 2012, Eren Türkay wrote:

On Tue, Nov 27, 2012 at 08:40:26AM -0500, Trevor Woerner wrote:
Thank you, Eric, for the confirmation.

Just to clarify for anyone following along: the problem isn't with
bash or trace-cmd themselves. If I perform the same steps but use
'bash' first, then 'trace-cmd', adding 'bash' succeeds but later
adding 'trace-cmd' causes 'trace-cmd' to fail in the same way
'bash' did when it was added second.
Since it's confirmed from different people, I think it would be
better to report it using bugzilla. I guess that it's not an
intended behaviour/feature of bitbake. Please inform the bug number
so that anyone who is interested can follow.
here's a test i made based on nothing but fetching. using oe-core,
i selected qemuarm, added this line at the bottom of my local.conf:

IMAGE_INSTALL_append = " sysfsutils strace"

and ran

$ bitbake -c fetchall core-image-minimal

when that was done, i checked my downloads directory for the results
of fetching (and patching) those two packages:

$ ls strace*
strace-4.7.tar.xz strace-4.7.tar.xz.done
$ ls sysfs*
sysfs.sh.done sysfsutils-2.1.0.tar.gz
sysfsutils-2.0.0-class-dup.patch.done sysfsutils-2.1.0.tar.gz.done
$

so that seemed to work fine. so i started over with a clean build
and did it in two stages. first, i reduced the line to:

IMAGE_INSTALL_append = " sysfsutils"

ran the same "fetchall" operation again, and verified that that
content had been fetched:

$ ls sysfs*
sysfs.sh.done sysfsutils-2.1.0.tar.gz
sysfsutils-2.0.0-class-dup.patch.done sysfsutils-2.1.0.tar.gz.done
$

i then *changed* the line in local.conf to:

IMAGE_INSTALL_append = " strace sysfsutils"

and ran the fetchall again. this time, no strace source was fetched,
so it looks like an issue with simple fetching.

rday

--

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

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


Re: Need for offline binary configuration

Venkata ramana gollamudi <ramana.gollamudi@...>
 

Looking for comments. Thanks
________________________________________
From: Bruce Ashfield [bruce.ashfield@windriver.com]
Sent: Thursday, November 22, 2012 12:59 AM
To: Venkata ramana gollamudi
Cc: yocto@yoctoproject.org; Sanil kumar; Hatle, Mark; 'dvhart@linux.intel.com'
Subject: Re: [yocto] Need for offline binary configuration

On 12-11-21 11:29 AM, Venkata ramana gollamudi wrote:
Reply inline

-----Original Message-----
From: Bruce Ashfield [mailto:bruce.ashfield@windriver.com]
Sent: Tuesday, November 20, 2012 8:53 PM
To: Venkata ramana gollamudi
Cc: yocto@yoctoproject.org; Sanil kumar; Hatle, Mark
Subject: Re: [yocto] Need for offline binary configuration

On 12-11-20 10:09 AM, Venkata ramana gollamudi wrote:
Poky allows to build custom Linux for you, but we have cases where
the post build customization is required, like user-addition, network
configuration, service control. Even selecting the required packages
can be a post build activity.

The current model requires the image to be rebuilt to support these
configuration.
Offline Configuration tool (OCT), which allows a binary image
customization before making a final target image. This case will be
more evident in larger companies, where platform teams, product teams ,
application teams are distributed and Linux build from source will be
owned and lab tested by a single team, like platform team. Other teams
just configure to use it for product variants from same platform build.

Detailed use cases can be found in enhancement bug:3252

OCT should work on the binary pool of compiled packages generated
from poky.

The basic operations that can be supported includes
a) Select/deselect required packages from pool of binary packages
into final target image.
b) Provision to select external binary packages like ADT compiled
applications as input and add them to final target image.
c) Binary level Offline configuration can includes
Configure the users/passwords
Configure the network
Configure the host name
Select the services to be started by default
Security related configuration
Generate initrd in ramfs/ext3/... format
etc..

Considering the methods to support these in our current yocto model,
following changes can be done.
1) HOB can be the tool which can be extended to support these
Poky can generate a binary package pool as one if its output and
Hob can work on this package pool to select packages, configure and
generate image.
So HOB can support opening HOB in Binary(or OCT) mode i.e., without
build options but only with binary package selection. Configuration GUI
needs to be added to HOB.
Note:HOB+OCT is together or separate, needs a bit more thought and
overall organization as they will be intended for different users.

Is there some overlap between this point and the other ongoing
discussions
about image construction, deployment and package management ?

i.e. this thread:

[OE-core] RFC: OE-Core image creation and deployment

http://lists.linuxtogo.org/pipermail/openembedded-core/2012-
July/026938.html

These may already be coordinated, but I do see some common threads and
it would be nice to make sure everything will work together and that we
aren't duplicating effort!

Cheers,

Bruce
Bruce, Thanks for the information. After your reply, I have gone through the discussions and agree that binary pool is in similar lines. Great to see that the realization happening in yocto1.4.
Understood that package-feed can be used to generate the target image.

Is there any RFC/mail/wiki available explaining how the configuration(like fstype) during image generation will be realized?
Not that I know of. It is still under design last I heard, but MarkH is the
person to provide the details. He's out of the office at the moment, but
I'm sure that when he is back he can provide plenty of information.


I am looking for post build configuration tool, which allows the product team users also to configure users, network, services etc .
Agreed. I see this as something to start with, since it doesn't overlap
with the other efforts (that I know of), and when I first read your
email I thought it was the main focus. When you continued into image
creation and package selection, that's when I noted the overlap.

Image type, file system and Partition configuration can be one of them.
I expect the product team users who configures image and generates target image, will have a little or no knowledge of bitbake, also needs easy installation and less dependencies.

Can look in this context, how HOB will fit into this scenario or needs a new tool.
Keeping the number of tools low is a good thing, so hopefully it can fit
within the existing options.



2) Binary package pool can be a minimal/partial sstate-cache, as
complete sstate-cache is quite big and not required for product teams
as they are not expected to build but just need to select and
configure.
I think it is sufficient to keep the minimal binaries from
sstate-cache which are required to execute image.bbclass, do_rootfs
task to generate image.
Point 2, No longer applicable as package-feed is a binary pool.

3) Along with specific configuration UI implementation, a generic
configuration model similar to kernel kconfig and menuconfig can be
considered, in cases where more detailed offline configurations is
required like detailed security configuration.
Point 3, still can be thought about.
There have been other menuconfig efforts in the past (that I've heard
about, but not had direct involvement), so doing some research in this
area would be appropriate as well.

cheers,

Bruce



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


Re: IMAGE_INSTALL_append workflow

Eren Türkay <eren@...>
 

On Tue, Nov 27, 2012 at 08:40:26AM -0500, Trevor Woerner wrote:
Thank you, Eric, for the confirmation.

Just to clarify for anyone following along: the problem isn't with
bash or trace-cmd themselves. If I perform the same steps but use
'bash' first, then 'trace-cmd', adding 'bash' succeeds but later
adding 'trace-cmd' causes 'trace-cmd' to fail in the same way 'bash'
did when it was added second.
Since it's confirmed from different people, I think it would be better to report
it using bugzilla. I guess that it's not an intended behaviour/feature of
bitbake. Please inform the bug number so that anyone who is interested can
follow.

--
. 73! DE TA1AET
http://erenturkay.com/