Hob: include hddimg and iso into image types.

For image types, so far we don't include hddimg and iso. Then those files can not be deployed because they are filtered out in the image selection dialog.
This patch is to include hddimg and iso (which are "live" in image types).

Again, we have a TODO in the code for the future, that is to retrieve image types from the bitbake server instead of to use the walkaround.

(Bitbake rev: d565507940be73fb5ea3ae7048d8d143c44c2a95)

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Shane Wang 2012-02-29 22:15:02 +08:00 committed by Richard Purdie
parent 73444fb68c
commit 53cc2c6cac
4 changed files with 38 additions and 11 deletions

View File

@ -758,8 +758,8 @@ class Builder(gtk.Window):
flags = gtk.DIALOG_MODAL
| gtk.DIALOG_DESTROY_WITH_PARENT
| gtk.DIALOG_NO_SEPARATOR,
buttons = ("Close", gtk.RESPONSE_NO,
"Make usb image", gtk.RESPONSE_YES))
buttons = ("Make usb image", gtk.RESPONSE_YES,
"Close", gtk.RESPONSE_NO))
response = dialog.run()
dialog.destroy()

View File

@ -28,7 +28,7 @@ import re
import subprocess
import shlex
from bb.ui.crumbs.hobcolor import HobColors
from bb.ui.crumbs.hobwidget import HobViewTable
from bb.ui.crumbs.hobwidget import hcc, HobViewTable
from bb.ui.crumbs.progressbar import HobProgressBar
"""
@ -1083,9 +1083,10 @@ class ImageSelectionDialog (gtk.Dialog):
dirs[:] = []
for f in files:
for image_type in self.image_types:
if f.endswith('.' + image_type):
imageset.add(f.rsplit('.' + image_type)[0])
self.image_list.append(f)
for real_image_type in hcc.SUPPORTED_IMAGE_TYPES[image_type]:
if f.endswith('.' + real_image_type):
imageset.add(f.rsplit('.' + real_image_type)[0])
self.image_list.append(f)
for image in imageset:
self.image_store.set(self.image_store.append(), 0, image, 1, False)

View File

@ -22,6 +22,7 @@
import gobject
import logging
from bb.ui.crumbs.runningbuild import RunningBuild
from bb.ui.crumbs.hobwidget import hcc
class HobHandler(gobject.GObject):
@ -450,10 +451,8 @@ class HobHandler(gobject.GObject):
params["incompat_license"] = self.server.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"]) or ""
params["sdk_machine"] = self.server.runCommand(["getVariable", "SDKMACHINE"]) or self.server.runCommand(["getVariable", "SDK_ARCH"]) or ""
#params["image_types"] = self.server.runCommand(["getVariable", "IMAGE_TYPES"]) or ""
params["image_fstypes"] = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"]) or ""
"""
A workaround
"""
params["image_types"] = "jffs2 sum.jffs2 cramfs ext2 ext2.gz ext2.bz2 ext3 ext3.gz ext2.lzma btrfs live squashfs squashfs-lzma ubi tar tar.gz tar.bz2 tar.xz cpio cpio.gz cpio.xz cpio.lzma"
# walkaround
params["image_types"] = " ".join(hcc.SUPPORTED_IMAGE_TYPES.keys()).lstrip(" ")
return params

View File

@ -50,6 +50,33 @@ class hic:
ICON_INDI_CONFIRM_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/confirmation.png'))
ICON_INDI_ERROR_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/error.png'))
class hcc:
SUPPORTED_IMAGE_TYPES = {
"jffs2" : ["jffs2"],
"sum.jffs2" : ["sum.jffs2"],
"cramfs" : ["cramfs"],
"ext2" : ["ext2"],
"ext2.gz" : ["ext2.gz"],
"ext2.bz2" : ["ext2.bz2"],
"ext3" : ["ext3"],
"ext3.gz" : ["ext3.gz"],
"ext2.lzma" : ["ext2.lzma"],
"btrfs" : ["btrfs"],
"live" : ["hddimg", "iso"],
"squashfs" : ["squashfs"],
"squashfs-lzma" : ["squashfs-lzma"],
"ubi" : ["ubi"],
"tar" : ["tar"],
"tar.gz" : ["tar.gz"],
"tar.bz2" : ["tar.bz2"],
"tar.xz" : ["tar.xz"],
"cpio" : ["cpio"],
"cpio.gz" : ["cpio.gz"],
"cpio.xz" : ["cpio.xz"],
"cpio.lzma" : ["cpio.lzma"],
}
class HobViewTable (gtk.VBox):
"""
A VBox to contain the table for different recipe views and package view