Date   

Re: [meta-mono][PATCH 1/2] layer.conf: Use .= for adding to BBPATH and += to BBFILES

Autif Khan <autif.mlist@...>
 

On Mon, Jan 21, 2013 at 6:17 PM, Khem Raj <raj.khem@...> wrote:
Fixes parsing errors which is appearing after this commit to
meta-openembedded

http://cgit.openembedded.org/meta-openembedded/commit/?id=3c21a46020bd0816579648f

This triggers
exception NameError: name 'base_contains' is not defined
without this change

Signed-off-by: Khem Raj <raj.khem@...>
---
conf/layer.conf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/conf/layer.conf b/conf/layer.conf
index 6bcf70e..d8cc797 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -1,8 +1,8 @@
# We have a conf and classes directory, add to BBPATH
-BBPATH := "${BBPATH}:${LAYERDIR}"
+BBPATH .= ":${LAYERDIR}"

# We have a recipes directory, add to BBFILES
-BBFILES := "${BBFILES} ${LAYERDIR}/recipes-mono/*/*.bb \
+BBFILES += "${LAYERDIR}/recipes-mono/*/*.bb \
${LAYERDIR}/recipes-mono/*/*.bbappend"

BBFILE_COLLECTIONS += "mono"
--
1.7.9.5
Merged into master

Apologies for late merge - somehow this got lost because of bad email
filtering on my part.


Re: [meta-baryon][PATCH 0/4] Webmin updates/fixes

Paul Eggleton
 

On Tuesday 26 February 2013 11:56:49 kevin.strasser@... wrote:
The following changes since commit

6c7948d9ca339caa6647b7e3f20ab82508f0793a:
schroedinger: specify the version of MPL in use (2013-01-03 13:46:02

-0800)

are available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/webmin-update
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/webmin-up
date>
Kevin Strasser (1):
webmin: correct net-lib.pl patch

Paul Eggleton (3):
webmin: update to 1.620
webmin: tidy up recipe
webmin: fix for changes in OE-Core master
This looks great, but I noticed that the nfs-utils recipe in oe-core has
been updated and is causing our bbappend to break. I went ahead and made
the update and applied a commit on top of these changes. That addition is
available in a branch at:

git://git.yoctoproject.org/poky-contrib
strassek/webmin-update_and_nfs-utils
Thanks Kevin, I've now pushed all of these changes to master (with a slight
tweak to the nfs-utils commit message 1.7.7 -> 1.2.7).

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre


Re: Trying to compile mono on target for machine crownbay

Autif Khan <autif.mlist@...>
 

On Wed, Feb 20, 2013 at 11:30 AM, Evgheni Antropov <aidjek@...> wrote:
In my case I have resolved it in another way:

correct in Makefile for "eglib" folder SUBDIRS variables and excluded "test"
from them values:

-----------------------------------------
egrep "SUBDIRS =" ./mono-2.10.2/build/eglib/Makefile
DIST_SUBDIRS = src test
SUBDIRS = src test
#SUBDIRS = src
#SUBDIRS = src
#SUBDIRS = src

+++++++++++++++++++++++++++++++++++++++++
egrep "SUBDIRS =" ./mono-2.10.2/build/eglib/Makefile
DIST_SUBDIRS = src
SUBDIRS = src
#SUBDIRS = src
#SUBDIRS = src
#SUBDIRS = src

"build" is my own directory where I'm compiling mono.

Just FYI - meta-mono is available as a layer that can build mono on a
build machine (cross compilation) instead of natively compiling mono
in target device.

http://git.yoctoproject.org/cgit/cgit.cgi/meta-mono/


Re: Updating uboot to v2013.01

Khem Raj
 

On Tue, Feb 26, 2013 at 11:44 PM, Satya Swaroop Damarla
<swaroop.damarla@...> wrote:
Hey Rudy,

I think, it doesnot automatically take a kernel but we have to choose the
kernel and I chose it v3.2 but seems it doesnot support my board and so I
should take a kernel from the original and configure it to my need.... Here
is the only error message I see about linux kernel

WARNING: linux-dummy: No generic license file exists for: GPL in any
provider
well it seems you are missing a whole BSP for this board. So I would suggest
to go through the BSP guide and setup one for your board

my board is Avionic Tamonten Carrier, based on NVIDIA harmony board.
Suggestions are very much appreciated but I am also currently trying to
solve it.. I just downloaded a git kernel from the avionic site and can you
please tell me how to configure it to so that the build system takes this as
kernel and build it

Greets,
Satya


On Tue, Feb 26, 2013 at 6:21 PM, Rudolf Streif <rstreif@...>
wrote:

Satya,

So what exactly do you get when building the kernel? No image at all in
tmp/deploy/images? What do the logs for the kernel recipes say?

Rudi


On Mon, Feb 25, 2013 at 11:36 PM, Satya Swaroop Damarla
<swaroop.damarla@...> wrote:

hey hans,

I think you are right about the kernel device tree.. I think it should
come with the kernel but I have no idea why it works.. Only an expert should
say why it works.. I think my work is not complete. I can generate the
rootfs and the uboot.bin file but not the uImage... I have no idea... Diid
you complete generating the image for the board?

Greets,
Satya


On Mon, Feb 25, 2013 at 5:05 PM, Hans Beckérus <hans.beckerus@...>
wrote:



25 feb 2013 kl. 15:58 skrev Satya Swaroop DAMARLA <swaroop@...>:

Guys. I found the solution to this problem....

I think if you already install uboot-tools or uboot-mkimage packes from
Ubuntu repository then it is used instead of the one that is downloaded and
we should uninstall the packages and then rerun the build,,... Then IT
WORKS... So, thank you for the time and enegry... I assume this thread is
closed and this is the solution and if this doesnot work for some then
please post it and we may discuss the situation depending on the problem,

Greetings & Regards,
Satya

Same comment here as for the device tree compiler. You should use the
uboot tools/version as they come with the package. Not the one used by the
host distro. To me this is not a proper solution.



On Thu, Feb 21, 2013 at 5:28 PM, Rudolf Streif
<rstreif@...> wrote:

Satya,

I will look into it later today. I am currently at the Linux
Foundation's Embedded Linux Conference.

Rudi


On Thu, Feb 21, 2013 at 2:10 AM, Satya Swaroop DAMARLA
<swaroop@...> wrote:

Hello Guys,

I have not received any reply from you. If you can help me to figure
out what the errors mean when adding a new .bb or recipe file then I can
learn the mistake and take care in the new recipes.... I request your time


On Wed, Feb 20, 2013 at 7:19 PM, Satya Swaroop Damarla
<swaroop.damarla@...> wrote:

hey Guys... I get the following error... which I attached.. Its
completely greek and latin to me.. Can you please help me..


On Wed, Feb 20, 2013 at 7:19 PM, Satya Swaroop DAMARLA
<swaroop@...> wrote:

hey Guys... I get the following error... which I attached.. Its
completely greek and latin to me.. Can you please help me..


On Wed, Feb 20, 2013 at 6:46 PM, Hans Beckérus
<hans.beckerus@...> wrote:

On Wed, Feb 20, 2013 at 6:12 PM, Satya Swaroop Damarla
<swaroop.damarla@...> wrote:
Hey hans, this is what he meant,

In the machine config file add the following

PREFERRED_VERSION_u-boot ?= "v2013.01%" or
PREFERRED_VERSION_u-boot ?=
"v2013.01.01%"

By the way did you already complete the first part... There is
also other
file called "u-boot-fw-utils_2012.04.01.bb" ... I think we should
do the
same...

Hans bytheway, are you also working on the same board or
diffferent board
with same problem?
Different board, same core, similar problem ;)
Now I get it. Thanks. But still question remains how in earth I
managed to build the kernel if not also having copied/renamed the
mkimage .bb?
Is the PREFERRED_VERSION_u-boot used to determine what mkimage and
fw
utils it picks up?
Then it might be that since I/we build u-boot as a separate
package,
but kernel lifts in the mkimage stuff, it works but the wrong
package
was used.
In my case obviously compatible, but not recommended I guess. Also,
I
agree that the fw utils should probably be in sync similar to
mkimage.

Hans






On Wed, Feb 20, 2013 at 6:01 PM, Hans Beckérus
<hans.beckerus@...>
wrote:

On Wed, Feb 20, 2013 at 5:16 PM, Rudolf Streif
<rstreif@...> wrote:
Satya,

Simply look at the u-boot recipes in meta/recipes-bsp/u-boot
such as
u-boot_2012.04.01.bb. You can simply copy it and name it
u-boot_2013.01.bb
and then modify SRCREV to the revision that corresponds to the
tag
2013.01
or 2013.01.01 in git.denx.de:

for 2013.01: 3a9d879f6f64585b819af728b53be0a05037fe0d
for 2013.01.01: e8ae0fa5edd152b2b29c470b88429be4cdcd2c46

Do the same for u-boot-mkimage and include the u-boot version
with your
bsp.

Rudi

Hi Rudi, sorry to chime in , but I have a similar problem but do
not
really get the last thing you said.
What do you mean by including the u-boot version in the bsp?
Also is
it a must to also copy the mkimage .bb or will the system find a
suitable one automatically?
The thing is that I only copied/edited the u-boot .bb but never
the
mkimage. Still my kernel successfully builds the kernel uImage!?
Some magic that I have missed :)

Hans


On Wed, Feb 20, 2013 at 5:17 AM, Satya Swaroop Damarla
<swaroop.damarla@...> wrote:

Hi Guys,

I need support for uboot on Tamonten board but the version on
it is
v2012.04 but I came to know that v2012.10 or v2013.01
supports the
Tamontenboard through some guys here..

It would be great if you can tell me how can I accomplish
v2013.01 or
v2012.10 into the build system and make it available so that
I can
compile
the and get uImage

(Tamonten board is a derivative of harmony board with some
changes and
has
arm cortexa9 processor without neon extentions )

I am kind of new to add new .bb files and help is really
appreciated as
I
am not able to figure out how to add

Greetings & Regards,
Swaroop

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


--
--
Rudolf J. Streif
Director of Embedded Solutions
The Linux Foundation

rudolf.streif@...
Phone: +1.619.631.5383
Skype: rudolfstreif
PGP: RSA 2048/2048 D6E7D28B

Linux Foundation Events Schedule: events.linuxfoundation.org
Linux Foundation Training Schedule:
training.linuxfoundation.org


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


--
--
Rudolf J. Streif
Director of Embedded Solutions
The Linux Foundation

rudolf.streif@...
Phone: +1.619.631.5383
Skype: rudolfstreif
PGP: RSA 2048/2048 D6E7D28B

Linux Foundation Events Schedule: events.linuxfoundation.org
Linux Foundation Training Schedule: training.linuxfoundation.org


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


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

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


--
--
Rudolf J. Streif
Director of Embedded Solutions
The Linux Foundation

rudolf.streif@...
Phone: +1.619.631.5383
Skype: rudolfstreif
PGP: RSA 2048/2048 D6E7D28B

Linux Foundation Events Schedule: events.linuxfoundation.org
Linux Foundation Training Schedule: training.linuxfoundation.org

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


[PATCH 5/5] plugins/sdk.ide: Use standard error dialog to show SDK check errors

Timo Mueller <mail@...>
 

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


Signed-off-by: Timo Mueller <timo.mueller@...>
---
.../src/org/yocto/sdk/ide/YoctoUISetting.java | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index ba80cb1..f27019d 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -14,6 +14,8 @@ import java.io.File;
import java.util.ArrayList;

