From 526b575caa02a9c1938ca0ee2e31006b5cd76913 Mon Sep 17 00:00:00 2001 From: "minkee.lee" Date: Wed, 25 Nov 2015 16:53:57 +0900 Subject: [PATCH] custom-image: setting CPU type for custom base image Setting CPU type is needed to create launch config file. (image_arch=xxx) Change-Id: I5de59006e7b93a075657cd4e2abe986cf25b11c2 Signed-off-by: minkee.lee --- src/org/tizen/emulator/manager/platform/BaseImage.java | 12 ++++++++++++ .../manager/ui/detail/item/property/BaseImageViewItem.java | 1 + src/org/tizen/emulator/manager/vms/option/CommonOption.java | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/org/tizen/emulator/manager/platform/BaseImage.java b/src/org/tizen/emulator/manager/platform/BaseImage.java index aa19ed1..e768dd9 100644 --- a/src/org/tizen/emulator/manager/platform/BaseImage.java +++ b/src/org/tizen/emulator/manager/platform/BaseImage.java @@ -112,6 +112,18 @@ public class BaseImage { loadTemplate(); } + public void settingCPU() { + if (cpu != null || path == null ) { + return; + } + + String arch = FilePathResources.getFileExtention(path); + cpu = Architecture.getType(arch); + if (cpu == null) { + cpu = Architecture.x86; + } + } + @Override public String toString() { return information; diff --git a/src/org/tizen/emulator/manager/ui/detail/item/property/BaseImageViewItem.java b/src/org/tizen/emulator/manager/ui/detail/item/property/BaseImageViewItem.java index a0bb4d2..c1fe320 100644 --- a/src/org/tizen/emulator/manager/ui/detail/item/property/BaseImageViewItem.java +++ b/src/org/tizen/emulator/manager/ui/detail/item/property/BaseImageViewItem.java @@ -234,6 +234,7 @@ public class BaseImageViewItem extends ComboViewItem { BaseImage newItem; newItem = new BaseImage(ProfileList.getProfile(currentBaseImage.getProfile()).getPlatformByLatestVersion(), newPath); + newItem.settingCPU(); if (storeCustomImage(newItem)) { baseImageList.add(newItem); resetComboList(); diff --git a/src/org/tizen/emulator/manager/vms/option/CommonOption.java b/src/org/tizen/emulator/manager/vms/option/CommonOption.java index 960dba3..58d0647 100644 --- a/src/org/tizen/emulator/manager/vms/option/CommonOption.java +++ b/src/org/tizen/emulator/manager/vms/option/CommonOption.java @@ -33,6 +33,7 @@ import java.io.File; import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.resources.FilePathResources; import org.tizen.emulator.manager.vms.VMProperty; +import org.tizen.emulator.manager.vms.VMProperty.Architecture; import org.tizen.emulator.manager.vms.helper.VMLauncherException; public class CommonOption extends Option { @@ -48,7 +49,11 @@ public class CommonOption extends Option { + (property.getPropertyValue().baseImage.getProfileExtension().isEmpty() ? "" : "-"+ property.getPropertyValue().baseImage.getProfileExtension())); - config.addVariable(OPTION_KEY.VAR_IMAGE_ARCH, property.getArchInternal().toString()); + Architecture arch = property.getArchInternal(); + if (arch == null) { + arch = Architecture.x86; + } + config.addVariable(OPTION_KEY.VAR_IMAGE_ARCH, arch.toString()); // kernel log config.addKernelOption("console", "ttyS0"); //$NON-NLS-1$ //$NON-NLS-2$ -- 2.7.4