import org.eclipse.cdt.ui.templateengine.uitree.InputUIElement;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -32,8 +34,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Widget;
import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
@@ -343,13 +343,11 @@ public class YoctoUISetting {
//Show Error Message on the Label to help users.
if ((result != SDKCheckResults.SDK_PASS) && showErrorDialog) {
Display display = Display.getCurrent();
- Shell shell = new Shell(display);
- MessageBox msgBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
- msgBox.setText("Yocto Project Configuration Error");
- msgBox.setMessage(YoctoSDKChecker.getErrorMessage(result, from));
- msgBox.open();
- if (shell != null)
- shell.dispose();
+ ErrorDialog.openError(display.getActiveShell(),
+ "Yocto Project Configuration Error",
+ YoctoSDKChecker.getErrorMessage(result, from),
+ new Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
+
}

return result;
--
1.7.11.7


[PATCH 4/5] plugins/sdk.ide: Removed validation from setCurrentInput

Timo Mueller <mail@...>
 

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

The result of the validation did not affect the behaviour of the
method. Also an error is not reported back to the caller or the
user. Validation of the setting should be handled before setting the
input or on save.

Signed-off-by: Timo Mueller <timo.mueller@...>
---
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 6 ------
1 file changed, 6 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 2affe82..ba80cb1 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -335,12 +335,6 @@ public class YoctoUISetting {
textKernelLoc.setText(elem.getStrQemuKernelLoc());
textQemuOption.setText(elem.getStrQemuOption());
textSysrootLoc.setText(elem.getStrSysrootLoc());
-
- SDKCheckResults result = validateInput(SDKCheckRequestFrom.Preferences, false);
- if (result != SDKCheckResults.SDK_PASS) {
- System.out.println("Have you ever set Yocto Project Reference before?");
- System.out.println(YoctoSDKChecker.getErrorMessage(result, SDKCheckRequestFrom.Other));
- }
}

public SDKCheckResults validateInput(SDKCheckRequestFrom from, boolean showErrorDialog) {
--
1.7.11.7


[PATCH 3/5] plugins/sdk.ide: Show SDK check errors in message area

Timo Mueller <mail@...>
 

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

If settings made by the user do not pass the SDK check the error
message was not shown in eclipse but was printed to system out which
was never visible by the user.

The error is now shown in the message area of the property or preference
page if the check fails.

Signed-off-by: Timo Mueller <timo.mueller@...>
---
.../src/org/yocto/sdk/ide/YoctoUISetting.java | 43 ++++-------
.../ide/preferences/YoctoSDKPreferencePage.java | 84 ++++++++++-----------
.../preferences/YoctoSDKProjectPropertyPage.java | 85 +++++++++++-----------
3 files changed, 97 insertions(+), 115 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 74cfd69..2affe82 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -336,40 +336,29 @@ public class YoctoUISetting {
textQemuOption.setText(elem.getStrQemuOption());
textSysrootLoc.setText(elem.getStrSysrootLoc());

- try {
- validateInput(SDKCheckRequestFrom.Preferences, false);
- } catch (YoctoGeneralException e) {
+ SDKCheckResults result = validateInput(SDKCheckRequestFrom.Preferences, false);
+ if (result != SDKCheckResults.SDK_PASS) {
System.out.println("Have you ever set Yocto Project Reference before?");
- System.out.println(e.getMessage());
+ System.out.println(YoctoSDKChecker.getErrorMessage(result, SDKCheckRequestFrom.Other));
}
}

- public boolean validateInput(SDKCheckRequestFrom from, boolean bPrompt) throws YoctoGeneralException {
- YoctoUIElement elem = getCurrentInput();
- boolean pass = true;
- String strErrorMessage;
-
- SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(elem);
+ public SDKCheckResults validateInput(SDKCheckRequestFrom from, boolean showErrorDialog) {
+ SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(getCurrentInput());

//Show Error Message on the Label to help users.
- if (result != SDKCheckResults.SDK_PASS) {
- strErrorMessage = YoctoSDKChecker.getErrorMessage(result, from);
- pass = false;
- if (bPrompt)
- {
- Display display = Display.getCurrent();
- Shell shell = new Shell(display);
- MessageBox msgBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
- msgBox.setText("Yocto Project Configuration Error");
- msgBox.setMessage(strErrorMessage);
- msgBox.open();
- if (shell != null)
- shell.dispose();
- }
-
- throw new YoctoGeneralException(strErrorMessage);
+ if ((result != SDKCheckResults.SDK_PASS) && showErrorDialog) {
+ Display display = Display.getCurrent();
+ Shell shell = new Shell(display);
+ MessageBox msgBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
+ msgBox.setText("Yocto Project Configuration Error");
+ msgBox.setMessage(YoctoSDKChecker.getErrorMessage(result, from));
+ msgBox.open();
+ if (shell != null)
+ shell.dispose();
}
- return pass;
+
+ return result;
}

public void setUIFormEnabledState(boolean isEnabled) {
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index ef681a4..1a8c8ca 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -26,14 +26,14 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.yocto.sdk.ide.YoctoGeneralException;
import org.yocto.sdk.ide.YoctoProfileElement;
import org.yocto.sdk.ide.YoctoProfileSetting;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
import org.yocto.sdk.ide.YoctoSDKMessages;
import org.yocto.sdk.ide.YoctoSDKPlugin;
import org.yocto.sdk.ide.YoctoSDKProjectNature;
import org.yocto.sdk.ide.YoctoSDKUtils;
-import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
import org.yocto.sdk.ide.YoctoUIElement;
import org.yocto.sdk.ide.YoctoUISetting;

@@ -75,60 +75,57 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench

protected Control createContents(Composite parent) {
initializeDialogUnits(parent);
- final Composite result= new Composite(parent, SWT.NONE);
-
- yoctoProfileSetting.createComposite(result);
-
- try {
- yoctoUISetting.createComposite(result);
- yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
- Dialog.applyDialogFont(result);
- return result;
- } catch (YoctoGeneralException e) {
- System.out.println("Have you ever set Yocto Project Reference before?");
- System.out.println(e.getMessage());
- return result;
+ final Composite composite= new Composite(parent, SWT.NONE);
+
+ yoctoProfileSetting.createComposite(composite);
+ yoctoUISetting.createComposite(composite);
+
+ SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+ if (result != SDKCheckResults.SDK_PASS) {
}
+
+ Dialog.applyDialogFont(composite);
+ return composite;
}

/*
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
- try {
- yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+ setErrorMessage(null);

- YoctoUIElement savedElement = YoctoSDKUtils.getElemFromStore(getPreferenceStore());
- YoctoUIElement modifiedElement = yoctoUISetting.getCurrentInput();
+ SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+ if (result != SDKCheckResults.SDK_PASS) {
+ setErrorMessage(result.getMessage());
+ return false;
+ }

- if (savedElement.equals(modifiedElement)) {
- return true;
- }
+ YoctoUIElement savedElement = YoctoSDKUtils.getElemFromStore(getPreferenceStore());
+ YoctoUIElement modifiedElement = yoctoUISetting.getCurrentInput();

- YoctoProfileElement profileElement = yoctoProfileSetting.getCurrentInput();
- HashSet<IProject> yoctoProjects = getAffectedProjects(profileElement.getSelectedProfile());
+ if (savedElement.equals(modifiedElement)) {
+ return true;
+ }
+
+ YoctoProfileElement profileElement = yoctoProfileSetting.getCurrentInput();
+ HashSet<IProject> yoctoProjects = getAffectedProjects(profileElement.getSelectedProfile());

- if (!yoctoProjects.isEmpty()) {
- boolean deleteConfirmed =
- MessageDialog.openConfirm(null, YoctoSDKMessages.getString(UPDATE_DIALOG_TITLE),
- YoctoSDKMessages.getFormattedString(UPDATE_DIALOG_MESSAGE, profileElement.getSelectedProfile()));
+ if (!yoctoProjects.isEmpty()) {
+ boolean deleteConfirmed =
+ MessageDialog.openConfirm(null, YoctoSDKMessages.getString(UPDATE_DIALOG_TITLE),
+ YoctoSDKMessages.getFormattedString(UPDATE_DIALOG_MESSAGE, profileElement.getSelectedProfile()));

- if (!deleteConfirmed) {
- return false;
- }
+ if (!deleteConfirmed) {
+ return false;
}
+ }

- YoctoSDKUtils.saveElemToStore(modifiedElement, getPreferenceStore());
- YoctoSDKUtils.saveProfilesToDefaultStore(profileElement);
+ YoctoSDKUtils.saveElemToStore(modifiedElement, getPreferenceStore());
+ YoctoSDKUtils.saveProfilesToDefaultStore(profileElement);

- updateProjects(yoctoProjects, modifiedElement);
+ updateProjects(yoctoProjects, modifiedElement);

- return super.performOk();
- } catch (YoctoGeneralException e) {
- // TODO Auto-generated catch block
- System.out.println(e.getMessage());
- return false;
- }
+ return super.performOk();
}

/*
@@ -144,10 +141,9 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
YoctoProfileElement profileElement = yoctoProfileSetting.getCurrentInput();
YoctoUIElement uiElement = yoctoUISetting.getCurrentInput();

- try {
- yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
- } catch (YoctoGeneralException e) {
- // just abort saving, validateInput will show an error dialog
+ SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
+ if (result != SDKCheckResults.SDK_PASS) {
+ setErrorMessage(result.getMessage());
return;
}

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 551d3bd..ca148af 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -20,11 +20,11 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbenchPropertyPage;
import org.eclipse.ui.dialogs.PropertyPage;
-import org.yocto.sdk.ide.YoctoGeneralException;
import org.yocto.sdk.ide.YoctoProfileElement;
import org.yocto.sdk.ide.YoctoProfileSetting;
import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
import org.yocto.sdk.ide.YoctoSDKPlugin;
import org.yocto.sdk.ide.YoctoSDKUtils;
import org.yocto.sdk.ide.YoctoUIElement;
@@ -63,32 +63,29 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
yoctoProjectSpecificSetting = new YoctoProjectSpecificSetting(yoctoProfileSetting, yoctoUISetting, this);

initializeDialogUnits(parent);
- final Composite result = new Composite(parent, SWT.NONE);
-
- yoctoProfileSetting.createComposite(result);
- yoctoProjectSpecificSetting.createComposite(result);
-
- try {
- yoctoUISetting.createComposite(result);
-
- if (useProjectSpecificSetting) {
- yoctoProfileSetting.setUIFormEnabledState(false);
- yoctoProjectSpecificSetting.setUseProjectSpecificSettings(true);
- yoctoUISetting.setUIFormEnabledState(true);
- yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
- } else {
- yoctoProfileSetting.setUIFormEnabledState(true);
- yoctoProjectSpecificSetting.setUseProjectSpecificSettings(false);
- yoctoUISetting.setUIFormEnabledState(false);
- }
+ final Composite composite = new Composite(parent, SWT.NONE);
+
+ yoctoProfileSetting.createComposite(composite);
+ yoctoProjectSpecificSetting.createComposite(composite);
+ yoctoUISetting.createComposite(composite);
+
+ if (useProjectSpecificSetting) {
+ yoctoProfileSetting.setUIFormEnabledState(false);
+ yoctoProjectSpecificSetting.setUseProjectSpecificSettings(true);
+ yoctoUISetting.setUIFormEnabledState(true);

- Dialog.applyDialogFont(result);
- return result;
- } catch (YoctoGeneralException e) {
- System.out.println("Have you ever set Yocto Project Reference before?");
- System.out.println(e.getMessage());
- return result;
+ SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+ if (result != SDKCheckResults.SDK_PASS) {
+ setErrorMessage(result.getMessage());
+ }
+ } else {
+ yoctoProfileSetting.setUIFormEnabledState(true);
+ yoctoProjectSpecificSetting.setUseProjectSpecificSettings(false);
+ yoctoUISetting.setUIFormEnabledState(false);
}
+
+ Dialog.applyDialogFont(composite);
+ return composite;
}

private IProject getProject() {
@@ -121,28 +118,28 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
*/
@Override
public boolean performOk() {
- try {
- IProject project = getProject();
-
- if (yoctoProjectSpecificSetting.isUsingProjectSpecificSettings()) {
- yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
-
- YoctoSDKUtils.saveUseProjectSpecificOptionToProjectPreferences(project, true);
- YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
- YoctoSDKUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
- } else {
- YoctoSDKUtils.saveUseProjectSpecificOptionToProjectPreferences(project, false);
- YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
- }
+ setErrorMessage(null);
+
+ IProject project = getProject();

- YoctoSDKUtils.saveElemToProjectEnv(yoctoUISetting.getCurrentInput(), getProject());
+ if (yoctoProjectSpecificSetting.isUsingProjectSpecificSettings()) {
+ SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+ if (result != SDKCheckResults.SDK_PASS) {
+ setErrorMessage(result.getMessage());
+ return false;
+ }

- return super.performOk();
- } catch (YoctoGeneralException e) {
- // TODO Auto-generated catch block
- System.out.println(e.getMessage());
- return false;
+ YoctoSDKUtils.saveUseProjectSpecificOptionToProjectPreferences(project, true);
+ YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
+ YoctoSDKUtils.saveElemToProjectPreferences(yoctoUISetting.getCurrentInput(), project);
+ } else {
+ YoctoSDKUtils.saveUseProjectSpecificOptionToProjectPreferences(project, false);
+ YoctoSDKUtils.saveProfilesToProjectPreferences(yoctoProfileSetting.getCurrentInput(), project);
}
+
+ YoctoSDKUtils.saveElemToProjectEnv(yoctoUISetting.getCurrentInput(), getProject());
+
+ return super.performOk();
}

public void switchProfile(String selectedProfile)
--
1.7.11.7


[PATCH 2/5] plugins/sdk.ide: Refactored the construction of mesages with SDKCheckResults

Timo Mueller <mail@...>
 

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

The message keys are now stored with the enum values simplifying the
construction of error messages.

Error messages have also been split up into a one line error message
and an advice. The one line error message can for example be used in
UI Parts with limited space (e.g. message area on property and
preference pages). Dialogs or log messages can use the complete
message to give the user a hint on what to do in order to fix the
error.

Signed-off-by: Timo Mueller <timo.mueller@...>
---
.../src/org/yocto/sdk/ide/YoctoSDKChecker.java | 159 +++++++++------------
.../org/yocto/sdk/ide/YoctoSDKMessages.properties | 42 ++++--
2 files changed, 99 insertions(+), 102 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
index fd50f18..9579021 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
@@ -1,5 +1,7 @@
/*******************************************************************************
* Copyright (c) 2010 Intel Corporation.
+ * Copyright (c) 2013 BMW Car IT GmbH.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +9,7 @@
*
* Contributors:
* Intel - initial API and implementation
+ * BMW Car IT - include error and advice messages with check results
*******************************************************************************/
package org.yocto.sdk.ide;

@@ -17,45 +20,76 @@ import java.io.FilenameFilter;
import java.io.IOException;

public class YoctoSDKChecker {
+ private static final String[] saInvalidVer = {"1.0", "0.9", "0.9+"};
+ private static final String SYSROOTS_DIR = "sysroots";

public static enum SDKCheckResults {
- SDK_PASS,
- POKY_DEVICE_EMPTY,
- TOOLCHAIN_LOCATION_EMPTY,
- TOOLCHAIN_LOCATION_NONEXIST,
- SDK_TARGET_EMPTY,
- QEMU_KERNEL_EMPTY,
- SYSROOT_EMPTY,
- QEMU_KERNEL_NONEXIST,
- SYSROOT_NONEXIST,
- WRONG_ADT_VERSION,
- ENV_SETUP_SCRIPT_NONEXIST,
- TOOLCHAIN_NO_SYSROOT,
- TOOLCHAIN_HOST_MISMATCH
+ SDK_PASS("", false),
+ TOOLCHAIN_LOCATION_EMPTY(
+ "Poky.SDK.Location.Empty", true),
+ TOOLCHAIN_LOCATION_NONEXIST(
+ "Poky.SDK.Location.Nonexist", true),
+ SDK_TARGET_EMPTY(
+ "Poky.SDK.Target.Empty", true),
+ SYSROOT_EMPTY(
+ "Poky.Sysroot.Empty", true),
+ SYSROOT_NONEXIST(
+ "Poky.Sysroot.Nonexist", true),
+ QEMU_KERNEL_EMPTY(
+ "Poky.Qemu.Kernel.Empty", true),
+ QEMU_KERNEL_NONEXIST(
+ "Poky.Qemu.Kernel.Nonexist", true),
+ WRONG_ADT_VERSION(
+ "Poky.ADT.Sysroot.Wrongversion", false),
+ ENV_SETUP_SCRIPT_NONEXIST(
+ "Poky.Env.Script.Nonexist", false),
+ TOOLCHAIN_NO_SYSROOT(
+ "Poky.Toolchain.No.Sysroot", false),
+ TOOLCHAIN_HOST_MISMATCH(
+ "Poky.Toolchain.Host.Mismatch", false);
+
+ private static final String DEFAULT_ADVICE = "Default.Advice";
+ private static final String ADVICE_SUFFIX = ".Advice";
+
+ private final String messageID;
+ private final boolean addDefaultAdvice;
+
+ private SDKCheckResults(final String messageID, final boolean addDefaultAdvice) {
+ this.messageID = messageID;
+ this.addDefaultAdvice = addDefaultAdvice;
+ }
+
+ public String getMessage() {
+ return YoctoSDKMessages.getString(messageID);
+ }
+
+ public String getAdvice() {
+ String advice = YoctoSDKMessages.getString(messageID + ADVICE_SUFFIX);
+
+ if (addDefaultAdvice) {
+ advice += YoctoSDKMessages.getString(DEFAULT_ADVICE);
+ }
+
+ return advice;
+ }
};

public static enum SDKCheckRequestFrom {
- Wizard,
- Menu,
- Preferences,
- Other
- };
+ Wizard("Poky.SDK.Error.Origin.Wizard"),
+ Menu("Poky.SDK.Error.Origin.Menu"),
+ Preferences("Poky.SDK.Error.Origin.Preferences"),
+ Other("Poky.SDK.Error.Origin.Other");

- private static final String POKY_DEVICE_EMPTY = "Poky.SDK.Device.Empty";
- private static final String TOOLCHAIN_LOCATION_EMPTY = "Poky.SDK.Location.Empty";
- private static final String SDK_TARGET_EMPTY = "Poky.SDK.Target.Empty";
- private static final String TOOLCHAIN_LOCATION_NONEXIST = "Poky.SDK.Location.Nonexist";
- private static final String QEMU_KERNEL_EMPTY = "Poky.Qemu.Kernel.Empty";
- private static final String SYSROOT_EMPTY = "Poky.Sysroot.Empty";
- private static final String QEMU_KERNEL_NONEXIST = "Poky.Qemu.Kernel.Nonexist";
- private static final String SYSROOT_NONEXIST = "Poky.Sysroot.Nonexist";
- private static final String WRONG_ADT_VERSION = "Poky.ADT.Sysroot.Wrongversion";
- private static final String ENV_SETUP_SCRIPT_NONEXIST = "Poky.Env.Script.Nonexist";
- private static final String TOOLCHAIN_NO_SYSROOT = "Poky.Toolchain.No.Sysroot";
- private static final String TOOLCHAIN_HOST_MISMATCH = "Poky.Toolchain.Host.Mismatch";
- private static final String[] saInvalidVer = {"1.0", "0.9", "0.9+"};
-
- private static final String SYSROOTS_DIR = "sysroots";
+ private final String errorMessageID;
+
+ private SDKCheckRequestFrom(final String errorMessageID) {
+ this.errorMessageID = errorMessageID;
+ }
+
+ public String getErrorMessage() {
+ return YoctoSDKMessages.getString(errorMessageID);
+ }
+ };

public static SDKCheckResults checkYoctoSDK(YoctoUIElement elem) {
if (elem.getStrToolChainRoot().isEmpty())
@@ -172,62 +206,9 @@ public class YoctoSDKChecker {

public static String getErrorMessage(SDKCheckResults result, SDKCheckRequestFrom from) {
String strErrorMsg;
-
- switch (from) {
- case Wizard:
- strErrorMsg = "Yocto Wizard Configuration Error:";
- break;
- case Menu:
- strErrorMsg = "Yocto Menu Configuration Error!";
- break;
- case Preferences:
- strErrorMsg = "Yocto Preferences Configuration Error!";
- break;
- default:
- strErrorMsg = "Yocto Configuration Error!";
- break;
- }
-
- switch (result) {
- case POKY_DEVICE_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(POKY_DEVICE_EMPTY);
- break;
- case TOOLCHAIN_LOCATION_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_LOCATION_EMPTY);
- break;
- case SDK_TARGET_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SDK_TARGET_EMPTY);
- break;
- case TOOLCHAIN_LOCATION_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_LOCATION_NONEXIST);
- break;
- case QEMU_KERNEL_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(QEMU_KERNEL_EMPTY);
- break;
- case SYSROOT_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SYSROOT_EMPTY);
- break;
- case QEMU_KERNEL_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(QEMU_KERNEL_NONEXIST);
- break;
- case SYSROOT_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SYSROOT_NONEXIST);
- break;
- case WRONG_ADT_VERSION:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(WRONG_ADT_VERSION);
- break;
- case ENV_SETUP_SCRIPT_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(ENV_SETUP_SCRIPT_NONEXIST);
- break;
- case TOOLCHAIN_NO_SYSROOT:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_NO_SYSROOT);
- break;
- case TOOLCHAIN_HOST_MISMATCH:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_HOST_MISMATCH);
- break;
- default:
- break;
- }
+ strErrorMsg = from.getErrorMessage();
+ strErrorMsg += "\n" + result.getMessage();
+ strErrorMsg += "\n" + result.getAdvice();

return strErrorMsg;
}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index e5748f7..4a4fb60 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -11,19 +11,35 @@
*******************************************************************************/
Wizard.SDK.Warning.Title = Invalid Yocto Project ADT Location

-Poky.SDK.Device.Empty = Please specify External HW IP Adress!
-Poky.SDK.Location.Empty = You need specify tool-chain location before building any project. \nDo IDE-wide settings from Window > Preferences > Yocto Project ADT\nOr do Project-wide settings from Project > Change Yocto Project Settings.
-Poky.SDK.Target.Empty = You need specify Target Architecture before building any project.\nSpecified Location does not contain environment script File!\nDo IDE-wide settings from Window > Preferences > Yocto Project ADT\nOr do Project-wide settings from Project > Change Yocto Project Settings.
-Poky.SDK.Location.Nonexist = Specified SDK toolchain directory does not exist!\nDo IDE-wide settings from Window > Preferences > Yocto Project ADT\nOr do Project-wide settings from Project > Change Yocto Project Settings.
-Poky.Qemu.Kernel.Empty = You need specify Qemu Kernel Image File Location before building any project.\nDo IDE-wide settings from Window > Preferences > Yocto Project ADT\nOr do Project-wide settings from Project > Change Yocto Project Settings.
-Poky.Sysroot.Empty = You need specify Sysroot Location before building any project.\nDo IDE-wide settings from Window > Preferences > Yocto Project ADT \nOr do Project-wide settings from Project > Change Yocto Project Settings.
-Poky.Qemu.Kernel.Nonexist = Specified QEMU kernel Image File does not exist!\nDo IDE-wide settings from Window > Preferences > Yocto Project ADT \nOr do Project-wide settings from Project > Change Yocto Project Settings.
-Poky.Sysroot.Nonexist = Specified sysroot directory does not exist!\nDo IDE-wide settings from Window > Preferences > Yocto Project ADT \nOr do Project-wide settings from Project > Change Yocto Project Settings.
-Poky.Env.Script.Nonexist = Specified Build Tree Toolchain Root does not contain any toolchain yet!\nPlease run "bitbake meta-ide-support" to build the toolchain.
-Poky.ADT.Sysroot.Wrongversion = OECORE related items are not found in envrionement setup files.\nThe ADT version you're using is too old.\n Please upgrade to our latest ADT Version!
-Poky.Toolchain.Host.Mismatch = Toolchain and host arch mismatch.\n Make sure you use 32bit toolchain for 32bit host and same for 64bit machines!
-Poky.Toolchain.No.Sysroot = There's no sysroots directory under your toolchain directory under /opt/poky!
-
+Poky.SDK.Location.Empty = Specified Toolchain Root Location is empty.
+Poky.SDK.Location.Empty.Advice = You need specify Toolchain Root Location before building any project.
+Poky.SDK.Location.Nonexist = Specified SDK toolchain directory does not exist.
+Poky.SDK.Location.Nonexist.Advice = Please specify a valid toolchain directory.
+Poky.SDK.Target.Empty = Specified location does not contain environment script file.
+Poky.SDK.Target.Empty.Advice = You need specify Target Architecture before building any project.
+Poky.Sysroot.Empty = Specified Sysroot Location is empty.
+Poky.Sysroot.Empty.Advice = You need specify Sysroot Location before building any project.
+Poky.Sysroot.Nonexist = Specified Sysroot Location does not exist.
+Poky.Qemu.Kernel.Empty.Advice = You need specify a valid Sysroot Location before building any project.
+Poky.Qemu.Kernel.Empty = Specified QEMU kernel location is emtpy.
+Poky.Qemu.Kernel.Empty.Advice = You need specify QEMU kernel image file Location before building any project.
+Poky.Qemu.Kernel.Nonexist = Specified QEMU kernel image file does not exist.
+Poky.Qemu.Kernel.Empty.Advice = You need specify a valid QEMU kernel image file before building any project.
+Poky.ADT.Sysroot.Wrongversion = The ADT version you're using is too old.
+Poky.ADT.Sysroot.Wrongversion.Advice = OECORE related items are not found in environment setup files.\nPlease upgrade to our latest ADT Version!
+Poky.Env.Script.Nonexist = Specified Build Tree Toolchain Root does not contain any toolchain yet.
+Poky.Env.Script.Nonexist.Advice = Please run "bitbake meta-ide-support" to build the toolchain.
+Poky.Toolchain.No.Sysroot = Specified Toolchain Root Location does not contain a sysroot directory.
+Poky.Toolchain.No.Sysroot.Advice = Please install a valid toolchain sysroot.
+Poky.Toolchain.Host.Mismatch = Toolchain and host arch mismatch.
+Poky.Toolchain.Host.Mismatch.Advice = Make sure you use 32bit toolchain for 32bit host and same for 64bit machines!
+
+Default.Advice = \nDo IDE-wide settings from Window > Preferences > Yocto Project ADT\nOr do Project-wide settings from Project > Change Yocto Project Settings.
+
+Poky.SDK.Error.Origin.Wizard = Yocto Wizard Configuration Error:
+Poky.SDK.Error.Origin.Menu = Yocto Menu Configuration Error:
+Poky.SDK.Error.Origin.Preferences = Yocto Preferences Configuration Error:
+Poky.SDK.Error.Origin.Other = Yocto Configuration Error:

Menu.SDK.Console.Configure.Message = The Yocto Project ADT has been successfully set up for this project.\nTo see the environment variables created during setup,\ngo to Project > Properties > C/C++ Build > Environment.
Menu.SDK.Console.Deploy.Action.Message = \nDeploying {0} to {1} ...\n
--
1.7.11.7


[PATCH 1/5] plugins/sdk.ide: Move SDK check functionality to separate class

Timo Mueller <mail@...>
 

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

The class YoctoSDKChecker provided some unused code for checking a
Yocto SDK configuration. Checking of the SDK was done in
YoctoSDKUtils. An enum for results was provided in both classes (under
the same name) but contained different possible values.

To avoid confusion, reduce duplicate code and to separate the checking
functionality from the rest of the utility functions, the checking
code has been moved completely to the YoctoSDKChecker.

Signed-off-by: Timo Mueller <timo.mueller@...>
---
.../src/org/yocto/sdk/ide/YoctoSDKChecker.java | 361 ++++++++++++---------
.../org/yocto/sdk/ide/YoctoSDKProjectNature.java | 9 +-
.../src/org/yocto/sdk/ide/YoctoSDKUtils.java | 255 ---------------
.../src/org/yocto/sdk/ide/YoctoUISetting.java | 8 +-
.../ide/preferences/YoctoSDKPreferencePage.java | 2 +-
.../preferences/YoctoSDKProjectPropertyPage.java | 2 +-
.../sdk/ide/wizard/NewYoctoCProjectTemplate.java | 18 +-
7 files changed, 229 insertions(+), 426 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
index 87547a2..fd50f18 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
@@ -10,197 +10,252 @@
*******************************************************************************/
package org.yocto.sdk.ide;

+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.IOException;

public class YoctoSDKChecker {
+
public static enum SDKCheckResults {
SDK_PASS,
+ POKY_DEVICE_EMPTY,
TOOLCHAIN_LOCATION_EMPTY,
- TOOLCHAIN_LOCATION_NON_EXIST,
- TARGET_EMPTY,
+ TOOLCHAIN_LOCATION_NONEXIST,
+ SDK_TARGET_EMPTY,
QEMU_KERNEL_EMPTY,
- //QEMU_ROOTFS_EMPTY,
- SDK_BIN_NON_EXIST,
- SDK_SYSROOT_NON_EXIST,
- SDK_PKGCONFIG_NON_EXIST,
- QEMU_KERNEL_NON_EXIST,
- SYSROOT_NON_EXIST,
SYSROOT_EMPTY,
- ENV_SETUP_SCRIPT_NON_EXIST
+ QEMU_KERNEL_NONEXIST,
+ SYSROOT_NONEXIST,
+ WRONG_ADT_VERSION,
+ ENV_SETUP_SCRIPT_NONEXIST,
+ TOOLCHAIN_NO_SYSROOT,
+ TOOLCHAIN_HOST_MISMATCH
};

public static enum SDKCheckRequestFrom {
Wizard,
Menu,
- Preferences
+ Preferences,
+ Other
};

- private static final String WIZARD_SDK_LOCATION_EMPTY = "Wizard.SDK.Location.Empty";
- private static final String WIZARD_TOOLCHAIN_LOCATION_NONEXIST = "Wizard.Toolcahin.Location.Nonexist";
- private static final String WIZARD_SDK_TARGET_EMPTY = "Wizard.SDK.Target.Empty";
- private static final String WIZARD_SDK_BIN_NONEXIST = "Wizard.SDK.Bin.Nonexist";
- private static final String WIZARD_SDK_SYSROOT_NONEXIST = "Wizard.SDK.Sysroot.Nonexist";
- private static final String WIZARD_SDK_PKGCONFIG_NONEXIST = "Wizard.SDK.Pkgconfig.Nonexist";
- private static final String WIZARD_QEMU_KERNEL_EMPTY = "Wizard.Qemu.Kernel.Empty";
- private static final String WIZARD_SYSROOT_EMPTY = "Wizard.Sysroot.Empty";
- private static final String WIZARD_QEMU_KERNEL_NONEXIST = "Wizard.Qemu.Kernel.Nonexist";
- private static final String WIZARD_SYSROOT_NONEXIST = "Wizard.Sysroot.Nonexist";
-
- private static final String MENU_SDK_LOCATION_EMPTY = "Menu.SDK.Location.Empty";
- private static final String MENU_TOOLCHAIN_LOCATION_NONEXIST = "Menu.Toolchain.Location.Nonexist";
- private static final String MENU_SDK_TARGET_EMPTY = "Menu.SDK.Target.Empty";
- private static final String MENU_SDK_BIN_NONEXIST = "Menu.SDK.Bin.Nonexist";
- private static final String MENU_SDK_SYSROOT_NONEXIST = "Menu.SDK.Sysroot.Nonexist";
- private static final String MENU_SDK_PKGCONFIG_NONEXIST = "Menu.SDK.Pkgconfig.Nonexist";
- private static final String MENU_QEMU_KERNEL_EMPTY = "Menu.Qemu.Kernel.Empty";
- private static final String MENU_SYSROOT_EMPTY = "Menu.Sysroot.Empty";
- private static final String MENU_QEMU_KERNEL_NONEXIST = "Menu.Qemu.Kernel.Nonexist";
- private static final String MENU_SYSROOT_NONEXIST = "Menu.Sysroot.Nonexist";
-
- private static final String PREFERENCES_SDK_BIN_NONEXIST = "Preferences.SDK.Bin.Nonexist";
- private static final String PREFERENCES_SDK_SYSROOT_NONEXIST = "Preferences.SDK.Sysroot.Nonexist";
- private static final String PREFERENCES_SDK_PKGCONFIG_NONEXIST = "Preferences.SDK.Pkgconfig.Nonexist";
-
- private static final String ENV_SCRIPT_NONEXIST = "Env.Script.Nonexist";
+ private static final String POKY_DEVICE_EMPTY = "Poky.SDK.Device.Empty";
+ private static final String TOOLCHAIN_LOCATION_EMPTY = "Poky.SDK.Location.Empty";
+ private static final String SDK_TARGET_EMPTY = "Poky.SDK.Target.Empty";
+ private static final String TOOLCHAIN_LOCATION_NONEXIST = "Poky.SDK.Location.Nonexist";
+ private static final String QEMU_KERNEL_EMPTY = "Poky.Qemu.Kernel.Empty";
+ private static final String SYSROOT_EMPTY = "Poky.Sysroot.Empty";
+ private static final String QEMU_KERNEL_NONEXIST = "Poky.Qemu.Kernel.Nonexist";
+ private static final String SYSROOT_NONEXIST = "Poky.Sysroot.Nonexist";
+ private static final String WRONG_ADT_VERSION = "Poky.ADT.Sysroot.Wrongversion";
+ private static final String ENV_SETUP_SCRIPT_NONEXIST = "Poky.Env.Script.Nonexist";
+ private static final String TOOLCHAIN_NO_SYSROOT = "Poky.Toolchain.No.Sysroot";
+ private static final String TOOLCHAIN_HOST_MISMATCH = "Poky.Toolchain.Host.Mismatch";
+ private static final String[] saInvalidVer = {"1.0", "0.9", "0.9+"};

- private static final String PREFERENCES_TOOLCHAIN_LOCATION_NONEXIST = "Preferences.Toolchain.Location.Nonexist";
- private static final String PREFERENCES_QEMU_KERNEL_EMPTY = "Preferences.Qemu.Kernel.Empty";
- private static final String PREFERENCES_SYSROOT_EMPTY = "Preferences.Sysroot.Empty";
- private static final String PREFERENCES_QEMU_KERNEL_NONEXIST = "Preferences.Qemu.Kernel.Nonexist";
- private static final String PREFERENCES_SYSROOT_NONEXIST = "Preferences.Sysroot.Nonexist";
-
- public static SDKCheckResults checkYoctoSDK(String sdkroot, String toolchain_location, String target, String target_qemu,
- String qemu_kernel, String sysroot, String ip_addr) {
-
- if (toolchain_location.isEmpty()) {
- return SDKCheckResults.TOOLCHAIN_LOCATION_EMPTY;
- } else {
- File toolchain = new File(toolchain_location);
- if (!toolchain.exists())
- return SDKCheckResults.TOOLCHAIN_LOCATION_NON_EXIST;
+ private static final String SYSROOTS_DIR = "sysroots";
+
+ public static SDKCheckResults checkYoctoSDK(YoctoUIElement elem) {
+ if (elem.getStrToolChainRoot().isEmpty())
+ return SDKCheckResults.TOOLCHAIN_LOCATION_EMPTY;
+ else {
+ File fToolChain = new File(elem.getStrToolChainRoot());
+ if (!fToolChain.exists())
+ return SDKCheckResults.TOOLCHAIN_LOCATION_NONEXIST;
}
-
- if (sysroot.isEmpty())
+
+ if (elem.getStrSysrootLoc().isEmpty()) {
return SDKCheckResults.SYSROOT_EMPTY;
- else {
- File sysroot_dir = new File(sysroot);
+ } else {
+ File fSysroot = new File(elem.getStrSysrootLoc());
+ if (!fSysroot.exists())
+ return SDKCheckResults.SYSROOT_NONEXIST;
+ }
+
+ if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
+ //Check for SDK compatible with the host arch
+ String platform = YoctoSDKUtils.getPlatformArch();
+ String sysroot_dir_str = elem.getStrToolChainRoot() + "/" + SYSROOTS_DIR;
+ File sysroot_dir = new File(sysroot_dir_str);
if (!sysroot_dir.exists())
- return SDKCheckResults.SYSROOT_NON_EXIST;
+ return SDKCheckResults.TOOLCHAIN_NO_SYSROOT;
+
+ String toolchain_host_arch = null;
+
+ try {
+ toolchain_host_arch = findHostArch(sysroot_dir);
+ } catch(NullPointerException e) {
+ return SDKCheckResults.TOOLCHAIN_NO_SYSROOT;
+ }
+
+ if (!toolchain_host_arch.equalsIgnoreCase(platform)) {
+ if (!platform.matches("i\\d86") || !toolchain_host_arch.matches("i\\d86"))
+ return SDKCheckResults.TOOLCHAIN_HOST_MISMATCH;
+ }
}
-
- if (target.isEmpty() || target==null) {
- return SDKCheckResults.TARGET_EMPTY;
+
+ if (elem.getIntTargetIndex() < 0 || elem.getStrTarget().isEmpty()) {
+ //if this is poky tree mode, prompt user whether bitbake meta-ide-support is executed?
+ if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_TREE_MODE)
+ return SDKCheckResults.ENV_SETUP_SCRIPT_NONEXIST;
+ else
+ return SDKCheckResults.SDK_TARGET_EMPTY;
+ } else {
+ String sFileName;
+
+ if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
+ sFileName = elem.getStrToolChainRoot()+"/" + YoctoSDKProjectNature.DEFAULT_ENV_FILE_PREFIX+elem.getStrTarget();
+ } else {
+ //POKY TREE Mode
+ sFileName = elem.getStrToolChainRoot() + YoctoSDKProjectNature.DEFAULT_TMP_PREFIX + YoctoSDKProjectNature.DEFAULT_ENV_FILE_PREFIX + elem.getStrTarget();
+ }
+
+ try {
+ File file = new File(sFileName);
+ boolean bVersion = false;
+
+ if (file.exists()) {
+ BufferedReader input = new BufferedReader(new FileReader(file));
+
+ try {
+ String line = null;
+
+ while ((line = input.readLine()) != null) {
+ if (line.startsWith("export "+ YoctoSDKProjectNature.SDK_VERSION)) {
+ int beginIndex = 2;
+ String sVersion = "";
+ for (;;) {
+ char cValue = line.charAt(line.indexOf('=') + beginIndex++);
+
+ if ((cValue != '.') && (!Character.isDigit(cValue)) && (cValue != '+'))
+ break;
+ else
+ sVersion += String.valueOf(cValue);
+ }
+
+ for (int i = 0; i < saInvalidVer.length; i++) {
+ if (!sVersion.equals(saInvalidVer[i])) {
+ bVersion = true;
+ break;
+ }
+ }
+
+ break;
+ }
+ }
+ } finally {
+ input.close();
+ }
+
+ if (!bVersion)
+ return SDKCheckResults.WRONG_ADT_VERSION;
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
-
- if (target_qemu.equals("true")) {
- if (qemu_kernel.isEmpty())
+
+ if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
+ if (elem.getStrQemuKernelLoc().isEmpty()) {
return SDKCheckResults.QEMU_KERNEL_EMPTY;
- else {
- File kernel_file = new File(qemu_kernel);
- if (!kernel_file.exists())
- return SDKCheckResults.QEMU_KERNEL_NON_EXIST;
+ } else {
+ File fQemuKernel = new File(elem.getStrQemuKernelLoc());
+ if (!fQemuKernel.exists())
+ return SDKCheckResults.QEMU_KERNEL_NONEXIST;
}
-
}
-
+
return SDKCheckResults.SDK_PASS;
}

- private static String getWizardErrorMessage(SDKCheckResults result) {
- switch (result) {
- case TOOLCHAIN_LOCATION_EMPTY:
- return YoctoSDKMessages.getString(WIZARD_SDK_LOCATION_EMPTY);
- case TOOLCHAIN_LOCATION_NON_EXIST:
- return YoctoSDKMessages.getString(WIZARD_TOOLCHAIN_LOCATION_NONEXIST);
- case TARGET_EMPTY:
- return YoctoSDKMessages.getString(WIZARD_SDK_TARGET_EMPTY);
- case QEMU_KERNEL_EMPTY:
- return YoctoSDKMessages.getString(WIZARD_QEMU_KERNEL_EMPTY);
- case SYSROOT_EMPTY:
- return YoctoSDKMessages.getString(WIZARD_SYSROOT_EMPTY);
- case QEMU_KERNEL_NON_EXIST:
- return YoctoSDKMessages.getString(WIZARD_QEMU_KERNEL_NONEXIST);
- case SYSROOT_NON_EXIST:
- return YoctoSDKMessages.getString(WIZARD_SYSROOT_NONEXIST);
- case SDK_BIN_NON_EXIST:
- return YoctoSDKMessages.getString(WIZARD_SDK_BIN_NONEXIST);
- case SDK_SYSROOT_NON_EXIST:
- return YoctoSDKMessages.getString(WIZARD_SDK_SYSROOT_NONEXIST);
- case SDK_PKGCONFIG_NON_EXIST:
- return YoctoSDKMessages.getString(WIZARD_SDK_PKGCONFIG_NONEXIST);
- default:
- return null;
- }
- }
+ public static String getErrorMessage(SDKCheckResults result, SDKCheckRequestFrom from) {
+ String strErrorMsg;

- private static String getMenuErrorMessage(SDKCheckResults result) {
- switch (result) {
- case TOOLCHAIN_LOCATION_EMPTY:
- return YoctoSDKMessages.getString(MENU_SDK_LOCATION_EMPTY);
- case TOOLCHAIN_LOCATION_NON_EXIST:
- return YoctoSDKMessages.getString(MENU_TOOLCHAIN_LOCATION_NONEXIST);
- case TARGET_EMPTY:
- return YoctoSDKMessages.getString(MENU_SDK_TARGET_EMPTY);
- case QEMU_KERNEL_EMPTY:
- return YoctoSDKMessages.getString(MENU_QEMU_KERNEL_EMPTY);
- //case QEMU_ROOTFS_EMPTY:
- // return YoctoSDKMessages.getString(MENU_QEMU_ROOTFS_EMPTY);
- case QEMU_KERNEL_NON_EXIST:
- return YoctoSDKMessages.getString(MENU_QEMU_KERNEL_NONEXIST);
- case SYSROOT_NON_EXIST:
- return YoctoSDKMessages.getString(MENU_SYSROOT_NONEXIST);
- case SYSROOT_EMPTY:
- return YoctoSDKMessages.getString(MENU_SYSROOT_EMPTY);
- case SDK_BIN_NON_EXIST:
- return YoctoSDKMessages.getString(MENU_SDK_BIN_NONEXIST);
- case SDK_SYSROOT_NON_EXIST:
- return YoctoSDKMessages.getString(MENU_SDK_SYSROOT_NONEXIST);
- case SDK_PKGCONFIG_NON_EXIST:
- return YoctoSDKMessages.getString(MENU_SDK_PKGCONFIG_NONEXIST);
+ switch (from) {
+ case Wizard:
+ strErrorMsg = "Yocto Wizard Configuration Error:";
+ break;
+ case Menu:
+ strErrorMsg = "Yocto Menu Configuration Error!";
+ break;
+ case Preferences:
+ strErrorMsg = "Yocto Preferences Configuration Error!";
+ break;
default:
- return null;
+ strErrorMsg = "Yocto Configuration Error!";
+ break;
}
- }

- private static String getPreferencesErrorMessage(SDKCheckResults result) {
switch (result) {
+ case POKY_DEVICE_EMPTY:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(POKY_DEVICE_EMPTY);
+ break;
case TOOLCHAIN_LOCATION_EMPTY:
- return YoctoSDKMessages.getString(MENU_SDK_LOCATION_EMPTY);
- case TOOLCHAIN_LOCATION_NON_EXIST:
- return YoctoSDKMessages.getString(PREFERENCES_TOOLCHAIN_LOCATION_NONEXIST);
- case TARGET_EMPTY:
- return YoctoSDKMessages.getString(MENU_SDK_TARGET_EMPTY);
- case SDK_BIN_NON_EXIST:
- return YoctoSDKMessages.getString(PREFERENCES_SDK_BIN_NONEXIST);
- case SDK_SYSROOT_NON_EXIST:
- return YoctoSDKMessages.getString(PREFERENCES_SDK_SYSROOT_NONEXIST);
- case SDK_PKGCONFIG_NON_EXIST:
- return YoctoSDKMessages.getString(PREFERENCES_SDK_PKGCONFIG_NONEXIST);
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_LOCATION_EMPTY);
+ break;
+ case SDK_TARGET_EMPTY:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SDK_TARGET_EMPTY);
+ break;
+ case TOOLCHAIN_LOCATION_NONEXIST:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_LOCATION_NONEXIST);
+ break;
case QEMU_KERNEL_EMPTY:
- return YoctoSDKMessages.getString(PREFERENCES_QEMU_KERNEL_EMPTY);
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(QEMU_KERNEL_EMPTY);
+ break;
case SYSROOT_EMPTY:
- return YoctoSDKMessages.getString(PREFERENCES_SYSROOT_EMPTY);
- case QEMU_KERNEL_NON_EXIST:
- return YoctoSDKMessages.getString(PREFERENCES_QEMU_KERNEL_NONEXIST);
- case SYSROOT_NON_EXIST:
- return YoctoSDKMessages.getString(PREFERENCES_SYSROOT_NONEXIST);
- case ENV_SETUP_SCRIPT_NON_EXIST:
- return YoctoSDKMessages.getString(ENV_SCRIPT_NONEXIST);
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SYSROOT_EMPTY);
+ break;
+ case QEMU_KERNEL_NONEXIST:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(QEMU_KERNEL_NONEXIST);
+ break;
+ case SYSROOT_NONEXIST:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SYSROOT_NONEXIST);
+ break;
+ case WRONG_ADT_VERSION:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(WRONG_ADT_VERSION);
+ break;
+ case ENV_SETUP_SCRIPT_NONEXIST:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(ENV_SETUP_SCRIPT_NONEXIST);
+ break;
+ case TOOLCHAIN_NO_SYSROOT:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_NO_SYSROOT);
+ break;
+ case TOOLCHAIN_HOST_MISMATCH:
+ strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_HOST_MISMATCH);
+ break;
default:
- return null;
+ break;
}
+
+ return strErrorMsg;
}

- public static String getErrorMessage(SDKCheckResults result, SDKCheckRequestFrom from) {
- switch (from) {
- case Wizard:
- return getWizardErrorMessage(result);
- case Menu:
- return getMenuErrorMessage(result);
- case Preferences:
- return getPreferencesErrorMessage(result);
- default:
- return null;
+ private static String findHostArch(File sysroot_dir) {
+ FilenameFilter nativeFilter = new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ if (name.endsWith("sdk-linux")) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ };
+
+ File[] files = sysroot_dir.listFiles(nativeFilter);
+ String arch = null;
+
+ for (File file : files) {
+ if (file.isDirectory()) {
+ String path = file.getName();
+ String[] subPath = path.split("-");
+ arch = subPath[0];
+ } else {
+ continue;
+ }
}
- }
+
+ return arch;
+ }
}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
index b0e7121..69b1e2a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKProjectNature.java
@@ -38,7 +38,8 @@ import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;


@SuppressWarnings("restriction")
@@ -157,9 +158,9 @@ public class YoctoSDKProjectNature implements IProjectNature {
YoctoSDKUtils.saveProfilesToProjectPreferences(profileElement, project);
IPreferenceStore selecteProfileStore = YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(selecteProfileStore);
- YoctoSDKUtils.SDKCheckResults result = YoctoSDKUtils.checkYoctoSDK(elem);
- if (result != YoctoSDKUtils.SDKCheckResults.SDK_PASS){
- String strErrorMsg = YoctoSDKUtils.getErrorMessage(result, SDKCheckRequestFrom.Wizard);
+ SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(elem);
+ if (result != SDKCheckResults.SDK_PASS){
+ String strErrorMsg = YoctoSDKChecker.getErrorMessage(result, SDKCheckRequestFrom.Wizard);
throw new YoctoGeneralException(strErrorMsg);
}
else
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
index 11d68e0..4a10d8d 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKUtils.java
@@ -14,7 +14,6 @@ package org.yocto.sdk.ide;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -43,240 +42,11 @@ import org.yocto.sdk.ide.preferences.PreferenceConstants;

public class YoctoSDKUtils {

- public static enum SDKCheckResults {
- SDK_PASS,
- POKY_DEVICE_EMPTY,
- TOOLCHAIN_LOCATION_EMPTY,
- TOOLCHAIN_LOCATION_NONEXIST,
- SDK_TARGET_EMPTY,
- QEMU_KERNEL_EMPTY,
- SYSROOT_EMPTY,
- QEMU_KERNEL_NONEXIST,
- SYSROOT_NONEXIST,
- WRONG_ADT_VERSION,
- ENV_SETUP_SCRIPT_NONEXIST,
- TOOLCHAIN_NO_SYSROOT,
- TOOLCHAIN_HOST_MISMATCH
- };
-
- public static enum SDKCheckRequestFrom {
- Wizard,
- Menu,
- Preferences,
- Other
- };
-
private static final String PROJECT_SCOPE = "org.yocto.sdk.ide";
- private static final String POKY_DEVICE_EMPTY = "Poky.SDK.Device.Empty";
- private static final String TOOLCHAIN_LOCATION_EMPTY = "Poky.SDK.Location.Empty";
- private static final String SDK_TARGET_EMPTY = "Poky.SDK.Target.Empty";
- private static final String TOOLCHAIN_LOCATION_NONEXIST = "Poky.SDK.Location.Nonexist";
- private static final String QEMU_KERNEL_EMPTY = "Poky.Qemu.Kernel.Empty";
- private static final String SYSROOT_EMPTY = "Poky.Sysroot.Empty";
- private static final String QEMU_KERNEL_NONEXIST = "Poky.Qemu.Kernel.Nonexist";
- private static final String SYSROOT_NONEXIST = "Poky.Sysroot.Nonexist";
- private static final String WRONG_ADT_VERSION = "Poky.ADT.Sysroot.Wrongversion";
- private static final String ENV_SETUP_SCRIPT_NONEXIST = "Poky.Env.Script.Nonexist";
- private static final String TOOLCHAIN_NO_SYSROOT = "Poky.Toolchain.No.Sysroot";
- private static final String TOOLCHAIN_HOST_MISMATCH = "Poky.Toolchain.Host.Mismatch";
- private static final String[] saInvalidVer = {"1.0", "0.9", "0.9+"};
private static final String DEFAULT_SYSROOT_PREFIX = "--sysroot=";
private static final String LIBTOOL_SYSROOT_PREFIX = "--with-libtool-sysroot=";
- private static final String SYSROOTS_DIR = "sysroots";
private static final String CONSOLE_MESSAGE = "Menu.SDK.Console.Configure.Message";

- public static SDKCheckResults checkYoctoSDK(YoctoUIElement elem) {
-
- if (elem.getStrToolChainRoot().isEmpty())
- return SDKCheckResults.TOOLCHAIN_LOCATION_EMPTY;
- else {
- File fToolChain = new File(elem.getStrToolChainRoot());
- if (!fToolChain.exists())
- return SDKCheckResults.TOOLCHAIN_LOCATION_NONEXIST;
- }
-
- if (elem.getStrSysrootLoc().isEmpty())
- return SDKCheckResults.SYSROOT_EMPTY;
- else {
- File fSysroot = new File(elem.getStrSysrootLoc());
- if (!fSysroot.exists())
- return SDKCheckResults.SYSROOT_NONEXIST;
- }
- if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
- //Check for SDK compatible with the host arch
- String platform = getPlatformArch();
- String sysroot_dir_str = elem.getStrToolChainRoot() + "/" + SYSROOTS_DIR;
- File sysroot_dir = new File(sysroot_dir_str);
- if (!sysroot_dir.exists())
- return SDKCheckResults.TOOLCHAIN_NO_SYSROOT;
-
- String toolchain_host_arch = null;
-
- try
- {
- toolchain_host_arch = findHostArch(sysroot_dir);
- }
- catch(NullPointerException e)
- {
- return SDKCheckResults.TOOLCHAIN_NO_SYSROOT;
- }
-
- if (!toolchain_host_arch.equalsIgnoreCase(platform)) {
- if (!platform.matches("i\\d86") || !toolchain_host_arch.matches("i\\d86"))
- return SDKCheckResults.TOOLCHAIN_HOST_MISMATCH;
- }
- }
- if (elem.getIntTargetIndex() < 0 || elem.getStrTarget().isEmpty())
- {
- //if this is poky tree mode, prompt user whether bitbake meta-ide-support is executed?
- if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_TREE_MODE)
- return SDKCheckResults.ENV_SETUP_SCRIPT_NONEXIST;
- else
- return SDKCheckResults.SDK_TARGET_EMPTY;
- }
- else
- {
- String sFileName;
- if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
- sFileName = elem.getStrToolChainRoot()+"/" + YoctoSDKProjectNature.DEFAULT_ENV_FILE_PREFIX+elem.getStrTarget();
- }
- else {
- //POKY TREE Mode
- sFileName = elem.getStrToolChainRoot() + YoctoSDKProjectNature.DEFAULT_TMP_PREFIX + YoctoSDKProjectNature.DEFAULT_ENV_FILE_PREFIX + elem.getStrTarget();
- }
- try
- {
-
- File file = new File(sFileName);
- boolean bVersion = false;
-
- if (file.exists()) {
- BufferedReader input = new BufferedReader(new FileReader(file));
-
- try
- {
- String line = null;
-
- while ((line = input.readLine()) != null)
- {
- if (line.startsWith("export "+ YoctoSDKProjectNature.SDK_VERSION))
- {
- int beginIndex = 2;
- String sVersion = "";
- for (;;)
- {
- char cValue = line.charAt(line.indexOf('=') + beginIndex++);
- if ((cValue != '.') && (!Character.isDigit(cValue)) && (cValue != '+'))
- break;
- else
- sVersion += String.valueOf(cValue);
- }
- for (int i = 0; i < saInvalidVer.length; i++)
- {
- if (!sVersion.equals(saInvalidVer[i]))
- {
- bVersion = true;
- break;
- }
-
- }
- break;
- }
- }
-
- }
- finally {
- input.close();
- }
- if (!bVersion)
- return SDKCheckResults.WRONG_ADT_VERSION;
-
- }
- }
- catch (IOException e)
- {
- e.printStackTrace();
-
- }
- }
-
- if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE)
- {
- if (elem.getStrQemuKernelLoc().isEmpty())
- return SDKCheckResults.QEMU_KERNEL_EMPTY;
- else {
- File fQemuKernel = new File(elem.getStrQemuKernelLoc());
- if (!fQemuKernel.exists())
- return SDKCheckResults.QEMU_KERNEL_NONEXIST;
- }
- }
-
- return SDKCheckResults.SDK_PASS;
- }
-
-
-
- public static String getErrorMessage(SDKCheckResults result, SDKCheckRequestFrom from) {
- String strErrorMsg;
- switch (from) {
- case Wizard:
- strErrorMsg = "Yocto Wizard Configuration Error:";
- break;
- case Menu:
- strErrorMsg = "Yocto Menu Configuration Error!";
- break;
- case Preferences:
- strErrorMsg = "Yocto Preferences Configuration Error!";
- break;
- default:
- strErrorMsg = "Yocto Configuration Error!";
- break;
- }
-
- switch (result) {
- case POKY_DEVICE_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(POKY_DEVICE_EMPTY);
- break;
- case TOOLCHAIN_LOCATION_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_LOCATION_EMPTY);
- break;
- case SDK_TARGET_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SDK_TARGET_EMPTY);
- break;
- case TOOLCHAIN_LOCATION_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_LOCATION_NONEXIST);
- break;
- case QEMU_KERNEL_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(QEMU_KERNEL_EMPTY);
- break;
- case SYSROOT_EMPTY:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SYSROOT_EMPTY);
- break;
- case QEMU_KERNEL_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(QEMU_KERNEL_NONEXIST);
- break;
- case SYSROOT_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(SYSROOT_NONEXIST);
- break;
- case WRONG_ADT_VERSION:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(WRONG_ADT_VERSION);
- break;
- case ENV_SETUP_SCRIPT_NONEXIST:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(ENV_SETUP_SCRIPT_NONEXIST);
- break;
- case TOOLCHAIN_NO_SYSROOT:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_NO_SYSROOT);
- break;
- case TOOLCHAIN_HOST_MISMATCH:
- strErrorMsg = strErrorMsg + "\n" + YoctoSDKMessages.getString(TOOLCHAIN_HOST_MISMATCH);
- break;
- default:
- break;
- }
- return strErrorMsg;
- }
-
-
public static String getEnvValue(IProject project, String strKey)
{
ICProjectDescription cpdesc = CoreModel.getDefault().getProjectDescription(project, true);
@@ -731,31 +501,6 @@ public class YoctoSDKUtils {
}
return value;
}
-
- static private String findHostArch(File sysroot_dir) {
- FilenameFilter nativeFilter = new FilenameFilter() {
- public boolean accept(File dir, String name) {
- if (name.endsWith("sdk-linux")) {
- return true;
- } else {
- return false;
- }
- }
- };
-
- File copyFile = null;
- File[] files = sysroot_dir.listFiles(nativeFilter);
- String arch = null;
- for (File file : files) {
- if (file.isDirectory()) {
- String path = file.getName();
- String[] subPath = path.split("-");
- arch = subPath[0];
- } else
- continue;
- }
- return arch;
- }

/* Save profiles and selected profile to the default preference store */
public static void saveProfilesToDefaultStore(YoctoProfileElement profileElement) {
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index f7e7a3a..74cfd69 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -36,8 +36,8 @@ import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Widget;
-import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
-import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckResults;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
import org.yocto.sdk.ide.preferences.PreferenceConstants;

public class YoctoUISetting {
@@ -349,11 +349,11 @@ public class YoctoUISetting {
boolean pass = true;
String strErrorMessage;

- SDKCheckResults result = YoctoSDKUtils.checkYoctoSDK(elem);
+ SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(elem);

//Show Error Message on the Label to help users.
if (result != SDKCheckResults.SDK_PASS) {
- strErrorMessage = YoctoSDKUtils.getErrorMessage(result, from);
+ strErrorMessage = YoctoSDKChecker.getErrorMessage(result, from);
pass = false;
if (bPrompt)
{
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 3e0fa54..ef681a4 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -33,7 +33,7 @@ import org.yocto.sdk.ide.YoctoSDKMessages;
import org.yocto.sdk.ide.YoctoSDKPlugin;
import org.yocto.sdk.ide.YoctoSDKProjectNature;
import org.yocto.sdk.ide.YoctoSDKUtils;
-import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
import org.yocto.sdk.ide.YoctoUIElement;
import org.yocto.sdk.ide.YoctoUISetting;

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index 7f0d25e..551d3bd 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -24,9 +24,9 @@ import org.yocto.sdk.ide.YoctoGeneralException;
import org.yocto.sdk.ide.YoctoProfileElement;
import org.yocto.sdk.ide.YoctoProfileSetting;
import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
import org.yocto.sdk.ide.YoctoSDKPlugin;
import org.yocto.sdk.ide.YoctoSDKUtils;
-import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;
import org.yocto.sdk.ide.YoctoUIElement;
import org.yocto.sdk.ide.YoctoUISetting;

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoCProjectTemplate.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoCProjectTemplate.java
index 7c02f87..f332a9a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoCProjectTemplate.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoCProjectTemplate.java
@@ -10,15 +10,17 @@
*******************************************************************************/
package org.yocto.sdk.ide.wizard;

-import java.util.List;
import java.util.LinkedHashMap;
+import java.util.List;

+import org.eclipse.cdt.autotools.core.AutotoolsNewProjectNature;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
import org.eclipse.cdt.core.templateengine.process.processes.Messages;
+import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
@@ -36,19 +38,19 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.cdt.autotools.core.AutotoolsNewProjectNature;
-import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.preference.IPreferenceStore;
import org.yocto.sdk.ide.YoctoGeneralException;
import org.yocto.sdk.ide.YoctoProfileElement;
+import org.yocto.sdk.ide.YoctoSDKChecker;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
+import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
import org.yocto.sdk.ide.YoctoSDKEmptyProjectNature;
import org.yocto.sdk.ide.YoctoSDKPlugin;
import org.yocto.sdk.ide.YoctoSDKProjectNature;
import org.yocto.sdk.ide.YoctoSDKUtils;
import org.yocto.sdk.ide.YoctoUIElement;
-import org.yocto.sdk.ide.YoctoSDKUtils.SDKCheckRequestFrom;


@SuppressWarnings("restriction")
@@ -120,9 +122,9 @@ public class NewYoctoCProjectTemplate extends ProcessRunner {
YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
IPreferenceStore selecteProfileStore = YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(selecteProfileStore);
- YoctoSDKUtils.SDKCheckResults result = YoctoSDKUtils.checkYoctoSDK(elem);
- if (result != YoctoSDKUtils.SDKCheckResults.SDK_PASS){
- String strErrorMsg = YoctoSDKUtils.getErrorMessage(result, SDKCheckRequestFrom.Wizard);
+ SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(elem);
+ if (result != SDKCheckResults.SDK_PASS){
+ String strErrorMsg = YoctoSDKChecker.getErrorMessage(result, SDKCheckRequestFrom.Wizard);
throw new YoctoGeneralException(strErrorMsg);
}
AutotoolsNewProjectNature.addAutotoolsNature(project, monitor);
--
1.7.11.7


[PATCH 0/5][eclipse-poky] Refactor handling of SDK check errors

Timo Mueller <mail@...>
 

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

Hi,

I tried to display the messages resulting from validating the
YoctoUISettings in the message area of the properties/preference pages
instead of showing a dialog. This led to some refactoring of the
validation functionality and also the messages.

If for example the user entered a SDK toolchain directory that doesn't
exist in the global preferences a dialog will show up showing the
error and telling him how he can do "IDE-wide settings". As he is
currently trying to do "IDE-wide settings" this advice is not really
necessary and the dialog can be really annoying.

I split up the messages into a one line error message and an
advice. This message can be shown in the page's message area instead
of opening a dialog with every configuration error. The advice can
still be used when we want to show a dialog to help the user,
e.g. when creating a new project.

On a side note I reactivated the YoctoSDKChecker class and moved all
the validation code from the utils, getting rid of some duplicated and
inconsistent code.

Best regards,
Timo

PS: This patch set is based on "plugins/sdk.ide: Remove profile edit
buttons from property page"

Timo Mueller (5):
plugins/sdk.ide: Move SDK check functionality to separate class
plugins/sdk.ide: Refactored the construction of mesages with
SDKCheckResults
plugins/sdk.ide: Show SDK check errors in message area
plugins/sdk.ide: Removed validation from setCurrentInput
plugins/sdk.ide: Use standard error dialog to show SDK check errors

.../src/org/yocto/sdk/ide/YoctoSDKChecker.java | 372 +++++++++++----------
.../org/yocto/sdk/ide/YoctoSDKMessages.properties | 42 ++-
.../org/yocto/sdk/ide/YoctoSDKProjectNature.java | 9 +-
.../src/org/yocto/sdk/ide/YoctoSDKUtils.java | 255 --------------
.../src/org/yocto/sdk/ide/YoctoUISetting.java | 47 +--
.../ide/preferences/YoctoSDKPreferencePage.java | 84 +++--
.../preferences/YoctoSDKProjectPropertyPage.java | 87 +++--
.../sdk/ide/wizard/NewYoctoCProjectTemplate.java | 18 +-
8 files changed, 344 insertions(+), 570 deletions(-)

--
1.7.11.7


[PATCH] plugins/sdk.ide: Remove profile edit buttons from property page

Timo Mueller <mail@...>
 

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

The project property page for yocto project settings contains the same
edit buttons as the preference page. As editing profiles is not
allowed in the property page these buttons have been permanently
disabled.

This removes them completely from the property page. The remaining
profile drop-down box allows the user to select a cross development
profile for the project.

Signed-off-by: Timo Mueller <timo.mueller@...>
---
.../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 30 ++++++++++++++++------
.../ide/preferences/YoctoSDKPreferencePage.java | 2 +-
.../preferences/YoctoSDKProjectPropertyPage.java | 3 +--
3 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
index cc3e167..0f36e99 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -49,10 +49,12 @@ public class YoctoProfileSetting {

private YoctoProfileElement profileElement;
private PreferencePage preferencePage;
+ private final boolean editable;

- public YoctoProfileSetting(YoctoProfileElement profileElement, PreferencePage preferencePage) {
+ public YoctoProfileSetting(YoctoProfileElement profileElement, PreferencePage preferencePage, final boolean editable) {
this.profileElement = profileElement;
this.preferencePage = preferencePage;
+ this.editable = editable;
}

public void createComposite(Composite composite) {
@@ -61,7 +63,11 @@ public class YoctoProfileSetting {
composite.setLayout(layout);

Group storeYoctoConfigurationsGroup = new Group (composite, SWT.NONE);
- layout = new GridLayout(3, false);
+ layout = new GridLayout(1, false);
+ if (isEditable()) {
+ layout.numColumns = 3;
+ }
+
storeYoctoConfigurationsGroup.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
gd.horizontalSpan = 2;
@@ -101,9 +107,11 @@ public class YoctoProfileSetting {
sdkConfigsCombo.addListener(SWT.Selection, selectionListener);
sdkConfigsCombo.addListener(SWT.Modify, selectionListener);

- createSaveAsProfileButton(storeYoctoConfigurationsGroup);
- createRenameButton(storeYoctoConfigurationsGroup);
- createRemoveButton(storeYoctoConfigurationsGroup);
+ if (isEditable()) {
+ createSaveAsProfileButton(storeYoctoConfigurationsGroup);
+ createRenameButton(storeYoctoConfigurationsGroup);
+ createRemoveButton(storeYoctoConfigurationsGroup);
+ }
}

private void createSaveAsProfileButton(Group storeYoctoConfigurationsGroup) {
@@ -225,8 +233,14 @@ public class YoctoProfileSetting {
}

public void setButtonsEnabledState(boolean isEnabled) {
- btnConfigRename.setEnabled(isEnabled);
- btnConfigRemove.setEnabled(isEnabled);
- btnConfigSaveAs.setEnabled(isEnabled);
+ if (isEditable()) {
+ btnConfigRename.setEnabled(isEnabled);
+ btnConfigRemove.setEnabled(isEnabled);
+ btnConfigSaveAs.setEnabled(isEnabled);
+ }
+ }
+
+ private boolean isEditable() {
+ return editable;
}
}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index 4d57b45..3e0fa54 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -64,7 +64,7 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
this.yoctoUISetting = new YoctoUISetting(elem);

YoctoProfileElement profileElement = new YoctoProfileElement(profiles, selectedProfile);
- this.yoctoProfileSetting = new YoctoProfileSetting(profileElement, this);
+ this.yoctoProfileSetting = new YoctoProfileSetting(profileElement, this, true);
}

/*
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
index eef56c1..7f0d25e 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -51,7 +51,7 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
}

yoctoProfileSetting = new YoctoProfileSetting(
- new YoctoProfileElement(globalProfileElement.getProfilesAsString(), selectedProfile), this);
+ new YoctoProfileElement(globalProfileElement.getProfilesAsString(), selectedProfile), this, false);
boolean useProjectSpecificSetting = YoctoSDKUtils.getUseProjectSpecificOptionFromProjectPreferences(project);

if (useProjectSpecificSetting) {
@@ -78,7 +78,6 @@ public class YoctoSDKProjectPropertyPage extends PropertyPage implements
yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
} else {
yoctoProfileSetting.setUIFormEnabledState(true);
- yoctoProfileSetting.setButtonsEnabledState(false);
yoctoProjectSpecificSetting.setUseProjectSpecificSettings(false);
yoctoUISetting.setUIFormEnabledState(false);
}
--
1.7.11.7


Re: [meta-ti] Wifi Module + udev configs

Raul Mu?oz
 

Denys, Thanks for all Reply,

I understand that if I use udev at version 178 or more, I probable will get a udev with solved firmware problems, however if I use this udev version I will need to use a systemd packages.

Is possible you give some intructions how to put systemd and udev 178+ at my build system?

There are another brach that this configuration work?

Thanks For all Help.



2013/2/25 Denys Dmytriyenko <denis@...>

On Mon, Feb 18, 2013 at 08:56:06AM -0300, Raul Rosetto Munoz wrote:
> Any suggestions?
>
> I really do not know what to do, the file "/lib/udev/firmware" never appear.

FYI, starting with 176, udev handles loading firmware images internally, hence
dropping the /lib/udev/firmware binary. But there were some bugs related to
that functionality, which got fixed in version 178...

http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=ChangeLog;hb=HEAD
http://upstream-tracker.org/changelogs/libudev/181/changelog.html

As I said before, if you are using Danny branch, then you should stick to the
proven udev-164 that is in oe-core, unless you really want to have systemd, in
which case you look into meta-openembedded...

--
Denys


> 2013/2/14 Raul Rosetto Munoz <munoz0raul@...>
>
> > Now Im with 173 from meta-fsl bbapend, but I tryed with many others from
> > meta-oe and poky.
> >
> >
> >
> >
> >
> >
> > 2013/2/14 Denys Dmytriyenko <denys@...>
> >
> >> On Thu, Feb 14, 2013 at 02:23:14PM -0200, Raul Rosetto Munoz wrote:
> >> > Denys,
> >> > There are something strange,
> >> >
> >> > First there are no  linux-firmware-{rtl8192cu,rtl8192ce,rtl8192su}
> >> > installed at rfs.
> >>
> >> I was talking about packages, looks like you have them already installed.
> >>
> >>
> >> > raul@phi04:.../tmp/deploy/images$ find
> >> > /media/ed86e6a2-20c2-464e-a2f3-f28ff48983ef/lib/firmware/ -name "*8192*"
> >> > /media/ed86e6a2-20c2-464e-a2f3-f28ff48983ef/lib/firmware/RTL8192E
> >> >
> >> /media/ed86e6a2-20c2-464e-a2f3-f28ff48983ef/lib/firmware/rtlwifi/rtl8192sefw.bin
> >> >
> >> /media/ed86e6a2-20c2-464e-a2f3-f28ff48983ef/lib/firmware/rtlwifi/rtl8192defw.bin
> >> >
> >> > Another problem is that "/lib/udev/firmware" are not installed to.
> >> >
> >> > raul@phi04:.../tmp/deploy/images$ find
> >> > /media/ed86e6a2-20c2-464e-a2f3-f28ff48983ef/lib/udev/ -name "*firmware*"
> >> > raul@phi04:.../tmp/deploy/images$
> >>
> >> What is your udev version?
> >>
> >>
> >> > But I can see theses files at my "tmp/sysroots/beaglebone"
> >> >
> >> > raul@phi04:.../tmp/sysroots/beaglebone$ find lib/firmware/ -name
> >> "*8192*"
> >> > lib/firmware/RTL8192E
> >> > lib/firmware/rtlwifi/rtl8192sefw.bin
> >> > lib/firmware/rtlwifi/rtl8192defw.bin
> >> > lib/firmware/rtlwifi/rtl8192cfw.bin
> >> > lib/firmware/rtlwifi/rtl8192cufw.bin
> >> >
> >> > raul@phi04:.../tmp/sysroots/beaglebone$ find lib/udev/ -name
> >> "*firmware*"
> >> > lib/udev/firmware
> >> > lib/udev/rules.d/50-firmware.rules
> >> >
> >> > I tryed copy this files for the sdcard but doesnt work.
> >> >
> >> > Do you have any suggest?
> >> >
> >> > Thanks for all help.
> >>
> >
> >
> >
> > --
> > *Raul Rosetto Muñoz*
> >
>
>
>
> --
> *Raul Rosetto Muñoz*

> _______________________________________________
> meta-ti mailing list
> meta-ti@...
> https://lists.yoctoproject.org/listinfo/meta-ti




--
Raul Rosetto Muñoz


Re: Updating uboot to v2013.01

Satya Swaroop Damarla <swaroop.damarla@...>
 

Hey Rudy,

I think, it doesnot automatically take a kernel but we have to choose the kernel and I chose it v3.2 but seems it doesnot support my board and so I should take a kernel from the original and configure it to my need.... Here is the only error message I see about linux kernel

WARNING: linux-dummy: No generic license file exists for: GPL in any provider

my board is Avionic Tamonten Carrier, based on NVIDIA harmony board. Suggestions are very much appreciated but I am also currently trying to solve it.. I just downloaded a git kernel from the avionic site and can you please tell me how to configure it to so that the build system takes this as kernel and build it

Greets,
Satya


On Tue, Feb 26, 2013 at 6:21 PM, Rudolf Streif <rstreif@...> wrote:
Satya,

So what exactly do you get when building the kernel? No image at all in tmp/deploy/images? What do the logs for the kernel recipes say?

Rudi


On Mon, Feb 25, 2013 at 11:36 PM, Satya Swaroop Damarla <swaroop.damarla@...> wrote:
hey hans,

I think you are right about the kernel device tree.. I think it should come with the kernel but I have no idea why it works.. Only an expert should say why it works.. I think my work is not complete. I can generate the rootfs and the uboot.bin file but not the uImage... I have no idea... Diid you complete generating the image for the board?

Greets,
Satya


On Mon, Feb 25, 2013 at 5:05 PM, Hans Beckérus <hans.beckerus@...> wrote:


25 feb 2013 kl. 15:58 skrev Satya Swaroop DAMARLA <swaroop@...>:

Guys. I found the solution to this problem....

I think if you already install uboot-tools or uboot-mkimage packes from Ubuntu repository then it is used instead of the one that is downloaded and we should uninstall the packages and then rerun the build,,... Then IT WORKS... So, thank you for the time and enegry... I assume this thread is closed and this is the solution and if this doesnot work for some then please post it and we may discuss the situation depending on the problem,

Greetings & Regards,
Satya

Same comment here as for the device tree compiler. You should use the uboot tools/version as they come with the package. Not the one used by the host distro. To me this is not a proper solution.



On Thu, Feb 21, 2013 at 5:28 PM, Rudolf Streif <rstreif@...> wrote:
Satya,

I will look into it later today. I am currently at the Linux Foundation's Embedded Linux Conference.

Rudi


On Thu, Feb 21, 2013 at 2:10 AM, Satya Swaroop DAMARLA <swaroop@...> wrote:
Hello Guys,

I have not received any reply from you. If you can help me to figure out what the errors mean when adding a new .bb or recipe file then I can learn the mistake and take care in the new recipes.... I request your time 


On Wed, Feb 20, 2013 at 7:19 PM, Satya Swaroop Damarla <swaroop.damarla@...> wrote:
hey Guys... I get the following error... which I attached.. Its completely greek and latin to me.. Can you please help me..


On Wed, Feb 20, 2013 at 7:19 PM, Satya Swaroop DAMARLA <swaroop@...> wrote:
hey Guys... I get the following error... which I attached.. Its completely greek and latin to me.. Can you please help me..


On Wed, Feb 20, 2013 at 6:46 PM, Hans Beckérus <hans.beckerus@...> wrote:
On Wed, Feb 20, 2013 at 6:12 PM, Satya Swaroop Damarla
<swaroop.damarla@...> wrote:
> Hey hans, this is what he meant,
>
> In the machine config file add the following
>
> PREFERRED_VERSION_u-boot ?= "v2013.01%"  or PREFERRED_VERSION_u-boot ?=
> "v2013.01.01%"
>
> By the way did you already complete the first part... There is also other
> file called "u-boot-fw-utils_2012.04.01.bb" ... I think we should do the
> same...
>
> Hans bytheway,  are you also working on the same board or diffferent board
> with same problem?
>

Different board, same core, similar problem ;)
Now I get it. Thanks. But still question remains how in earth I
managed to build the kernel if not also having copied/renamed the
mkimage .bb?
Is the PREFERRED_VERSION_u-boot used to determine what mkimage and fw
utils it picks up?
Then it might be that since I/we build u-boot as a separate package,
but kernel lifts in the mkimage stuff, it works but the wrong package
was used.
In my case obviously compatible, but not recommended I guess. Also, I
agree that the fw utils should probably be in sync similar to mkimage.

Hans

>
>
>
>
>
> On Wed, Feb 20, 2013 at 6:01 PM, Hans Beckérus <hans.beckerus@...>
> wrote:
>>
>> On Wed, Feb 20, 2013 at 5:16 PM, Rudolf Streif
>> <rstreif@...> wrote:
>> > Satya,
>> >
>> > Simply look at the u-boot recipes in meta/recipes-bsp/u-boot such as
>> > u-boot_2012.04.01.bb. You can simply copy it and name it
>> > u-boot_2013.01.bb
>> > and then modify SRCREV to the revision that corresponds to the tag
>> > 2013.01
>> > or 2013.01.01 in git.denx.de:
>> >
>> > for 2013.01: 3a9d879f6f64585b819af728b53be0a05037fe0d
>> > for 2013.01.01: e8ae0fa5edd152b2b29c470b88429be4cdcd2c46
>> >
>> > Do the same for u-boot-mkimage and include the u-boot version with your
>> > bsp.
>> >
>> > Rudi
>> >
>> >
>> Hi Rudi, sorry to chime in , but I have a similar problem but do not
>> really get the last thing you said.
>> What do you mean by including the u-boot version in the bsp? Also is
>> it a must to also copy the mkimage .bb or will the system find a
>> suitable one automatically?
>> The thing is that I only copied/edited the u-boot .bb but never the
>> mkimage. Still my kernel successfully builds the kernel uImage!?
>> Some magic that I have missed :)
>>
>> Hans
>>
>>
>> > On Wed, Feb 20, 2013 at 5:17 AM, Satya Swaroop Damarla
>> > <swaroop.damarla@...> wrote:
>> >>
>> >> Hi Guys,
>> >>
>> >> I need support for uboot on Tamonten board but the version on it is
>> >> v2012.04 but I came to know that v2012.10 or v2013.01 supports the
>> >> Tamontenboard through some guys here..
>> >>
>> >> It would be great if you can tell me how can I accomplish v2013.01 or
>> >> v2012.10 into the build system and make it available so that I can
>> >> compile
>> >> the and get uImage
>> >>
>> >> (Tamonten board is a derivative of harmony board with some changes and
>> >> has
>> >> arm cortexa9 processor without neon extentions )
>> >>
>> >> I am kind of new to add new .bb files and help is really appreciated as
>> >> I
>> >> am not able to figure out how to add
>> >>
>> >> Greetings & Regards,
>> >> Swaroop
>> >>
>> >> _______________________________________________
>> >> yocto mailing list
>> >> yocto@...
>> >> https://lists.yoctoproject.org/listinfo/yocto
>> >>
>> >
>> >
>> >
>> > --
>> > --
>> > Rudolf J. Streif
>> > Director of Embedded Solutions
>> > The Linux Foundation
>> >
>> > rudolf.streif@...
>> > Phone: +1.619.631.5383
>> > Skype: rudolfstreif
>> > PGP: RSA 2048/2048 D6E7D28B
>> >
>> > Linux Foundation Events Schedule:  events.linuxfoundation.org
>> > Linux Foundation Training Schedule: training.linuxfoundation.org
>> >
>> >
>> > _______________________________________________
>> > yocto mailing list
>> > yocto@...
>> > https://lists.yoctoproject.org/listinfo/yocto
>> >
>
>






--
-- 
Rudolf J. Streif
Director of Embedded Solutions
The Linux Foundation

Skype: rudolfstreif
PGP: RSA 2048/2048 D6E7D28B

Linux Foundation Events Schedule:  events.linuxfoundation.org
Linux Foundation Training Schedule: training.linuxfoundation.org



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


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

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



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




--
-- 
Rudolf J. Streif
Director of Embedded Solutions
The Linux Foundation

Skype: rudolfstreif
PGP: RSA 2048/2048 D6E7D28B

Linux Foundation Events Schedule:  events.linuxfoundation.org
Linux Foundation Training Schedule: training.linuxfoundation.org




1.3.1 rc1 available for testing

Flanagan, Elizabeth <elizabeth.flanagan@...>
 

A release candidate for 1.3.1 is available for testing at:

http://autobuilder.yoctoproject.org/pub/nightly/20130226-2

branch: danny

poky: 98292d1ef1cb44cf96f0a28fbca6439eda55ce1b
meta-qt3: c86fb1727ae09526c442ec29fffde3f010aa70eb
eclipse-plugin: cb8a0eff776d2cbd1b5f596a94dce825860574ab
meta-intel: d38b102cb9f3c269391d026d2022f10a6e1b1f11


Known Issues:
--------------------
- meta-fsl-arm targets initially failed due to a missing BBMASK. These
are currently regenerating. Once regeneration is complete we will
deploy as well as regenerate the adt pkg index.


--
Elizabeth Flanagan
Yocto Project
Build and Release


Re: [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes

Zhang, Jessica
 

Merged to eclipse-poky master.

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@... [mailto:yocto-bounces@...] On Behalf Of Timo Mueller
Sent: Tuesday, February 26, 2013 5:49 AM
To: yocto@...
Cc: Timo Mueller
Subject: [yocto] [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes

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

Hi,

this implements two of Jessica's comments regarding the target profiles that have been introduced recently.

01..02: Small cleanup work
03: Changes the name of target profiles to cross development
profiles
04..05: If a global profile is updated this will also update affected
projects. Also a warning is shown to the user.

Best regards,
Timo

Timo Mueller (5):
Added eclipse bin folders to gitignore
plugins/sdk.ide: Remove exception that is never thrown
plugin/sdk.ide: Change name of target profiles to cross development
profiles
plugin/sdk.ide: Added methods for comparing UIElements
plugin/sdk.ide: Update projects on profile update

.gitignore | 1 +
.../org/yocto/sdk/ide/YoctoSDKMessages.properties | 16 +++---
.../src/org/yocto/sdk/ide/YoctoUIElement.java | 58 ++++++++++++++++++++++
.../src/org/yocto/sdk/ide/YoctoUISetting.java | 4 +-
.../ide/preferences/YoctoSDKPreferencePage.java | 32 +++++++++---
5 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 .gitignore

--
1.7.11.7

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


Re: X video extensions

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

On 26 February 2013 20:31, Gary Thomas <gary@...> wrote:
xf86-video-omap on OMAP4430
Honestly, no idea. If no-one else knows, speak to TI to see if you
need specific runtime options/hardware support/something else.

Ross


Re: X video extensions

Gary Thomas
 

On 2013-02-26 11:30, Burton, Ross wrote:
On 26 February 2013 18:07, Gary Thomas <gary@...> wrote:
Here's what I get from xvinfo:
X-Video Extension version 2.2
screen #0
no adaptors present

So I guess the extension is there but my display doesn't support it?
How would I go about making that work?
XVideo has to be implemented by the drivers, what X video driver are you using?
xf86-video-omap on OMAP4430

--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------


Re: [meta-baryon][PATCH 0/4] Webmin updates/fixes

kevin.strasser@...
 

The following changes since commit
6c7948d9ca339caa6647b7e3f20ab82508f0793a:

schroedinger: specify the version of MPL in use (2013-01-03 13:46:02
-0800)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib paule/webmin-update
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/webmin-update

Kevin Strasser (1):
webmin: correct net-lib.pl patch

Paul Eggleton (3):
webmin: update to 1.620
webmin: tidy up recipe
webmin: fix for changes in OE-Core master

.../webmin/files/disable-version-check.patch | 25 +++++---
recipes-extended/webmin/files/net-lib.pl.patch | 2 +-
.../webmin/{webmin_1.590.bb => webmin_1.620.bb} | 63
+++++++++-----------
3 files changed, 45 insertions(+), 45 deletions(-)
rename recipes-extended/webmin/{webmin_1.590.bb => webmin_1.620.bb} (81%)
Hi Paul,

This looks great, but I noticed that the nfs-utils recipe in oe-core has
been updated and is causing our bbappend to break. I went ahead and made
the update and applied a commit on top of these changes. That addition is
available in a branch at:

git://git.yoctoproject.org/poky-contrib
strassek/webmin-update_and_nfs-utils
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=strassek/webmin-update_and_nfs-utils

-Kevin


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

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

Attendees:
Saul, MichaelH, Corneliu, Nitin, BrianL, Darren, Paul, Belen, Tom, Mark, LaurentiuP, ScottR, JeffP, Beth, JessicaZ, CristianI, BruceA, SeanH, DaveST, Song
 
Notes:
 
* Opens collection - 5 min (Song)
* Yocto Project 1.3.1 status - 10 min (Ross)
- Saul: will run a build 1.3.1 again today, make sure we have all the bit.
* Yocto 1.4 status - 10 min (Song/team)
https://wiki.yoctoproject.org/wiki/Yocto_Project_v1.4_Status
- lots of M4 features merged. Targeting tomorrow morning (US time) for QA full pass result.
- 3 medium+ features left for M4: read-only rootfs support (Saul: there are patches pending for a while, has been through a few rounds, probably at version 10 now. if people can review it, it would be really helpful) , smart error reporting improvement, x86 generic BSP to support as many hardware. Any concerns, comments?
- M5 work has been started, some M5 features are already merged. M5 dates: Release feature complete: 3/17. This milestone is our last chance to get features in. Even though we don't have any high features, but if you think we really need to get some feature in and that feature is at risk, please do let me know. We will see what we can do.
- Bugs are down over the last 2 weeks. WDD/WDD+ chart is up this week, possibly due to that we have few more critical/major bugs.
- Bruce: 3.8 kernel update is queued up. There are some problem on some qemu/arm platforms, should be fixed today. Hopefully to get it pushed today.

* SWAT team rotation: Paul Eggleton->Jessica Zhang
 
* Opens - 10 min
- Corneliu: QA, we can use the real time wiki page for QA update: https://wiki.yoctoproject.org/wiki/1.4_QA_Status
- Sean: Yocto BoF notes collection? Seems no one collected notes...
 
* Team Sharing - 20 min
- Darren: Minnow update. We are on x2 board, demoed at ELC. Got all functionalities. Making some minor revisions, layout, size, lures (daughter board), moving gpio a little bit. Regarding software, Scott, Koen and I are working on all aspects. Booted on 3.8 with a few patches. A couple interface issues between os and firmware. 32-bit efi work, etc.
- MichaelH: moving backup infrastructure to a different rack at the same location. Looking a lot at the autobuilder. Lots of warnnings, timeouts, no negative consequence so far, but watching it. Running 2 masters (?) on the machine.
- Beth: testing on the new autobuilder code. Still working out some bugs. Restarted ab10 this morning. Trying to do this without impacting the main AB as much as possible. If there is anything happen, please let me know. Planning a switch over in a week or so. Don't want to risk release RCs with the new AB. Backup plan is to use the current AB for release RCs.
- Sean: posted my slides for YP at ELC: http://elinux.org/images/9/96/2013-ELC-Building-a-distro-with-YP.pdf
- Paul: work on layer index applications. Finishing up the design. Hopefully to have something to show people fairly soon.


Re: X video extensions

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

On 26 February 2013 18:07, Gary Thomas <gary@...> wrote:
Here's what I get from xvinfo:
X-Video Extension version 2.2
screen #0
no adaptors present

So I guess the extension is there but my display doesn't support it?
How would I go about making that work?
XVideo has to be implemented by the drivers, what X video driver are you using?

Ross