[OE-core] [PATCH 0/1][krogoth] Fix systemtap

2016-07-07 Thread Tom Zanussi
This patch is required for systemtap to work with krogoth and the 4.4 kernel.

The following changes since commit 98c57bb512ea6790db8604fcf0b88c81651d2ab4:

  build-appliance-image: Update to krogoth head revision (2016-07-06 17:28:04 
+0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib 
tzanussi/systemtap-memory-flags-krogoth
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/systemtap-memory-flags-krogoth

Tom Zanussi (1):
  systemtap: Add missing memory flag to fix stap module compilation

 ...48-by-updating-systemtap-s-memory-flag-us.patch | 73 ++
 meta/recipes-kernel/systemtap/systemtap_git.inc|  1 +
 2 files changed, 74 insertions(+)
 create mode 100644 
meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch

-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/1][krogoth] systemtap: Add missing memory flag to fix stap module compilation

2016-07-07 Thread Tom Zanussi
The 4.4 kernel removed some memory flag definitions, which cause
module compilation errors, rendering sytemtap essentially useless in
krogoth.

The problem is fixed in systemtap 3.0 and therefore in master, but as
mentioned in Systemtap BZ1285348, the fix for older versions is this
patch.

Signed-off-by: Tom Zanussi <tom.zanu...@linux.intel.com>
---
 ...48-by-updating-systemtap-s-memory-flag-us.patch | 73 ++
 meta/recipes-kernel/systemtap/systemtap_git.inc|  1 +
 2 files changed, 74 insertions(+)
 create mode 100644 
meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch

diff --git 
a/meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch
 
b/meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch
new file mode 100644
index 000..4c34d77
--- /dev/null
+++ 
b/meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch
@@ -0,0 +1,73 @@
+From 3d010295efd215cf83a7d07eecf89137973c154a Mon Sep 17 00:00:00 2001
+Message-Id: 
<3d010295efd215cf83a7d07eecf89137973c154a.1467836241.git.tom.zanu...@linux.intel.com>
+From: Jesper Brouer <jbro...@redhat.com>
+Date: Mon, 30 Nov 2015 11:24:29 -0600
+Subject: [PATCH] Fix BZ1285348 by updating systemtap's memory flag usage.
+
+* runtime/linux/runtime_defines.h: Make sure __GFP_WAIT is defined.
+* runtime/stp_utrace.c (utrace_task_alloc): Change GFP_IOFS to
+  STP_ALLOC_FLAGS.
+  (utrace_attach_task): Ditto.
+
+Upstream-Status: Backport
+
+Signed-off-by: Tom Zanussi <tom.zanu...@intel.com>
+---
+ runtime/linux/runtime_defines.h | 23 +++
+ runtime/stp_utrace.c|  5 +++--
+ 2 files changed, 26 insertions(+), 2 deletions(-)
+
+diff --git a/runtime/linux/runtime_defines.h b/runtime/linux/runtime_defines.h
+index e69de29..6b44e0d 100644
+--- a/runtime/linux/runtime_defines.h
 b/runtime/linux/runtime_defines.h
+@@ -0,0 +1,23 @@
++// The following kernel commit renamed __GFP_WAIT to __GRP_RECLAIM:
++//
++//   commit 71baba4b92dc1fa1bc461742c6ab1942ec6034e9
++//   Author: Mel Gorman <mgor...@techsingularity.net>
++//   Date:   Fri Nov 6 16:28:28 2015 -0800
++// 
++//   mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM
++// 
++//   __GFP_WAIT was used to signal that the caller was in atomic
++//   context and could not sleep.  Now it is possible to
++//   distinguish between true atomic context and callers that are
++//   not willing to sleep.  The latter should clear
++//   __GFP_DIRECT_RECLAIM so kswapd will still wake.  As clearing
++//   __GFP_WAIT behaves differently, there is a risk that people
++//   will clear the wrong flags.  This patch renames __GFP_WAIT to
++//   __GFP_RECLAIM to clearly indicate what it does -- setting it
++//   allows all reclaim activity, clearing them prevents it.
++//
++// Handle the rename by defining __GFP_WAIT as __GFP_RECLAIM.
++#include 
++#ifndef __GFP_WAIT
++#define __GFP_WAIT __GFP_RECLAIM
++#endif
+diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c
+index c69dec1..a8afc0d 100644
+--- a/runtime/stp_utrace.c
 b/runtime/stp_utrace.c
+@@ -511,7 +511,8 @@ static struct utrace *__task_utrace_struct(struct 
task_struct *task)
+  */
+ static bool utrace_task_alloc(struct task_struct *task)
+ {
+-  struct utrace *utrace = kmem_cache_zalloc(utrace_cachep, GFP_IOFS);
++  struct utrace *utrace = kmem_cache_zalloc(utrace_cachep,
++STP_ALLOC_FLAGS);
+   struct utrace *u;
+ 
+   if (unlikely(!utrace))
+@@ -782,7 +783,7 @@ static struct utrace_engine *utrace_attach_task(
+   utrace = task_utrace_struct(target);
+   }
+ 
+-  engine = kmem_cache_alloc(utrace_engine_cachep, GFP_IOFS);
++  engine = kmem_cache_alloc(utrace_engine_cachep, STP_ALLOC_FLAGS);
+   if (unlikely(!engine))
+   return ERR_PTR(-ENOMEM);
+ 
+-- 
+2.5.0
+
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc 
b/meta/recipes-kernel/systemtap/systemtap_git.inc
index 656f15f..2ea98b2 100644
--- a/meta/recipes-kernel/systemtap/systemtap_git.inc
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -9,6 +9,7 @@ SRC_URI = "git://sourceware.org/git/systemtap.git \
file://system_map_location.patch \
file://configure-allow-to-disable-libvirt.patch \
file://x32_abi_time.patch \
+   
file://0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch \
   "
 
 # systemtap doesn't support mips
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/1][krogoth] Update KBRANCH for linux-yocto-rt_4.4

2016-06-03 Thread Tom Zanussi
In order to enable branch creation based off of standard/preempt-rt in
the 4.4 kernel, standard/preeempt-rt/base was created, which meant
standard/preempt-rt had to be removed.

This patch updates the 4.4 linux-yocto-rt recipe to point to the new
branch (4.1 and previous versions already had standard/preempt-rt/base
and therefore don't need updates - only 4.4 is affected).

The following changes since commit 8f51f6153a09f8048fb4c4ce9cf4a19655240de4:

  toasterconf.json: exclude releases Toaster can't build (2016-06-03 15:02:19 
+0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib 
tzanussi/preempt-rt-kbranch-update-krogoth
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/preempt-rt-kbranch-update-krogoth

Tom Zanussi (1):
  linux-yocto-rt/4.4: Update KBRANCH

 meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/1][krogoth] linux-yocto-rt/4.4: Update KBRANCH

2016-06-03 Thread Tom Zanussi
standard/preempt-rt was replaced by standard/preempt-rt/base in
linux-yocto-4.4.git, so KBRANCH needs to be updated accordingly.

Signed-off-by: Tom Zanussi <tom.zanu...@linux.intel.com>
---
 meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb 
b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
index 5e39374..beff921 100644
--- a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
@@ -1,4 +1,4 @@
-KBRANCH ?= "standard/preempt-rt"
+KBRANCH ?= "standard/preempt-rt/base"
 
 require recipes-kernel/linux/linux-yocto.inc
 
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 1/1] linux-yocto-rt/4.4: Update KBRANCH

2016-05-28 Thread Tom Zanussi
On 05/28/2016 05:14 PM, Bruce Ashfield wrote:
> On Sat, May 28, 2016 at 3:27 PM, Tom Zanussi <tom.zanu...@linux.intel.com>
> wrote:
> 
>> standard/preempt-rt was replaced by standard/preempt-rt/base in
>> linux-yocto-4.4.git, so KBRANCH needs to be updated accordingly.
>>
>> Signed-off-by: Tom Zanussi <tom.zanu...@linux.intel.com>
>> ---
>>  meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
>> b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
>> index 5e39374..beff921 100644
>> --- a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
>> +++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
>> @@ -1,4 +1,4 @@
>> -KBRANCH ?= "standard/preempt-rt"
>> +KBRANCH ?= "standard/preempt-rt/base"
>>
> 
> This is missing the krogoth tag in the patch, right ?  since for master,
> this was in my series
> under commit [linux-yocto: create intel branches].
> 

Yeah, I had [krogoth] in the cover letter, but forgot to add it to the
patch subject, so yeah, should be [PATCH 1/1][krogoth] ;-)

Tom

> Bruce
> 
> 
> 
>>
>>  require recipes-kernel/linux/linux-yocto.inc
>>
>> --
>> 1.9.3
>>
>> --
>> ___
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
> 
> 
> 

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/1][krogoth] Update KBRANCH for linux-yocto-rt_4.4

2016-05-28 Thread Tom Zanussi
In order to enable branch creation based off of standard/preempt-rt in
the 4.4 kernel, standard/preeempt-rt/base was created, which meant
standard/preempt-rt had to be removed.

This patch updates the 4.4 linux-yocto-rt recipe to point to the new
branch (4.1 and previous versions already had standard/preempt-rt/base
and therefore don't need updates - only 4.4 is affected).

The following changes since commit da4bfbef46e52d2b647a837a47d0f5cb813ba8b2:

  gdb: Backport patch to changes with AVX and MPX (2016-05-22 08:43:01 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib 
tzanussi/preempt-rt-kbranch-update-krogoth
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/preempt-rt-kbranch-update-krogoth

Tom Zanussi (1):
  linux-yocto-rt/4.4: Update KBRANCH

 meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/1] linux-yocto-rt/4.4: Update KBRANCH

2016-05-28 Thread Tom Zanussi
standard/preempt-rt was replaced by standard/preempt-rt/base in
linux-yocto-4.4.git, so KBRANCH needs to be updated accordingly.

Signed-off-by: Tom Zanussi <tom.zanu...@linux.intel.com>
---
 meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb 
b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
index 5e39374..beff921 100644
--- a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
@@ -1,4 +1,4 @@
-KBRANCH ?= "standard/preempt-rt"
+KBRANCH ?= "standard/preempt-rt/base"
 
 require recipes-kernel/linux/linux-yocto.inc
 
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH][jethro] Revert "kernel/kernel-arch: Explicitly mapping between, i386/x86_64 and x86 for kernel ARCH"

2016-05-10 Thread Tom Zanussi
This reverts commit a6f52930a68d8462e23486d51cdda715072dd752.

In addition to also causing the problem in [YOCTO #9579], this commit
was reverted in krogoth and master but wasn't reverted in jethro but
should be.  The original revert message was:

This reverts commit 8d310b24927d0f348fb431895f0583733db2aad0.

That commit completely breaks KBUILD_DEFCONFIG because it relies on
$ARCH to match between the target OE arch and the kernel subdirectory
containing the defconfigs. In the kernel all defconfigs for everything
x86-based (including x86_64) is stored in dir arch/x86/configs/

kernel-yocto.bbclass correctly searches for all the defconfigs inside
${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}

Commit 8d310b249 makes it search in wrong places and _only_ if you
define TARGET_ARCH = "athlon" will it search x86 which is nonsensical.

The commit further adds an if clause to hack the mungled kernel arches
back to their original values (ugh) in do_shared_workdir which is run
after do compile, but of course the build breaks before that in
do_kernel_metadata because of the KBUILD_DEFCONFIG mentioned above (so
that hack is useless).

Please fix that corner case bug in another way which does not completely
screw up the kernel arch mapping & defconfig logic. If 64bit configs are
generated in the kernel for 32bit machines because the host is asked,
then it it a bug in the kernel, it is of no use to hack around it in OE.

(From OE-Core rev: bc02a478a5d4a5de7b3943ed809d5c22711f5b1f)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
Signed-off-by: Ross Burton <ross.bur...@intel.com>
Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>

Signed-off-by: Tom Zanussi <tom.zanu...@linux.intel.com>
---
 meta/classes/kernel-arch.bbclass |  4 +---
 meta/classes/kernel.bbclass  | 15 +++
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass
index d8b180e..3ed5986 100644
--- a/meta/classes/kernel-arch.bbclass
+++ b/meta/classes/kernel-arch.bbclass
@@ -21,9 +21,7 @@ def map_kernel_arch(a, d):
 
 valid_archs = d.getVar('valid_archs', True).split()
 
-if   re.match('i.86$', a):  return 'i386'
-elif re.match('x86.64$', a):return 'x86_64'
-elif re.match('athlon$', a):return 'x86'
+if   re.match('(i.86|athlon|x86.64)$', a):  return 'x86'
 elif re.match('armeb$', a): return 'arm'
 elif re.match('aarch64$', a):   return 'arm64'
 elif re.match('aarch64_be$', a):return 'arm64'
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index ee3e9a0..5e8b6cf 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -309,18 +309,9 @@ do_shared_workdir () {
cp -fR include/generated/* $kerneldir/include/generated/
fi
 
-   # When ARCH is set to i386 or x86_64, we need to map ARCH to the real 
name of src
-   # dir (x86) under arch/ of kenrel tree, so that we can find correct 
source to copy.
-
-   if [ "${ARCH}" = "i386" ] || [ "${ARCH}" = "x86_64" ]; then
-   KERNEL_SRCARCH=x86
-   else
-   KERNEL_SRCARCH=${ARCH}
-   fi
-
-   if [ -d arch/${KERNEL_SRCARCH}/include/generated ]; then
-   mkdir -p $kerneldir/arch/${KERNEL_SRCARCH}/include/generated/
-   cp -fR arch/${KERNEL_SRCARCH}/include/generated/* 
$kerneldir/arch/${KERNEL_SRCARCH}/include/generated/
+   if [ -d arch/${ARCH}/include/generated ]; then
+   mkdir -p $kerneldir/arch/${ARCH}/include/generated/
+   cp -fR arch/${ARCH}/include/generated/* 
$kerneldir/arch/${ARCH}/include/generated/
fi
 }
 
-- 
1.9.3
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/1] wic bugfix

2015-02-20 Thread Tom Zanussi
This fixes [Yocto Bug 7307 - wic create mkefidisk/mkgummidisk images fails].

Tested directdisk/mkefidisk/mkgummidisk image generation with
core-image-minimal for nuc, which all now work again with this patch.

The following changes since commit 5db6a27f4847e51c6434a968f81d3ceffcc54952:

  bitbake: toaster: importlayer Remove description input field (2015-02-20 
12:58:20 +)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-bug-7307
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-bug-7307

Tom Zanussi (1):
  wic: Fix kernel dir location

 scripts/lib/image/engine.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/1] wic: Fix kernel dir location

2015-02-20 Thread Tom Zanussi
With the recent kernel staging changes, STAGING_KERNEL_DIR no longer
points to the kernel image, which can be found however in
DEPLOY_DIR_IMAGE.  This updates find_artifacts() to look there
instead.

Fixes [YOCTO #7307].

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/engine.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index e794545..68d1ce2 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -73,8 +73,8 @@ def find_artifacts(image_name):
 if (get_line_val(line, IMAGE_ROOTFS)):
 rootfs_dir = get_line_val(line, IMAGE_ROOTFS)
 continue
-if (get_line_val(line, STAGING_KERNEL_DIR)):
-kernel_dir = get_line_val(line, STAGING_KERNEL_DIR)
+if (get_line_val(line, DEPLOY_DIR_IMAGE)):
+kernel_dir = get_line_val(line, DEPLOY_DIR_IMAGE)
 continue
 if (get_line_val(line, STAGING_DIR_NATIVE)):
 native_sysroot = get_line_val(line, STAGING_DIR_NATIVE)
@@ -200,7 +200,7 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, 
kernel_dir,
 values from the output of 'bitbake -e':
 
 rootfs_dir:IMAGE_ROOTFS
-kernel_dir:STAGING_KERNEL_DIR
+kernel_dir:DEPLOY_DIR_IMAGE
 native_sysroot:STAGING_DIR_NATIVE
 
 In the above case, bootimg_dir remains unset and the
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] wic: print partition alignment when available

2015-02-05 Thread Tom Zanussi
On Wed, 2015-02-04 at 23:48 +0100, Alexandre Belloni wrote:
 When printing a partition, the --align parameter was shown when present
 but not its value.
 
 Signed-off-by: Alexandre Belloni alexandre.bell...@free-electrons.com

Acked-by: Tom Zanussi tom.zanu...@linux.intel.com

 ---
  scripts/lib/wic/kickstart/custom_commands/micpartition.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/scripts/lib/wic/kickstart/custom_commands/micpartition.py 
 b/scripts/lib/wic/kickstart/custom_commands/micpartition.py
 index 43d04f12945c..d6be008cebf2 100644
 --- a/scripts/lib/wic/kickstart/custom_commands/micpartition.py
 +++ b/scripts/lib/wic/kickstart/custom_commands/micpartition.py
 @@ -32,7 +32,7 @@ class Mic_PartData(FC4_PartData):
  retval = FC4_PartData._getArgsAsStr(self)
  
  if self.align:
 -retval +=  --align
 +retval +=  --align=%d % self.align
  if self.extopts:
  retval +=  --extoptions=%s % self.extopts
  if self.part_type:
 -- 
 2.1.0
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] wic: bootimg-partition: Stop removing whole workdir

2015-02-05 Thread Tom Zanussi
On Wed, 2015-02-04 at 23:49 +0100, Alexandre Belloni wrote:
 Stop removing the whole working directory as this is also removing
 eventual previously created partition images, leading to image creation
 failures.
 
 Signed-off-by: Alexandre Belloni alexandre.bell...@free-electrons.com

Acked-by: Tom Zanussi tom.zanu...@linux.intel.com

 ---
  scripts/lib/wic/plugins/source/bootimg-partition.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py 
 b/scripts/lib/wic/plugins/source/bootimg-partition.py
 index 6ba39a01f700..c5eb7b8b801b 100644
 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py
 +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
 @@ -66,7 +66,7 @@ class BootimgPartitionPlugin(SourcePlugin):
  - copies all files listed in IMAGE_BOOT_FILES variable
  
  hdddir = %s/boot % cr_workdir
 -rm_cmd = rm -rf %s % cr_workdir
 +rm_cmd = rm -rf %s/boot % cr_workdir
  exec_cmd(rm_cmd)
  
  install_cmd = install -d %s % hdddir
 -- 
 2.1.0
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 1/1] wic: fix extended/logical partition layout

2015-02-05 Thread Tom Zanussi
On Fri, 2015-02-06 at 03:27 +0100, Alexandre Belloni wrote:
 Hi,
 
 I hit that issue today. And that indeed solves it.
 
 Tested-by: Alexandre Belloni alexandre.bell...@free-electrons.com
 
 We were wondering who is responsible to take that patch in, do you have
 an idea?
 

I think for master it's Ross, cc'ed.  Sometimes it takes awhile, you
just have to check every so often to see when it hits master.  Ross can
correct me, but I think this is where its staged before it hits master,
so you can see what's in the queue for testing (master under test):

  http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ross/mut

Tom


 On 03/02/2015 at 06:49:54 -0600, Tom Zanussi wrote :
  On Tue, 2015-02-03 at 11:05 +0100, Maciej Borzecki wrote:
   On 02/02 08:29, Tom Zanussi wrote:
On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote:
 ping

   
This looks reasonable, but I haven't been able to verify it due to wic
problems introduced by the recent kernel changes in oe-core.
   
If you have test cases e.g. the kickstart file(s) that you used for
testing the fix, please include them.  Also, any testing you may have
done to show it doesn't cause regressions in existing use cases.
   
   Kickstart that fails without the patch:
   
   part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat 
   --label boot --active --align 4 --size 16
   part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root 
   --align 4
   part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128
   part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128
   
   When mounting kernel ext4 complains about bad geometry of the 3rd
   partition (i.e. ext4 partition image was exactly 131072 blocks, but
   parted entry states 131071 blocks, wic stole the last sector of this
   partition, to account for EBR for the first extended):
   
   EXT4-fs (mmcblk0p3): bad geometry: block count 131072 exceeds size of
   device (131071 blocks)
   
   Then the first extended partition is not found, logical partition
   /dev/mmcblk0p4 is the last one visible. I'm guessing the EBR was
   overwritten by the last block of the 3rd partition image, hence the
   kerel cannot figure out the location of the extended partition.
   
   The problem won't be triggered unless there is a logical parition in
   kickstart. The only other kickstart using MBR is directdisk.wks, but it
   has only 2 partitions defined there.
   
   With the patch you can go on and define more crazy layout like this one
   below and it mounts properly:
   
   part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat 
   --label boot --active --align 4 --size 16
   part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root 
   --align 4
   part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128
   part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128
   part /mnt2 --ondisk mmcblk0 --fstype=ext4 --label fakedata2 --size 13
   part /mnt3 --ondisk mmcblk0 --fstype=ext4 --label fakedata3 --size 64
   
   
  
  Great, thanks for the detailed info.
  
  Acked-by: Tom Zanussi tom.zanu...@linux.intel.com
  
   --
   Maciej Borzęcki
   Senior Software Developer at Open-RnD Sp. z o.o., Poland
   www.open-rnd.pl
   mobile: +48 889 117 365, fax: +48 42 657 9079
   
   
   Niniejsza wiadomość wraz z załącznikami może
   zawierać chronione prawem lub poufne informacje i została
   wysłana wyłącznie do wiadomości i użytku osób, do których
   została zaadresowana. Jeśli wiadomość została otrzymana
   przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
   trzecich. W takim przypadku uprasza się o natychmiastowe
   zniszczenie wiadomości oraz poinformowanie nadawcy o
   zaistniałej sytuacji za pomocą wiadomości zwrotnej.
   Dziękujemy.
   
   This message, including any attachments hereto,
   may contain privileged or confidential information and is sent
   solely for the attention and use of the intended addressee(s).
   If you are not an intended addressee, you may neither use this
   message nor copy or deliver it to anyone. In such case, you
   should immediately destroy this message and kindly notify the
   sender by reply email. Thank you.
  
  
  -- 
  ___
  Openembedded-core mailing list
  Openembedded-core@lists.openembedded.org
  http://lists.openembedded.org/mailman/listinfo/openembedded-core
 
 -- 
 Alexandre Belloni, Free Electrons
 Embedded Linux, Kernel and Android engineering
 http://free-electrons.com


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] wic: use kB for the partitions size

2015-02-04 Thread Tom Zanussi
On Wed, 2015-02-04 at 00:40 +0100, Alexandre Belloni wrote:
 Use kB instead of MB for the partition size to get a better granularity.
 
 This is needed on some SoC (i.mx, omap) where it is necessary to create
 partitions as small as 64kB.
 
 Keep the backward compatibility by assuming MB when no unit is provided.
 

Looks fine to me, and a quick test shows expected sizes, etc.

But please do update at least the in-tool help (/lib/image/help.py) with
the new --size options.

Thanks,

Tom

Acked-by: Tom Zanussi tom.zanu...@linux.intel.com
Tested-by: Tom Zanussi tom.zanu...@linux.intel.com




$ ls -al build
total 65028
drwxr-xr-x. 3 trz trz 4096 Feb  4 11:02 .
drwxrwxr-x. 4 trz trz 4096 Feb  4 11:02 ..
-rw-r--r--. 1 trz trz 24199168 Feb  4 11:02 boot.img
-rw-rw-r--. 1 trz trz 51561472 Feb  4 11:02 directdisk-201502041102-sda.direct
drwxr-xr-x. 3 trz trz 4096 Feb  4 11:02 hdd
-rw-rw-r--. 1 trz trz 25346048 Feb  4 11:02 rootfs_platform.ext3
$ ls -al build.prev/
total 65040
drwxr-xr-x. 3 trz trz 4096 Feb  4 10:48 .
drwxrwxr-x. 4 trz trz 4096 Feb  4 11:02 ..
-rw-r--r--. 1 trz trz 24199168 Feb  4 10:48 boot.img
-rw-rw-r--. 1 trz trz 52429824 Feb  4 10:48 directdisk-201502041048-sda.direct
drwxr-xr-x. 3 trz trz 4096 Feb  4 10:48 hdd
-rw-rw-r--. 1 trz trz 25346048 Feb  4 10:48 rootfs_platform.ext3


 Signed-off-by: Alexandre Belloni alexandre.bell...@free-electrons.com
 ---
  .../wic/3rdparty/pykickstart/commands/partition.py |  4 +--
  scripts/lib/wic/3rdparty/pykickstart/options.py| 21 -
  scripts/lib/wic/kickstart/__init__.py  |  2 +-
  .../lib/wic/kickstart/custom_commands/partition.py | 36 
 +++---
  scripts/lib/wic/plugins/source/bootimg-efi.py  |  2 +-
  scripts/lib/wic/plugins/source/bootimg-pcbios.py   |  2 +-
  scripts/lib/wic/utils/partitionedfs.py |  4 +--
  7 files changed, 45 insertions(+), 26 deletions(-)
 
 diff --git a/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py 
 b/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py
 index 56b91aa9d9a4..b564b1a7abb9 100644
 --- a/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py
 +++ b/scripts/lib/wic/3rdparty/pykickstart/commands/partition.py
 @@ -78,7 +78,7 @@ class FC3_PartData(BaseData):
  if self.recommended:
  retval +=  --recommended
  if self.size and self.size != 0:
 -retval +=  --size=%s % self.size
 +retval +=  --size=%sk % self.size
  if hasattr(self, start) and self.start != 0:
  retval +=  --start=%s % self.start
  
 @@ -216,7 +216,7 @@ class FC3_Partition(KickstartCommand):
callback=part_cb, nargs=1, type=string)
  op.add_option(--recommended, dest=recommended, 
 action=store_true,
default=False)
 -op.add_option(--size, dest=size, action=store, type=int,
 +op.add_option(--size, dest=size, action=store, type=size,
nargs=1)
  op.add_option(--start, dest=start, action=store, type=int,
nargs=1)
 diff --git a/scripts/lib/wic/3rdparty/pykickstart/options.py 
 b/scripts/lib/wic/3rdparty/pykickstart/options.py
 index 341c5d7298b0..7bbe6a85a156 100644
 --- a/scripts/lib/wic/3rdparty/pykickstart/options.py
 +++ b/scripts/lib/wic/3rdparty/pykickstart/options.py
 @@ -143,6 +143,24 @@ def _check_string(option, opt, value):
  else:
  return value
  
 +def _check_size(option, opt, value):
 +# Former default was MB
 +if (value.isdigit()):
 +return int(value) * 1024L
 +
 +mapping = {opt: opt, value: value}
 +if (not value[0:len(value)-1].isdigit()):
 +raise OptionValueError(_(Option %(opt)s: invalid size value: 
 %(value)r) % mapping)
 +
 +size = int(value[0:len(value)-1])
 +if (value.endswith(k) or value.endswith(K)):
 +return size
 +if (value.endswith(M)):
 +return size * 1024L
 +if (value.endswith(G)):
 +return size * 1024L * 1024L
 +raise OptionValueError(_(Option %(opt)s: invalid size value: 
 %(value)r) % mapping)
 +
  # Creates a new Option class that supports several new attributes:
  # - required:  any option with this attribute must be supplied or an 
 exception
  #  is thrown
 @@ -169,10 +187,11 @@ class KSOption (Option):
  ACTIONS = Option.ACTIONS + (map, map_extend,)
  STORE_ACTIONS = Option.STORE_ACTIONS + (map, map_extend,)
  
 -TYPES = Option.TYPES + (ksboolean, string)
 +TYPES = Option.TYPES + (ksboolean, string, size)
  TYPE_CHECKER = copy(Option.TYPE_CHECKER)
  TYPE_CHECKER[ksboolean] = _check_ksboolean
  TYPE_CHECKER[string] = _check_string
 +TYPE_CHECKER[size] = _check_size
  
  def _check_required(self):
  if self.required and not self.takes_value():
 diff --git a/scripts/lib/wic/kickstart/__init__.py 
 b/scripts/lib/wic/kickstart/__init__.py
 index 600098293aef..1d094e9d5d8b 100644

Re: [OE-core] [PATCH] wic: bootimg-partition: Stop removing whole workdir

2015-02-04 Thread Tom Zanussi
On Wed, 2015-02-04 at 23:49 +0100, Alexandre Belloni wrote:
 Stop removing the whole working directory as this is also removing
 eventual previously created partition images, leading to image creation
 failures.
 

I'm surprised - I've never run into a problem like this.  Can you give
more details and/or a reproducer?

Thanks,

Tom

 Signed-off-by: Alexandre Belloni alexandre.bell...@free-electrons.com
 ---
  scripts/lib/wic/plugins/source/bootimg-partition.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py 
 b/scripts/lib/wic/plugins/source/bootimg-partition.py
 index 6ba39a01f700..c5eb7b8b801b 100644
 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py
 +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
 @@ -66,7 +66,7 @@ class BootimgPartitionPlugin(SourcePlugin):
  - copies all files listed in IMAGE_BOOT_FILES variable
  
  hdddir = %s/boot % cr_workdir
 -rm_cmd = rm -rf %s % cr_workdir
 +rm_cmd = rm -rf %s/boot % cr_workdir
  exec_cmd(rm_cmd)
  
  install_cmd = install -d %s % hdddir


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] wic: bail out on kickstart parse errors

2015-02-04 Thread Tom Zanussi
On Wed, 2015-02-04 at 11:53 +0100, Maciej Borzecki wrote:
 Kickstart file errors are not emitted by the parser. In case errors, the
 current code will continue to execute possibly creating a faulty or
 incomplete image. The patch enables the parser to emit all encountered
 errors. The error message is shown for the user and further execution is
 ceased.
 
 Signed-off-by: Maciej Borzecki maciej.borze...@open-rnd.pl
 Signed-off-by: Maciek Borzecki maciek.borze...@gmail.com

Acked-by: Tom Zanussi tom.zanu...@linux.intel.com

 ---
  scripts/lib/wic/kickstart/__init__.py | 9 +++--
  1 file changed, 3 insertions(+), 6 deletions(-)
 
 diff --git a/scripts/lib/wic/kickstart/__init__.py 
 b/scripts/lib/wic/kickstart/__init__.py
 index 
 600098293aeff5a1f7756ba20381b8d054c10fd1..b1406a04575906f7d5822139eef5a4a2753040fc
  100644
 --- a/scripts/lib/wic/kickstart/__init__.py
 +++ b/scripts/lib/wic/kickstart/__init__.py
 @@ -58,16 +58,13 @@ def read_kickstart(path):
  def __init__(self):
  superclass.__init__(self, mapping=commandMap[using_version])
  
 -ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=False)
 +ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=True)
  
  try:
  ks.readKickstart(path)
  except (kserrors.KickstartParseError, kserrors.KickstartError), err:
 -if msger.ask(Errors occured on kickstart file, skip and continue?):
 -msger.warning(%s % err)
 -pass
 -else:
 -raise errors.KsError(%s % err)
 +msger.warning(Errors occurred when parsing kickstart file: %s\n % 
 path)
 +msger.error(%s % err)
  
  return ks
  
 -- 
 1.9.3
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 1/1] wic: fix extended/logical partition layout

2015-02-03 Thread Tom Zanussi
On Tue, 2015-02-03 at 11:05 +0100, Maciej Borzecki wrote:
 On 02/02 08:29, Tom Zanussi wrote:
  On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote:
   ping
  
 
  This looks reasonable, but I haven't been able to verify it due to wic
  problems introduced by the recent kernel changes in oe-core.
 
  If you have test cases e.g. the kickstart file(s) that you used for
  testing the fix, please include them.  Also, any testing you may have
  done to show it doesn't cause regressions in existing use cases.
 
 Kickstart that fails without the patch:
 
 part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label 
 boot --active --align 4 --size 16
 part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4
 part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128
 part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128
 
 When mounting kernel ext4 complains about bad geometry of the 3rd
 partition (i.e. ext4 partition image was exactly 131072 blocks, but
 parted entry states 131071 blocks, wic stole the last sector of this
 partition, to account for EBR for the first extended):
 
 EXT4-fs (mmcblk0p3): bad geometry: block count 131072 exceeds size of
 device (131071 blocks)
 
 Then the first extended partition is not found, logical partition
 /dev/mmcblk0p4 is the last one visible. I'm guessing the EBR was
 overwritten by the last block of the 3rd partition image, hence the
 kerel cannot figure out the location of the extended partition.
 
 The problem won't be triggered unless there is a logical parition in
 kickstart. The only other kickstart using MBR is directdisk.wks, but it
 has only 2 partitions defined there.
 
 With the patch you can go on and define more crazy layout like this one
 below and it mounts properly:
 
 part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label 
 boot --active --align 4 --size 16
 part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4
 part /var/lib/misc --ondisk mmcblk0 --fstype=ext4 --label misc --size 128
 part /mnt --ondisk mmcblk0 --fstype=ext4 --label fakedata --size 128
 part /mnt2 --ondisk mmcblk0 --fstype=ext4 --label fakedata2 --size 13
 part /mnt3 --ondisk mmcblk0 --fstype=ext4 --label fakedata3 --size 64
 
 

Great, thanks for the detailed info.

Acked-by: Tom Zanussi tom.zanu...@linux.intel.com

 --
 Maciej Borzęcki
 Senior Software Developer at Open-RnD Sp. z o.o., Poland
 www.open-rnd.pl
 mobile: +48 889 117 365, fax: +48 42 657 9079
 
 
 Niniejsza wiadomość wraz z załącznikami może
 zawierać chronione prawem lub poufne informacje i została
 wysłana wyłącznie do wiadomości i użytku osób, do których
 została zaadresowana. Jeśli wiadomość została otrzymana
 przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
 trzecich. W takim przypadku uprasza się o natychmiastowe
 zniszczenie wiadomości oraz poinformowanie nadawcy o
 zaistniałej sytuacji za pomocą wiadomości zwrotnej.
 Dziękujemy.
 
 This message, including any attachments hereto,
 may contain privileged or confidential information and is sent
 solely for the attention and use of the intended addressee(s).
 If you are not an intended addressee, you may neither use this
 message nor copy or deliver it to anyone. In such case, you
 should immediately destroy this message and kindly notify the
 sender by reply email. Thank you.


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 1/1] wic: fix extended/logical partition layout

2015-02-02 Thread Tom Zanussi
On Mon, 2015-02-02 at 08:37 +0100, Maciej Borzecki wrote:
 ping
 

This looks reasonable, but I haven't been able to verify it due to wic
problems introduced by the recent kernel changes in oe-core.

If you have test cases e.g. the kickstart file(s) that you used for
testing the fix, please include them.  Also, any testing you may have
done to show it doesn't cause regressions in existing use cases.

Thanks,

Tom

 On 01/09 14:24, Maciej Borzecki wrote:
  The patch fixes an issue in laying out extended and logical partitions
  by wic. The original code produced disk images in which the size 3rd
  partition as described in MBR was incorrect. Depending on the type of
  file system used for that partition and size of the partition, it would
  be impossible to mount the partition correctly. For instance, kickstart
  file in which the 3rd partition had size of 1GB and used ext4 fs, would
  result in an image with an umountable partition. The root cause is
  reservation of sectors for EBR through stealing of last sector from the
  last primary partition.
 
  Signed-off-by: Maciej Borzecki maciej.borze...@open-rnd.pl
  Signed-off-by: Maciek Borzecki maciek.borze...@gmail.com
  ---
   scripts/lib/wic/utils/partitionedfs.py | 40 
  --
   1 file changed, 19 insertions(+), 21 deletions(-)
 
  diff --git a/scripts/lib/wic/utils/partitionedfs.py 
  b/scripts/lib/wic/utils/partitionedfs.py
  index fb95cc7..9df93dc 100644
  --- a/scripts/lib/wic/utils/partitionedfs.py
  +++ b/scripts/lib/wic/utils/partitionedfs.py
  @@ -156,6 +156,13 @@ class Image:
   # Skip one sector required for the partitioning scheme 
  overhead
   d['offset'] += overhead
 
  +elif d['numpart']  3:
  +# Reserve a sector for EBR for every logical partition
  +# before alignment is performed.
  +if ptable_format == msdos:
  +d['offset'] += 1
  +
  +
   if p['align']:
   # If not first partition and we do have alignment set we 
  need
   # to align the partition.
  @@ -185,14 +192,6 @@ class Image:
   p['num'] = d['numpart']
 
   if d['ptable_format'] == msdos:
  -if d['numpart']  2:
  -# Every logical partition requires an additional 
  sector for
  -# the EBR, so steal the last sector from the end of 
  each
  -# partition starting from the 3rd one for the EBR. This
  -# will make sure the logical partitions are aligned
  -# correctly.
  -p['size'] -= 1
  -
   if d['numpart']  3:
   p['type'] = 'logical'
   p['num'] = d['numpart'] + 1
  @@ -259,13 +258,20 @@ class Image:
   for p in self.partitions:
   d = self.disks[p['disk_name']]
   if d['ptable_format'] == msdos and p['num'] == 5:
  -# The last sector of the 3rd partition was reserved for 
  the EBR
  -# of the first _logical_ partition. This is why the 
  extended
  -# partition should start one sector before the first 
  logical
  -# partition.
  +# Create an extended partition (note: extended
  +# partition is described in MBR and contains all
  +# logical partitions). The logical partitions save a
  +# sector for an EBR just before the start of a
  +# partition. The extended partition must start one
  +# sector before the start of the first logical
  +# partition. This way the first EBR is inside of the
  +# extended partition. Since the extended partitions
  +# starts a sector before the first logical partition,
  +# add a sector at the back, so that there is enough
  +# room for all logical partitions.
   self.__create_partition(d['disk'].device, extended,
   None, p['start'] - 1,
  -d['offset'] - p['start'])
  +d['offset'] - p['start'] + 1)
 
   if p['fstype'] == swap:
   parted_fs_type = linux-swap
  @@ -338,14 +344,6 @@ class Image:
 
   for p in self.partitions:
   d = self.disks[p['disk_name']]
  -if d['ptable_format'] == msdos and p['num'] == 5:
  -# The last sector of the 3rd partition was reserved for 
  the EBR
  -# of the first _logical_ partition. This is why the 
  extended
  -# partition should start one sector before the first 
  logical
  -# partition.
  -self.__write_partition(p['num'], p['source_file'],
  - 

Re: [OE-core] [PATCH 0/3] wic: glob support minor fixes

2014-12-15 Thread Tom Zanussi
On Wed, 2014-12-10 at 12:45 +0100, Maciej Borzecki wrote:
 This patch series adds changes that enable globbing in IMAGE_BOOT_FILES.
 Effectivey this makes use of with with Raspberry Pi a tad easier, when a
 lengthy list of boot files can be replaced with just one entry. A related
 change to meta-raspberrypi will be sent to the Yocto mailing list.
 

Looks ok to me, and I tried it out with your raspberrypi layer changes
which generated the image (I didn't try any other image types to check
against regressions there, though nothing in here looks like it would
touch anything related to the other source plugins, so I'm not worried -
in the next milestone I hope to have some automated wic testing going to
make checking easy).

I do think, though, that we need to have the documentation for this in
the tool itself.  As it stands, the IMAGE_BOOT_FILES variable is
documented in the manual, but even then, there's no context that ties it
to the bootimg-partition plugin.  I think we need to add a mechanism so
that help text can be added to each plugin, which would be automatically
picked up and merged probably into a plugin-specific 'help plugins'
section in the tool.

The other thing I noticed, which has nothing to do with this patchset,
but along the same lines, is that the plugin machinery does find the
sdimage-raspberrypi.wks file to generate the image, as expected, but it
doesn't show up in 'wic list source-plugins', as you'd expect.

Acked-by: Tom Zanussi tom.zanu...@linux.intel.com

 Maciej Borzecki (3):
   wic: IMAGE_BOOT_FILES format checks in bootimg-partition source
   wic: add globbing support in IMAGE_BOOT_FILES entries
   ref-manual: update IMAGE_BOOT_FILES entry
 
  documentation/ref-manual/ref-variables.xml | 37 +++
  .../lib/wic/plugins/source/bootimg-partition.py| 43 
 +-
  2 files changed, 64 insertions(+), 16 deletions(-)
 
 -- 
 1.9.3
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 0/3] wic: glob support minor fixes

2014-12-15 Thread Tom Zanussi
On Mon, 2014-12-15 at 20:37 +0100, Maciej Borzecki wrote:
 On 12/15 11:04, Tom Zanussi wrote:
  On Wed, 2014-12-10 at 12:45 +0100, Maciej Borzecki wrote:
   This patch series adds changes that enable globbing in IMAGE_BOOT_FILES.
   Effectivey this makes use of with with Raspberry Pi a tad easier, when a
   lengthy list of boot files can be replaced with just one entry. A related
   change to meta-raspberrypi will be sent to the Yocto mailing list.
  
 
  Looks ok to me, and I tried it out with your raspberrypi layer changes
  which generated the image (I didn't try any other image types to check
  against regressions there, though nothing in here looks like it would
  touch anything related to the other source plugins, so I'm not worried -
  in the next milestone I hope to have some automated wic testing going to
  make checking easy).
 
  I do think, though, that we need to have the documentation for this in
  the tool itself.  As it stands, the IMAGE_BOOT_FILES variable is
  documented in the manual, but even then, there's no context that ties it
  to the bootimg-partition plugin.  I think we need to add a mechanism so
  that help text can be added to each plugin, which would be automatically
  picked up and merged probably into a plugin-specific 'help plugins'
  section in the tool.
 
  The other thing I noticed, which has nothing to do with this patchset,
  but along the same lines, is that the plugin machinery does find the
  sdimage-raspberrypi.wks file to generate the image, as expected, but it
  doesn't show up in 'wic list source-plugins', as you'd expect.
 
 That's expected, there is no separate source plugin for
 sdimage-raspberrypi.wks. The kickstart file makes use of
 bootimage-partition, so it's effectively almost identical to
 sdimage-bootpart.wks but the boot partition size and start offset.
 

You're right, I was confusing it with 'list images', which does find the
sdimage-raspberrypi.wks file as expected.

Tom

 So far the only development boards that will not directly work with
 wic's current plugins are Freescale ones (ex. popular iMX6 boards like
 Wandboard, Nitrogen6x, Sable Lite etc.). These boards expect u-boot to
 be located just after MBR, hence the use case is somewhat similar to
 what pcibios source plugin covers.
 
 
 
  Acked-by: Tom Zanussi tom.zanu...@linux.intel.com
 
   Maciej Borzecki (3):
 wic: IMAGE_BOOT_FILES format checks in bootimg-partition source
 wic: add globbing support in IMAGE_BOOT_FILES entries
 ref-manual: update IMAGE_BOOT_FILES entry
  
documentation/ref-manual/ref-variables.xml | 37 
   +++
.../lib/wic/plugins/source/bootimg-partition.py| 43 
   +-
2 files changed, 64 insertions(+), 16 deletions(-)
  
   --
   1.9.3
  
 
 
 
 --
 Maciej Borzęcki
 Senior Software Developer at Open-RnD Sp. z o.o., Poland
 www.open-rnd.pl
 mobile: +48 889 117 365, fax: +48 42 657 9079
 
 
 Niniejsza wiadomość wraz z załącznikami może
 zawierać chronione prawem lub poufne informacje i została
 wysłana wyłącznie do wiadomości i użytku osób, do których
 została zaadresowana. Jeśli wiadomość została otrzymana
 przypadkowo zabrania się jej kopiowania lub rozsyłania do osób
 trzecich. W takim przypadku uprasza się o natychmiastowe
 zniszczenie wiadomości oraz poinformowanie nadawcy o
 zaistniałej sytuacji za pomocą wiadomości zwrotnej.
 Dziękujemy.
 
 This message, including any attachments hereto,
 may contain privileged or confidential information and is sent
 solely for the attention and use of the intended addressee(s).
 If you are not an intended addressee, you may neither use this
 message nor copy or deliver it to anyone. In such case, you
 should immediately destroy this message and kindly notify the
 sender by reply email. Thank you.


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 0/2] commits for machine setup tool

2014-12-15 Thread Tom Zanussi
On Mon, 2014-12-15 at 10:47 -0800, nitin.a.kam...@intel.com wrote:
 From: Nitin A Kamble nitin.a.kam...@intel.com
 
 This pull request introduces a new feature called machine-setup-tool, which
 can be used by the BSP. With the use of the tool, BSPs for different boards
 which mainly differ in the text configuration for the target board, can be
 consolidated to use a common BSP.
 
 The tool provides ability to configure the target image at runtime. It also

There doesn't seem to be any documentation for this tool that I can see
here.  How does a user set things up to configure the target image at
runtime, or does it just happen?

How do you know it's working or not - there doesn't seem to be any
instructions on how to use or test it.

 provides ability to detect the target boards for automatic configuration of
 the image. The tool can handle any text configuration for the target image.

Great, but how?  Are there some files or variables that need tweaking?

 All the configuration manipulation needed for the meta-intel BSP boards is
 already supported in the tool.
 

That's great for meta-intel, but this is oe-core, not sure why that's
mentioned here.

 The tool's configuration is BSP specific and need to be specified separately
 in the BSP layer.  For example, for the meta-intel layer, the complementary
 commits can be seen here:
 
 http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-contrib/log/?h=nitin/machinesetuptool
 
 These commits are enabling the meta-intel layer to support 6 boards with 2
 common BSPs.
 

It's good to have working examples, but I don't think that should
replace documentation.

Tom

 Thanks,
 Nitin
 
 
 
 The following changes since commit 8657c2fd57600e0b0eaf2a14692de7453c78e1bb:
 
   serf: readded md5sum (2014-12-11 11:34:57 +)
 
 are available in the git repository at:
 
   git://git.yoctoproject.org/poky-contrib nitin/machinesetuptool
   
 http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=nitin/machinesetuptool
 
 Nitin A Kamble (2):
   alsa-plugins: a new recipe
   machinesetuptool: a new recipe for setup of a machine
 
  .../machinesetuptool/machinesetuptool_git.bb   | 55 
 ++
  .../recipes-multimedia/alsa/alsa-plugins_1.0.28.bb | 49 +++
  2 files changed, 104 insertions(+)
  create mode 100644 meta/recipes-bsp/machinesetuptool/machinesetuptool_git.bb
  create mode 100644 meta/recipes-multimedia/alsa/alsa-plugins_1.0.28.bb
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [v2 PATCH 0/9] kernel: version updates

2014-12-11 Thread Tom Zanussi
On Thu, 2014-12-11 at 14:56 +, Richard Purdie wrote:
 On Thu, 2014-12-11 at 13:58 +, Richard Purdie wrote:
  On Thu, 2014-12-11 at 03:31 -0500, Bruce Ashfield wrote:
   On Wed, Dec 10, 2014 at 10:02 AM, Burton, Ross ross.bur...@intel.com 
   wrote:
   
On 10 December 2014 at 14:16, Bruce Ashfield 
bruce.ashfi...@windriver.com
wrote:
   
The following changes since commit
88dfcbf149dda89277e58ae4ec3a87500624cfff:
   
  kernel-yocto: make sure git tags get dereferenced properly in 
do_patch()
(2014-12-10 08:12:56 -0500)
   
are available in the git repository at:
   
  git://git.pokylinux.org/poky-contrib HEAD
   
   
I wonder what happened here!
   
   @#!$#@$ the script is insane.
   
   
   
for you to fetch changes up to 
4be985be419f06f18c735d72ac4a4d00fea71dd8:
   
  linux-yocto/3.14: update to 3.14.26, integrate ltsi and -rt updates
(2014-12-10 08:38:49 -0500)
   
   
That's zedd/kernel-updates, right?
   
   
   Yah. Sorry about the confusion,
  
  I've been experimenting, the upgrades look good but we have a problem
  with the new kernel class changes.
  
  The issue is that if you have an existing TMPDIR, the build will do bad
  things.
  
  Basically, there is usually an existing sstate manifest file which
  covers the kernel source in the sysroot. do_configure will trigger
  cleaning of that manifest, a large chunk of the source disappears and
  then the build understandably fails.
  
  Whilst I can say what is happening, I can't say how we fix it at this
  point :/.
  
  I would like people to test these patches, we'd better hold off merging
  until we can get this issue figured out. Its part of a wider problem
  with stale data in the sysroot which we really need to figure out but
  its not been solved yet as its a  very hard problem for which we don't
  have a solution :(.
 
 After quite some thinking, I've come up with the patch below which
 should at least allow us to get this patch series merged. Obviously I
 need to split this up and send it out properly with a decent commit log
 but I thought I'd share it sooner than later.
 

I tried this on an old romley build and got this:

http://pastebin.com/WetCnesw

I then switched to nuc using the same tmpdir and that kernel built fine.

Note that the romley build uses the 3.10 kernel and the nuc build uses
the 3.17 kernel - I don't know if that could account for the difference,
or if it was more due to the fact that I did the romley build first and
then the nuc, and if I'd done it in the reverse order it would have been
the nuc failing instead.  Or something else...

Tom

 Cheers,
 
 Richard
 
 
 From 2495650e76bdee971645b3049b6e65307e506e09 Mon Sep 17 00:00:00 2001
 From: Richard Purdie richard.pur...@linuxfoundation.org
 Date: Thu, 11 Dec 2014 14:36:05 +
 Subject: sanity: TMPDIR ABI change for kernel process
 
 Signed-off-by: Richard Purdie richard.pur...@linuxfoundation.org
 
 diff --git a/meta-yocto/conf/distro/poky.conf 
 b/meta-yocto/conf/distro/poky.conf
 index 72db36d..bea8e04 100644
 --- a/meta-yocto/conf/distro/poky.conf
 +++ b/meta-yocto/conf/distro/poky.conf
 @@ -94,7 +94,7 @@ BB_SIGNATURE_HANDLER ?= 'OEBasicHash'
  # that breaks the format and have been previously discussed on the mailing 
 list 
  # with general agreement from the core team.
  #
 -OELAYOUT_ABI = 8
 +OELAYOUT_ABI = 10
  
  # add poky sanity bbclass
  INHERIT += poky-sanity
 diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
 index 5be5efb..71fd2e9 100644
 --- a/meta/classes/sanity.bbclass
 +++ b/meta/classes/sanity.bbclass
 @@ -519,6 +519,16 @@ def sanity_handle_abichanges(status, d):
  status.addresult(Your configuration is using stamp files 
 including the sstate hash but your build directory was built with stamp files 
 that do not include this.\nTo continue, either rebuild or switch back to the 
 OEBasic signature handler with BB_SIGNATURE_HANDLER = 'OEBasic'.\n)
  elif (abi != current_abi and current_abi == 9):
  status.addresult(The layout of the TMPDIR STAMPS directory has 
 changed. Please clean out TMPDIR and rebuild (sstate will be still be valid 
 and reused)\n)
 +elif (abi != current_abi and current_abi == 10 and (abi == 8 or 
 abi == 9)):
 +bb.note(Converting staging layout from version 8/9 to layout 
 version 10)
 +cmd = d.expand(grep -l sysroot-providers/virtual_kernel 
 ${SSTATE_MANIFESTS}/*)
 +ret, result = oe.utils.getstatusoutput(cmd)
 +result = result.split()
 +for f in result:
 +bb.note(Uninstalling manifest file %s % f)
 +sstate_clean_manifest(f, d)
 +with open(abifile, w) as f:
 +f.write(current_abi)
  elif (abi != current_abi):
  # Code to convert from one ABI to another could go here if 
 possible.
  status.addresult(Error, TMPDIR has changed its layout 

Re: [OE-core] [v2 PATCH 0/9] kernel: version updates

2014-12-11 Thread Tom Zanussi
On Thu, 2014-12-11 at 10:45 -0600, Tom Zanussi wrote:
 On Thu, 2014-12-11 at 14:56 +, Richard Purdie wrote:
  On Thu, 2014-12-11 at 13:58 +, Richard Purdie wrote:
   On Thu, 2014-12-11 at 03:31 -0500, Bruce Ashfield wrote:
On Wed, Dec 10, 2014 at 10:02 AM, Burton, Ross ross.bur...@intel.com 
wrote:

 On 10 December 2014 at 14:16, Bruce Ashfield 
 bruce.ashfi...@windriver.com
 wrote:

 The following changes since commit
 88dfcbf149dda89277e58ae4ec3a87500624cfff:

   kernel-yocto: make sure git tags get dereferenced properly in 
 do_patch()
 (2014-12-10 08:12:56 -0500)

 are available in the git repository at:

   git://git.pokylinux.org/poky-contrib HEAD


 I wonder what happened here!

@#!$#@$ the script is insane.



 for you to fetch changes up to 
 4be985be419f06f18c735d72ac4a4d00fea71dd8:

   linux-yocto/3.14: update to 3.14.26, integrate ltsi and -rt updates
 (2014-12-10 08:38:49 -0500)


 That's zedd/kernel-updates, right?


Yah. Sorry about the confusion,
   
   I've been experimenting, the upgrades look good but we have a problem
   with the new kernel class changes.
   
   The issue is that if you have an existing TMPDIR, the build will do bad
   things.
   
   Basically, there is usually an existing sstate manifest file which
   covers the kernel source in the sysroot. do_configure will trigger
   cleaning of that manifest, a large chunk of the source disappears and
   then the build understandably fails.
   
   Whilst I can say what is happening, I can't say how we fix it at this
   point :/.
   
   I would like people to test these patches, we'd better hold off merging
   until we can get this issue figured out. Its part of a wider problem
   with stale data in the sysroot which we really need to figure out but
   its not been solved yet as its a  very hard problem for which we don't
   have a solution :(.
  
  After quite some thinking, I've come up with the patch below which
  should at least allow us to get this patch series merged. Obviously I
  need to split this up and send it out properly with a decent commit log
  but I thought I'd share it sooner than later.
  
 
 I tried this on an old romley build and got this:
 
 http://pastebin.com/WetCnesw
 
 I then switched to nuc using the same tmpdir and that kernel built fine.
 
 Note that the romley build uses the 3.10 kernel and the nuc build uses
 the 3.17 kernel - I don't know if that could account for the difference,
 or if it was more due to the fact that I did the romley build first and
 then the nuc, and if I'd done it in the reverse order it would have been
 the nuc failing instead.  Or something else...
 

So, when I switched back to the romley machine and tried again, the
kernel built without error.  But..

I went back and reproduced the starting point, which I'll post here to
make it easy for anyone to reproduce, using the following commits:

poky: f19b4e995ea47f9243f152b39337330307453c9f
meta-intel: a72da6350e7a77256ad597e8e8c40909590a2a40

And verified the romley case again, and also saw the same thing with
nuc, which uses the 3.17 kernel.  In both cases the build failed and the
kernel source directory was empty e.g.:

/usr/local/dev/yocto/isg-test/build/tmp/sysroots/romley/usr/src/kernel

Switching to romley built fine, and switching back after that the nuc
kernel built fine again, and the kernel source dirs were populated in
both cases.

Below is the output from the nuc build:


[trz@medianoche build]$ bitbake virtual/kernel
NOTE: Converting staging layout from version 8/9 to layout version 10
NOTE: Uninstalling manifest
file 
/usr/local/dev/yocto/isg-test/build/tmp/sstate-control/manifest-nuc-linux-yocto.populate_sysroot
Parsing recipes: 100% |
##| Time:
00:00:19
Parsing of 916 .bb files complete (0 cached, 916 parsed). 1314 targets,
46 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION= 1.25.0
BUILD_SYS = x86_64-linux
NATIVELSBSTRING   = Fedora-20
TARGET_SYS= x86_64-poky-linux
MACHINE   = nuc
DISTRO= poky
DISTRO_VERSION= 1.7
TUNE_FEATURES = m64 corei7
TARGET_FPU= 
meta  
meta-yocto
meta-yocto-bsp=
zedd-kernel-updates0:3554105e81a2084f23cae9fef8db8c7a1c4f7c04
meta-intel
meta-crownbay 
meta-nuc  
meta-romley   = master20:a72da6350e7a77256ad597e8e8c40909590a2a40

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_kernel_checkout (log file is located
at 
/usr/local/dev/yocto/isg-test/build/tmp/work/corei7-64-intel-common-poky-linux/linux-yocto/3.17.1+gitAUTOINC+b86dd5c6f4_0caf16d385-r0/temp/log.do_kernel_checkout.9225)
ERROR: Logfile of failure stored
in: 
/usr/local/dev/yocto/isg-test/build

Re: [OE-core] [PATCH 0/6][dizzy] some wic bugfixes

2014-12-03 Thread Tom Zanussi
On Wed, 2014-12-03 at 07:50 -0800, akuster808 wrote:
 
 On 12/03/2014 05:40 AM, Philip Balister wrote:
  On 11/21/2014 11:07 AM, Tom Zanussi wrote:
  From the original posting:
 
  This patchset fixes a couple serious wic bugs:
 
  [YOCTO #6863] - Wic fails to create a working image for a large file system
  [YOCTO #6290] - Update WIC for gummiboot
 
  I generated core-image-sdk images for each of the wic image types and
  was able to fsck/mount the resulting filesystems.
 
  These should be applied to the next dizzy point release.
 
  The following changes since commit 
  e69653b01dd8ad9fda2355b8112a65c813ce7fd5:
 
 tzdata: update to 2014j (2014-11-17 08:01:21 -0800)
 
  are available in the git repository at:
 
 git://git.yoctoproject.org/poky-contrib.git tzanussi/dizzy-next
 
  http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/dizzy-next
 
  Tom Zanussi (6):
 wic: Don't allow mkfs to fail silently in partition command
 wic: Use overhead factor when creating partitions from rootfs
   directories
 
  It looks like all the patches in this request made it into dizzy, except
  the overhead factor one.
 
 Then its not technically _all_ then ; )
 
 Is there a reason for this?
 No reason. just missed it
 
 Can we get the
  overhead one into dizzy also?
 
 sure.

And while the iron is hot, I'll ask about this one again:

  commit 4c222d3a67bae265ff42b448ef4a643b0131e578 
  Author: He Zhe zhe...@windriver.com
  Date:   Tue Oct 21 17:47:44 2014 +0800

  kernel.bbclass: Create modules directory even if there is no modules
install


 
 - Armin
 
 
  Philip
 
 
 
 
 wic: Update the help text to include -D (--debug)
 Revert wic: set bootimg_dir when using image-name artifacts
 wic: Remove special-case bootimg_dir
 wic: Update bootimg-partition to use bootimg_dir
 
scripts/lib/image/engine.py| 42 
  +-
scripts/lib/image/help.py  | 23 
scripts/lib/wic/imager/direct.py   |  5 +--
.../lib/wic/kickstart/custom_commands/partition.py | 24 +
scripts/lib/wic/plugins/imager/direct_plugin.py| 20 +--
scripts/lib/wic/plugins/source/bootimg-efi.py  |  5 ++-
.../lib/wic/plugins/source/bootimg-partition.py|  9 +++--
scripts/lib/wic/plugins/source/bootimg-pcbios.py   |  3 +-
scripts/lib/wic/utils/oe/misc.py   |  1 +
scripts/wic| 13 +++
10 files changed, 68 insertions(+), 77 deletions(-)
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 00/11] Dizzy next #2

2014-11-26 Thread Tom Zanussi
Hi,

Looks fine to me, but it's still missing this (or were you planning on
adding it to your next round?):

  commit 4c222d3a67bae265ff42b448ef4a643b0131e578 
  Author: He Zhe zhe...@windriver.com
  Date:   Tue Oct 21 17:47:44 2014 +0800

  kernel.bbclass: Create modules directory even if there is no modules
install

Which fixes a problem introduced by:

  commit 3224472c68865714716305dfbc8efaa59f73958e
  Author: Nitin A Kamble nitin.a.kam...@intel.com
  Date:   Tue Sep 30 14:40:05 2014 -0700

  kernel.bbclass: enable a link for external module building

Which I'm now also seeing cause problems with the kernel labs.

Thanks,

Tom 

On Wed, 2014-11-26 at 08:22 -0800, Armin Kuster wrote:
 Please consider these changes for the next Dizzy.
 
 The following changes since commit 85b8abe50482deaa1af62f265e82f53a54bbcd77:
 
   nss: define MP_USE_UINT_DIGIT when compile mpi_x86.s (2014-11-24 16:38:18 
 -0800)
 
 are available in the git repository at:
 
   git://git.yoctoproject.org/poky-contrib akuster/dizzy-next
   http://git.yoctoproject.org/cgit.cgi//log/?h=akuster/dizzy-next
 
 Andrei Gherzan (1):
   xkeyboard-config: Inherit gettext
 
 Aníbal Limón (1):
   package_manager: DpkgPM fix populate_sdk
 
 Javier Viguera (1):
   shadow-securetty: add ttyAM[0-3] serial ports
 
 Robert Yang (1):
   qemu: disable the build for mips
 
 Saul Wold (1):
   babeltrace: Backport fix for unaligned integer
 
 Tom Zanussi (5):
   wic: Don't allow mkfs to fail silently in partition command
   wic: Update the help text to include -D (--debug)
   Revert wic: set bootimg_dir when using image-name artifacts
   wic: Remove special-case bootimg_dir
   wic: Update bootimg-partition to use bootimg_dir
 
 Wenzong Fan (1):
   python: Fix CVE-2014-7185
 
  meta/lib/oe/package_manager.py |   2 +-
  .../python/python/python-2.7.3-CVE-2014-7185.patch |  75 ++
  meta/recipes-devtools/python/python_2.7.3.bb   |   1 +
  meta/recipes-devtools/qemu/qemu_2.1.0.bb   |   1 +
  meta/recipes-devtools/qemu/qemu_git.bb |   1 +
  meta/recipes-extended/shadow/files/securetty   |   4 +
  .../xorg-lib/xkeyboard-config_2.12.bb  |   2 +-
  ...n-t-perform-unaligned-integer-read-writes.patch | 252 
 +
  meta/recipes-kernel/lttng/babeltrace_1.2.1.bb  |   1 +
  scripts/lib/image/engine.py|  42 +---
  scripts/lib/image/help.py  |  23 +-
  scripts/lib/wic/imager/direct.py   |   5 +-
  .../lib/wic/kickstart/custom_commands/partition.py |  22 +-
  scripts/lib/wic/plugins/imager/direct_plugin.py|  20 +-
  scripts/lib/wic/plugins/source/bootimg-efi.py  |   5 +-
  .../lib/wic/plugins/source/bootimg-partition.py|   9 +-
  scripts/lib/wic/plugins/source/bootimg-pcbios.py   |   3 +-
  scripts/wic|  13 +-
  18 files changed, 402 insertions(+), 79 deletions(-)
  create mode 100644 
 meta/recipes-devtools/python/python/python-2.7.3-CVE-2014-7185.patch
  create mode 100644 
 meta/recipes-kernel/lttng/babeltrace/0001-Fix-don-t-perform-unaligned-integer-read-writes.patch
 
 -- 
 1.9.1
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [Patch v2 1/1] kernel.bbclass: enable a link for external module building

2014-11-25 Thread Tom Zanussi
Adding Armin (for dizzy).

On Tue, 2014-11-04 at 22:11 -0500, Bruce Ashfield wrote:
 On 2014-11-04, 6:58 PM, Kamble, Nitin A wrote:
 
 
  -Original Message-
  From: Zanussi, Tom
  Sent: Tuesday, November 04, 2014 3:26 PM
  To: Kamble, Nitin A
  Cc: richard.pur...@linuxfoundation.org; Wold, Saul; Burton, Ross; Ashfield,
  Bruce (Wind River); dvh...@linux.intel.com; Openembedded-
  c...@lists.openembedded.org
  Subject: Re: [OE-core] [Patch v2 1/1] kernel.bbclass: enable a link for 
  external
  module building
 
  On Tue, 2014-09-30 at 14:40 -0700, nitin.a.kam...@intel.com wrote:
  From: Nitin A Kamble nitin.a.kam...@intel.com
 
  Even though the kernel-dev package provides the required support for
  building external kernel modules on the target, some commonly used
  scripts and utilities fail as they are not finding the kernel module
  build support files at the desired location.
 
  Create the /lib/modules/kernel-version/build link on target pointing
  to the sources provided by the kernel-dev package, to fix the issue.
 
  Fixes Bug:
  [YOCTO #2968]
 
 
  I just updated my dizzy branch and am getting this when building a kernel
  with no modules:
 
  Build Configuration:
  BB_VERSION= 1.24.0
  BUILD_SYS = x86_64-linux
  NATIVELSBSTRING   = Fedora-19
  TARGET_SYS= i586-poky-linux-uclibc
  MACHINE   = galileo
  DISTRO= poky-micro
  DISTRO_VERSION= 1.7
  TUNE_FEATURES = m32 i586
  TARGET_FPU= 
  meta
  meta-yocto
  meta-yocto-bsp= dizzy0:64643804aea02e3062a7cde7af236771c56311fd
  meta-intel= dizzy0:002bef4c2a59e95503a2bb7729e7749cd5a9f65b
  meta-micro-galileo = dizzy0:f30310dc84dcd96b9e93bb6e5b531631d57d26d6
 
  NOTE: Preparing runqueue
  NOTE: Executing SetScene Tasks
  NOTE: Executing RunQueue Tasks
  ERROR: Function failed: do_install (log file is located at
  /home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-
  uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-
  r4.1.1/temp/log.do_install.25369)
  ERROR: Logfile of failure stored in: /home/trz/yocto/galileo-
  work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-
  micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-
  r4.1.1/temp/log.do_install.25369
  Log data follows:
  | DEBUG: Executing python function package_get_auto_pr
  | DEBUG: Python function package_get_auto_pr finished
  | DEBUG: Executing shell function do_install
  | NOTE: no modules to install
  | ln: failed to create symbolic link
  | '/home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc
  | /linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-
  r4.1.1/image/
  | lib/modules/3.17.0-rc7-yocto-micro/build': No such file or directory
  | WARNING: /home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-
  linux-uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-
  r4.1.1/temp/run.do_install.25369:1 exit 1 from
  |   ln -sf /usr/src/kernel /home/trz/yocto/galileo-
  work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-
  micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-
  r4.1.1/image/lib/modules/3.17.0-rc7-yocto-micro/build
  | ERROR: Function failed: do_install (log file is located at
  | /home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc/
  | linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-
  r4.1.1/temp/lo
  | g.do_install.25369)
  ERROR: Task 4 (/home/trz/yocto/galileo-work/meta-intel/meta-micro-
  galileo/recipes-kernel/linux/linux-yocto-micro_3.17.bb, do_install) failed
  with exit code '1'
  NOTE: Tasks Summary: Attempted 387 tasks of which 386 didn't need to be
  rerun and 1 failed.
  No currently running tasks (357 of 395)
 
  Summary: 1 task failed:
 /home/trz/yocto/galileo-work/meta-intel/meta-micro-galileo/recipes-
  kernel/linux/linux-yocto-micro_3.17.bb, do_install
  Summary: There was 1 ERROR message shown, returning a non-zero exit
  code.
 
 
  Reverting this patch gets past it.
 
 
 Zhe He sent the same patch on the 21st, I guess it slipped through
 the cracks:
 
 -
 
 [OE-core] [PATCH] kernel.bbclass: Create modules directory even if there 
 is no modules installed
 

Hi Armin,

It doesn't look like this fix ever made it to dizzy.  Could you please
pull this commit into your dizzy-next branch?:

commit 4c222d3a67bae265ff42b448ef4a643b0131e578
Author: He Zhe zhe...@windriver.com
Date:   Tue Oct 21 17:47:44 2014 +0800

kernel.bbclass: Create modules directory even if there is no modules
install
 

Thanks,

Tom

 -
 
 zhe...@windriver.com
 Oct 21
 
 to openembedded-c.
 From: He Zhe zhe...@windriver.com
 
 During kernel_do_install it needs to make symbol link at
 ${D}/lib/modules/${KERNEL_VERSION}/build, but there will not be
 ${D}/lib/modules/${KERNEL_VERSION} if there is no modules installed for 
 current
 image, which will result in a build failure.
 Add mkdir -p ${D}/lib/modules/${KERNEL_VERSION} here to avoid this failure
 and the 

[OE-core] [PATCH 0/6][dizzy] some wic bugfixes

2014-11-21 Thread Tom Zanussi
From the original posting:

This patchset fixes a couple serious wic bugs:

[YOCTO #6863] - Wic fails to create a working image for a large file system
[YOCTO #6290] - Update WIC for gummiboot

I generated core-image-sdk images for each of the wic image types and
was able to fsck/mount the resulting filesystems.

These should be applied to the next dizzy point release.

The following changes since commit e69653b01dd8ad9fda2355b8112a65c813ce7fd5:

  tzdata: update to 2014j (2014-11-17 08:01:21 -0800)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/dizzy-next
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/dizzy-next

Tom Zanussi (6):
  wic: Don't allow mkfs to fail silently in partition command
  wic: Use overhead factor when creating partitions from rootfs
directories
  wic: Update the help text to include -D (--debug)
  Revert wic: set bootimg_dir when using image-name artifacts
  wic: Remove special-case bootimg_dir
  wic: Update bootimg-partition to use bootimg_dir

 scripts/lib/image/engine.py| 42 +-
 scripts/lib/image/help.py  | 23 
 scripts/lib/wic/imager/direct.py   |  5 +--
 .../lib/wic/kickstart/custom_commands/partition.py | 24 +
 scripts/lib/wic/plugins/imager/direct_plugin.py| 20 +--
 scripts/lib/wic/plugins/source/bootimg-efi.py  |  5 ++-
 .../lib/wic/plugins/source/bootimg-partition.py|  9 +++--
 scripts/lib/wic/plugins/source/bootimg-pcbios.py   |  3 +-
 scripts/lib/wic/utils/oe/misc.py   |  1 +
 scripts/wic| 13 +++
 10 files changed, 68 insertions(+), 77 deletions(-)

-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 3/6][dizzy] wic: Update the help text to include -D (--debug)

2014-11-21 Thread Tom Zanussi
The --debug option is missing from the wic help text; this adds it and
at the same time rearranges the usage into a more logical arrangement.

(From OE-Core rev: cf5144ef241d8f4ccaa3461ae5c9f89c2cf2f8d1)

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
Signed-off-by: Richard Purdie richard.pur...@linuxfoundation.org
---
 scripts/lib/image/help.py | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index 080795e..0963532 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -109,8 +109,9 @@ wic_create_usage = 
 
  usage: wic create wks file or image name [-o DIRNAME | --outdir DIRNAME]
 [-i JSON PROPERTY FILE | --infile JSON PROPERTY_FILE]
-[-e | --image-name] [-r, --rootfs-dir] [-b, --bootimg-dir]
-[-k, --kernel-dir] [-n, --native-sysroot] [-s, --skip-build-check]
+[-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+[-r, --rootfs-dir] [-b, --bootimg-dir]
+[-k, --kernel-dir] [-n, --native-sysroot]
 
  This command creates an OpenEmbedded image based on the 'OE kickstart
  commands' found in the wks file.
@@ -129,8 +130,9 @@ NAME
 SYNOPSIS
 wic create wks file or image name [-o DIRNAME | --outdir DIRNAME]
 [-i JSON PROPERTY FILE | --infile JSON PROPERTY_FILE]
-[-e | --image-name] [-r, --rootfs-dir] [-b, --bootimg-dir]
-[-k, --kernel-dir] [-n, --native-sysroot] [-s, --skip-build-check]
+[-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+[-r, --rootfs-dir] [-b, --bootimg-dir]
+[-k, --kernel-dir] [-n, --native-sysroot]
 
 DESCRIPTION
 This command creates an OpenEmbedded image based on the 'OE
@@ -172,6 +174,12 @@ DESCRIPTION
 explicitly, 'wic' assumes the user knows what he or she is doing
 and skips the build check.
 
+The -D option is used to display debug information detailing
+exactly what happens behind the scenes when a create request is
+fulfilled (or not, as the case may be).  It enumerates and
+displays the command sequence used, and should be included in any
+bug report describing unexpected results.
+
 When 'wic -e' is used, the locations for the build artifacts
 values are determined by 'wic -e' from the output of the 'bitbake
 -e' command given an image name e.g. 'core-image-minimal' and a
@@ -519,8 +527,9 @@ DESCRIPTION
 
usage: wic create wks file or image name [-o DIRNAME | ...]
 [-i JSON PROPERTY FILE | --infile JSON PROPERTY_FILE]
-[-e | --image-name] [-r, --rootfs-dir] [-b, --bootimg-dir]
-[-k, --kernel-dir] [-n, --native-sysroot] [-s, --skip-build-check]
+[-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+[-r, --rootfs-dir] [-b, --bootimg-dir]
+[-k, --kernel-dir] [-n, --native-sysroot]
 
This command creates an OpenEmbedded image based on the 'OE
kickstart commands' found in the wks file.
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/6][dizzy] wic: Don't allow mkfs to fail silently in partition command

2014-11-21 Thread Tom Zanussi
The return code from the mkfs command used by the partition creation
command was being ignored, allowing it to silently fail and leaving
users mystified as to why the resulting filesystem was corrupted.

This became obvious when failures occurred when creating large
e.g. sdk filesystems [YOCTO #6863].

(From OE-Core rev: 8cef3b06f7e9f9d922673f430ddb3170d2fac000)

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
Signed-off-by: Richard Purdie richard.pur...@linuxfoundation.org
---
 .../lib/wic/kickstart/custom_commands/partition.py | 22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py 
b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 8b0ace6..3950b43 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -241,8 +241,10 @@ class Wic_PartData(Mic_PartData):
 
 mkfs_cmd = mkfs.%s -F %s %s -d %s % \
 (self.fstype, extra_imagecmd, rootfs, image_rootfs)
-exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
-
+(rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+if rc:
+print rootfs_dir: %s % rootfs_dir
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) when creating 
filesystem from rootfs directory: %s % (self.fstype, rc, rootfs_dir))
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
@@ -284,7 +286,9 @@ class Wic_PartData(Mic_PartData):
 
 mkfs_cmd = mkfs.%s -b %d -r %s %s % \
 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs)
-exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) when creating 
filesystem from rootfs directory: %s % (self.fstype, rc, rootfs_dir))
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
@@ -396,7 +400,9 @@ class Wic_PartData(Mic_PartData):
 extra_imagecmd = -i 8192
 
 mkfs_cmd = mkfs.%s -F %s %s % (self.fstype, extra_imagecmd, fs)
-exec_native_cmd(mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) % (self.fstype, rc))
 
 self.source_file = fs
 
@@ -414,10 +420,14 @@ class Wic_PartData(Mic_PartData):
 exec_cmd(dd_cmd)
 
 mkfs_cmd = mkfs.%s -b %d %s % (self.fstype, self.size * 1024, rootfs)
-exec_native_cmd(mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) % (self.fstype, rc))
 
 mkfs_cmd = mkfs.%s -F %s %s % (self.fstype, extra_imagecmd, fs)
-exec_native_cmd(mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) % (self.fstype, rc))
 
 self.source_file = fs
 
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 6/6][dizzy] wic: Update bootimg-partition to use bootimg_dir

2014-11-21 Thread Tom Zanussi
Update bootimg-partition to use bootimg_dir instead of img_deploy_dir,
to match similar usage in other plugins.

As mentioned elsewhere, plugins should use the passed-in value for
bootimg_dir directly if non-null, which corresponds to a user-assigned
value specified via a -b command-line param, and only fetch the value
from bitbake if that value is null.

(From OE-Core rev: 3822f8a7b33da56ecd9144b4bcae50734fb1af81)

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
Signed-off-by: Richard Purdie richard.pur...@linuxfoundation.org
---
 scripts/lib/wic/plugins/source/bootimg-partition.py | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py 
b/scripts/lib/wic/plugins/source/bootimg-partition.py
index cc72b2f..abf2494 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -71,8 +71,13 @@ class BootimgPartitionPlugin(SourcePlugin):
 install_cmd = install -d %s % hdddir
 exec_cmd(install_cmd)
 
+if not bootimg_dir:
+bootimg_dir = get_bitbake_var(DEPLOY_DIR_IMAGE)
+if not bootimg_dir:
+msger.error(Couldn't find DEPLOY_DIR_IMAGE, exiting\n)
+
 msger.debug('Bootimg dir: %s' % bootimg_dir)
-img_deploy_dir = get_bitbake_var(DEPLOY_DIR_IMAGE)
+
 boot_files = get_bitbake_var(IMAGE_BOOT_FILES)
 
 if not boot_files:
@@ -93,7 +98,7 @@ class BootimgPartitionPlugin(SourcePlugin):
 
 for deploy_entry in deploy_files:
 src, dst = deploy_entry
-src_path = os.path.join(img_deploy_dir, src)
+src_path = os.path.join(bootimg_dir, src)
 dst_path = os.path.join(hdddir, dst)
 
 msger.debug('Install %s as %s' % (os.path.basename(src_path),
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/6][dizzy] wic: Use overhead factor when creating partitions from rootfs directories

2014-11-21 Thread Tom Zanussi
When creating partitions sized to given rootfs directories, filesystem
creation could fail in cases where the calculated target partition
size was too small to contain the filesystem created using mkfs.  This
occurred in particular when creating partitions to contain very large
filesystems such as those containing sdk image artifacts.

This same limition is present in the oe-core image creation classes,
which can be readily see by changing IMAGE_OVERHEAD_FACTOR from the
default 1.3 to 1.0 and building a sato-sdk image.

It should be possible to calculate required sizes exactly given the
source rootfs and target filesystem types, but for now, to address the
specific problem users are hitting in such situations, we'll just do
exactly what oe-core does and define and use an IMAGE_OVERHEAD_FACTOR
or 1.3 in those cases.

Fixes [YOCTO #6863].

(From OE-Core rev: bbaef3ff5833fc1d97b7b028d7770834f62789da)

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
Signed-off-by: Richard Purdie richard.pur...@linuxfoundation.org
---
 scripts/lib/wic/kickstart/custom_commands/partition.py | 2 ++
 scripts/lib/wic/utils/oe/misc.py   | 1 +
 2 files changed, 3 insertions(+)

diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py 
b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 3950b43..54a494e 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -229,6 +229,7 @@ class Wic_PartData(Mic_PartData):
 extra_blocks = IMAGE_EXTRA_SPACE
 
 rootfs_size = actual_rootfs_size + extra_blocks
+rootfs_size *= IMAGE_OVERHEAD_FACTOR
 
 msger.debug(Added %d extra blocks to %s to get to %d total blocks % \
 (extra_blocks, self.mountpoint, rootfs_size))
@@ -276,6 +277,7 @@ class Wic_PartData(Mic_PartData):
 extra_blocks = IMAGE_EXTRA_SPACE
 
 rootfs_size = actual_rootfs_size + extra_blocks
+rootfs_size *= IMAGE_OVERHEAD_FACTOR
 
 msger.debug(Added %d extra blocks to %s to get to %d total blocks % \
 (extra_blocks, self.mountpoint, rootfs_size))
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index aa9b235..b0b5baa 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -123,6 +123,7 @@ def add_wks_var(key, val):
 
 BOOTDD_EXTRA_SPACE = 16384
 IMAGE_EXTRA_SPACE = 10240
+IMAGE_OVERHEAD_FACTOR = 1.3
 
 __bitbake_env_lines = 
 
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 5/6][dizzy] wic: Remove special-case bootimg_dir

2014-11-21 Thread Tom Zanussi
The first iterations of wic very shortsightedly catered to two
specific use-cases and added special-purpose params for those cases so
that they could be directly given their corresponding boot artifacts.
(hdddir and staging_data_dir).

As more use-cases are added, it becomes rather obvious that such a
scheme doens't scale, and additionally causes confusion for plugin
writers.

This removes those special cases and states explicitly in the help
text that plugins are responsible for locating their own boot
artifacts.

(From OE-Core rev: 6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9)

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
Signed-off-by: Richard Purdie richard.pur...@linuxfoundation.org
---
 scripts/lib/image/engine.py  | 37 ++--
 scripts/lib/image/help.py|  2 +-
 scripts/lib/wic/imager/direct.py |  5 +---
 scripts/lib/wic/plugins/imager/direct_plugin.py  | 20 +
 scripts/lib/wic/plugins/source/bootimg-efi.py|  5 ++--
 scripts/lib/wic/plugins/source/bootimg-pcbios.py |  3 +-
 scripts/wic  | 12 
 7 files changed, 27 insertions(+), 57 deletions(-)

diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index f1df8b4..e794545 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -67,7 +67,7 @@ def find_artifacts(image_name):
 
 bitbake_env_lines = get_bitbake_env_lines()
 
-rootfs_dir = kernel_dir = hdddir = staging_data_dir = native_sysroot = 
+rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = 
 
 for line in bitbake_env_lines.split('\n'):
 if (get_line_val(line, IMAGE_ROOTFS)):
@@ -76,17 +76,11 @@ def find_artifacts(image_name):
 if (get_line_val(line, STAGING_KERNEL_DIR)):
 kernel_dir = get_line_val(line, STAGING_KERNEL_DIR)
 continue
-if (get_line_val(line, HDDDIR)):
-hdddir = get_line_val(line, HDDDIR)
-continue
-if (get_line_val(line, STAGING_DATADIR)):
-staging_data_dir = get_line_val(line, STAGING_DATADIR)
-continue
 if (get_line_val(line, STAGING_DIR_NATIVE)):
 native_sysroot = get_line_val(line, STAGING_DIR_NATIVE)
 continue
 
-return (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot)
+return (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot)
 
 
 CANNED_IMAGE_DIR = lib/image/canned-wks # relative to scripts
@@ -185,18 +179,15 @@ def list_source_plugins():
 
 
 def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
-   native_sysroot, hdddir, staging_data_dir, scripts_path,
-   image_output_dir, debug, properties_file, properties=None):
-
-Create image
+   native_sysroot, scripts_path, image_output_dir, debug,
+   properties_file, properties=None):
+Create image
 
 wks_file - user-defined OE kickstart file
 rootfs_dir - absolute path to the build's /rootfs dir
 bootimg_dir - absolute path to the build's boot artifacts directory
 kernel_dir - absolute path to the build's kernel directory
 native_sysroot - absolute path to the build's native sysroots dir
-hdddir - absolute path to the build's HDDDIR dir
-staging_data_dir - absolute path to the build's STAGING_DATA_DIR dir
 scripts_path - absolute path to /scripts dir
 image_output_dir - dirname to create for image
 properties_file - use values from this file if nonempty i.e no prompting
@@ -211,22 +202,14 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, 
kernel_dir,
 rootfs_dir:IMAGE_ROOTFS
 kernel_dir:STAGING_KERNEL_DIR
 native_sysroot:STAGING_DIR_NATIVE
-hdddir:HDDDIR
-staging_data_dir:  STAGING_DATA_DIR
 
-In the above case, bootimg_dir remains unset and the image
-creation code determines which of the passed-in directories to
-use.
+In the above case, bootimg_dir remains unset and the
+plugin-specific image creation code is responsible for finding the
+bootimg artifacts.
 
 In the case where the values are passed in explicitly i.e 'wic -e'
 is not used but rather the individual 'wic' options are used to
-explicitly specify these values, hdddir and staging_data_dir will
-be unset, but bootimg_dir must be explicit i.e. explicitly set to
-either hdddir or staging_data_dir, depending on the image being
-generated.  The other values (rootfs_dir, kernel_dir, and
-native_sysroot) correspond to the same values found above via
-'bitbake -e').
-
+explicitly specify these values.
 
 try:
 oe_builddir = os.environ[BUILDDIR]
@@ -242,8 +225,6 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, 
kernel_dir,
 direct_args.insert(0, bootimg_dir)
 direct_args.insert(0, kernel_dir)
 direct_args.insert(0, native_sysroot

[OE-core] [PATCH 4/6][dizzy] Revert wic: set bootimg_dir when using image-name artifacts

2014-11-21 Thread Tom Zanussi
This reverts commit 7ce1dc13f91df70e8a2f420e7c3eba51cbc4bd48.

This patch broke the assumption that a non-null boot_dir means a
user-assigned (-b command-line param) value.

Reverting doesn't break anything, since the case it was added for
doesn't use the boot_dir for anything except debugging anyhow.

Fixes [YOCTO #6290]

(From OE-Core rev: db90f10bf31dec8d7d7bb2d3680d50e133662850)

Signed-off-by: Richard Purdie richard.pur...@linuxfoundation.org
---
 scripts/lib/image/engine.py | 9 ++---
 scripts/wic | 7 +++
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index 3813fec..f1df8b4 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -67,8 +67,7 @@ def find_artifacts(image_name):
 
 bitbake_env_lines = get_bitbake_env_lines()
 
-rootfs_dir = kernel_dir = bootimg_dir = 
-hdddir = staging_data_dir = native_sysroot = 
+rootfs_dir = kernel_dir = hdddir = staging_data_dir = native_sysroot = 
 
 for line in bitbake_env_lines.split('\n'):
 if (get_line_val(line, IMAGE_ROOTFS)):
@@ -86,12 +85,8 @@ def find_artifacts(image_name):
 if (get_line_val(line, STAGING_DIR_NATIVE)):
 native_sysroot = get_line_val(line, STAGING_DIR_NATIVE)
 continue
-if (get_line_val(line, DEPLOY_DIR_IMAGE)):
-bootimg_dir = get_line_val(line, DEPLOY_DIR_IMAGE)
-continue
 
-return (rootfs_dir, kernel_dir, bootimg_dir, hdddir, staging_data_dir, \
-native_sysroot)
+return (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot)
 
 
 CANNED_IMAGE_DIR = lib/image/canned-wks # relative to scripts
diff --git a/scripts/wic b/scripts/wic
index 7314810..15cc9b3 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -134,8 +134,8 @@ def wic_create_subcommand(args, usage_str):
 bootimg_dir = staging_data_dir = hdddir = 
 
 if options.image_name:
-(rootfs_dir, kernel_dir, bootimg_dir, hdddir, \
- staging_data_dir, native_sysroot) = find_artifacts(options.image_name)
+(rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot) = \
+find_artifacts(options.image_name)
 
 wks_file = args[0]
 
@@ -172,8 +172,7 @@ def wic_create_subcommand(args, usage_str):
 not_found = not_found_dir = 
 if not os.path.isdir(rootfs_dir):
 (not_found, not_found_dir) = (rootfs-dir, rootfs_dir)
-elif not os.path.isdir(bootimg_dir) and not os.path.isdir(hdddir) \
- and not os.path.isdir(staging_data_dir):
+elif not os.path.isdir(hdddir) and not os.path.isdir(staging_data_dir):
 (not_found, not_found_dir) = (bootimg-dir, bootimg_dir)
 elif not os.path.isdir(kernel_dir):
 (not_found, not_found_dir) = (kernel-dir, kernel_dir)
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [Patch v2 1/1] kernel.bbclass: enable a link for external module building

2014-11-04 Thread Tom Zanussi
On Tue, 2014-09-30 at 14:40 -0700, nitin.a.kam...@intel.com wrote:
 From: Nitin A Kamble nitin.a.kam...@intel.com
 
 Even though the kernel-dev package provides the required support for
 building external kernel modules on the target, some commonly used scripts
 and utilities fail as they are not finding the kernel module build support
 files at the desired location.
 
 Create the /lib/modules/kernel-version/build link on target pointing to
 the sources provided by the kernel-dev package, to fix the issue.
 
 Fixes Bug:
 [YOCTO #2968]
 

I just updated my dizzy branch and am getting this when building a
kernel with no modules:

Build Configuration:
BB_VERSION= 1.24.0
BUILD_SYS = x86_64-linux
NATIVELSBSTRING   = Fedora-19
TARGET_SYS= i586-poky-linux-uclibc
MACHINE   = galileo
DISTRO= poky-micro
DISTRO_VERSION= 1.7
TUNE_FEATURES = m32 i586
TARGET_FPU= 
meta  
meta-yocto
meta-yocto-bsp= dizzy0:64643804aea02e3062a7cde7af236771c56311fd
meta-intel= dizzy0:002bef4c2a59e95503a2bb7729e7749cd5a9f65b
meta-micro-galileo = dizzy0:f30310dc84dcd96b9e93bb6e5b531631d57d26d6

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_install (log file is located at 
/home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-r4.1.1/temp/log.do_install.25369)
ERROR: Logfile of failure stored in: 
/home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-r4.1.1/temp/log.do_install.25369
Log data follows:
| DEBUG: Executing python function package_get_auto_pr
| DEBUG: Python function package_get_auto_pr finished
| DEBUG: Executing shell function do_install
| NOTE: no modules to install
| ln: failed to create symbolic link 
'/home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-r4.1.1/image/lib/modules/3.17.0-rc7-yocto-micro/build':
 No such file or directory
| WARNING: 
/home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-r4.1.1/temp/run.do_install.25369:1
 exit 1 from
|   ln -sf /usr/src/kernel 
/home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-r4.1.1/image/lib/modules/3.17.0-rc7-yocto-micro/build
| ERROR: Function failed: do_install (log file is located at 
/home/trz/yocto/galileo-work/build/tmp/work/galileo-poky-linux-uclibc/linux-yocto-micro/3.17+gitAUTOINC+fb21bdc896_522a64f489-r4.1.1/temp/log.do_install.25369)
ERROR: Task 4 
(/home/trz/yocto/galileo-work/meta-intel/meta-micro-galileo/recipes-kernel/linux/linux-yocto-micro_3.17.bb,
 do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 387 tasks of which 386 didn't need to be rerun 
and 1 failed.
No currently running tasks (357 of 395)

Summary: 1 task failed:
  
/home/trz/yocto/galileo-work/meta-intel/meta-micro-galileo/recipes-kernel/linux/linux-yocto-micro_3.17.bb,
 do_install
Summary: There was 1 ERROR message shown, returning a non-zero exit code.


Reverting this patch gets past it.

Tom

 Signed-off-by: Nitin A Kamble nitin.a.kam...@intel.com
 ---
  meta/classes/kernel.bbclass | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
 index 78b33ce..5ac4ff4 100644
 --- a/meta/classes/kernel.bbclass
 +++ b/meta/classes/kernel.bbclass
 @@ -213,6 +213,7 @@ kernel_do_install() {
   #
   kerneldir=${D}${KERNEL_SRC_PATH}
   install -d $kerneldir
 + ln -sf ${KERNEL_SRC_PATH} ${D}/lib/modules/${KERNEL_VERSION}/build
  
   #
   # Store the kernel version in sysroots for module-base.bbclass
 @@ -346,7 +347,7 @@ PACKAGES = kernel kernel-base kernel-vmlinux 
 kernel-image kernel-dev kernel-mod
  FILES_${PN} = 
  FILES_kernel-base = /lib/modules/${KERNEL_VERSION}/modules.order 
 /lib/modules/${KERNEL_VERSION}/modules.builtin
  FILES_kernel-image = /boot/${KERNEL_IMAGETYPE}*
 -FILES_kernel-dev = /boot/System.map* /boot/Module.symvers* /boot/config* 
 ${KERNEL_SRC_PATH}
 +FILES_kernel-dev = /boot/System.map* /boot/Module.symvers* /boot/config* 
 ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build
  FILES_kernel-vmlinux = /boot/vmlinux*
  FILES_kernel-modules = 
  RDEPENDS_kernel = kernel-base
 -- 
 1.8.1.4
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] issues encountered using wic

2014-10-31 Thread Tom Zanussi
Hi,

On Fri, 2014-10-31 at 10:36 -0500, Peter A. Bigot wrote:
 I've started to transition to wic (in master) in hopes it reduces the 
 amount of host passwd contamination resulting from creating SD images by 
 untarring the rootfs onto an SD card.  I've run into the following 
 initial issues:
 
 First, wic requires a populated rootfs, by default in the recipe build 
 directory.  Two issues: (1) this normally removed by rm_work, and (2) 
 bitbake foo-image will not populate that directory if the required 
 artifacts are available from sstate-cache (as happens when you then add 
 foo-image to RM_WORK_EXCLUDE and reinvoke bitbake).
 
 Both could be solved by getting the rootfs contents from an archive 
 created by the image instead of assuming it's unpacked somewhere 
 already.  Requiring IMAGE_FSTYPES to contain tar.bz2 for wic doesn't 
 seem burdensome.  Taking this path also opens up the possibility for wic 
 plug-ins to customize configuration files (such as host keys) in the 
 image rootfs without contaminating a shared resource used by other 
 invocations of wic.
 
 If this seems like a reasonable approach and the wic maintainers would 
 like assistance with it, I'd be happy to put together a patch.
 

It sounds like a nice enhancement, though I'm not sure about the exact
implementation.  As it happens, someone just today asked me to review
some changes to wic that include a 'rootfs building functionality' that
might overlap with this.  Let me take a look at that and get back to
once I've taken a look.

 Second, wic requires IMAGE_BOOT_FILES to be provided (normally in 
 machine.conf, as with meta-yocto-bsp's beaglebone.conf).  I normally use 
 the beaglebone.conf from meta-ti, and found copying the IMAGE_BOOT_FILES 
 setting to that BSP layer didn't work because the reference to 
 ${UBOOT_SUFFIX} remained empty. meta-yocto-bsp's beaglebone.conf defines 
 and uses UBOOT_SUFFIX=img, but this is fragile as the real 
 UBOOT_SUFFIX comes from u-boot.inc (where the default is bin) or some 
 other override.
 
 Is there a way to resolve the potential inconsistency other than 
 hard-coding a specific suffix in machine.conf?  include u-boot.inc in 
 the machine.conf seems like a bad idea.
 

I don't see any way around this, unless you added wildcarding.  Adding
Maciej, who added this capability for uboot and might have some ideas...

Tom 

 Peter


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/6] wic: Don't allow mkfs to fail silently in partition command

2014-10-29 Thread Tom Zanussi
The return code from the mkfs command used by the partition creation
command was being ignored, allowing it to silently fail and leaving
users mystified as to why the resulting filesystem was corrupted.

This became obvious when failures occurred when creating large
e.g. sdk filesystems [YOCTO #6863].

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 .../lib/wic/kickstart/custom_commands/partition.py | 22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py 
b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 8b0ace6..3950b43 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -241,8 +241,10 @@ class Wic_PartData(Mic_PartData):
 
 mkfs_cmd = mkfs.%s -F %s %s -d %s % \
 (self.fstype, extra_imagecmd, rootfs, image_rootfs)
-exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
-
+(rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+if rc:
+print rootfs_dir: %s % rootfs_dir
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) when creating 
filesystem from rootfs directory: %s % (self.fstype, rc, rootfs_dir))
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
@@ -284,7 +286,9 @@ class Wic_PartData(Mic_PartData):
 
 mkfs_cmd = mkfs.%s -b %d -r %s %s % \
 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs)
-exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) when creating 
filesystem from rootfs directory: %s % (self.fstype, rc, rootfs_dir))
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
@@ -396,7 +400,9 @@ class Wic_PartData(Mic_PartData):
 extra_imagecmd = -i 8192
 
 mkfs_cmd = mkfs.%s -F %s %s % (self.fstype, extra_imagecmd, fs)
-exec_native_cmd(mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) % (self.fstype, rc))
 
 self.source_file = fs
 
@@ -414,10 +420,14 @@ class Wic_PartData(Mic_PartData):
 exec_cmd(dd_cmd)
 
 mkfs_cmd = mkfs.%s -b %d %s % (self.fstype, self.size * 1024, rootfs)
-exec_native_cmd(mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) % (self.fstype, rc))
 
 mkfs_cmd = mkfs.%s -F %s %s % (self.fstype, extra_imagecmd, fs)
-exec_native_cmd(mkfs_cmd, native_sysroot)
+(rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
+if rc:
+msger.error(ERROR: mkfs.%s returned '%s' instead of 0 (which you 
probably don't want to ignore, use --debug for details) % (self.fstype, rc))
 
 self.source_file = fs
 
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/6] some wic bugfixes

2014-10-29 Thread Tom Zanussi
This patchset fixes a couple serious wic bugs:

[YOCTO #6863] - Wic fails to create a working image for a large file system
[YOCTO #6290] - Update WIC for gummiboot

I generated core-image-sdk images for each of the wic image types and
was able to fsck/mount the resulting filesystems.

These should be applied to the next dizzy point release.

The following changes since commit cf82c6756bad8f7a5edc92ce513e02816b88efb3:

  bitbake: prserv: don't wait until exit to sync (2014-10-28 15:00:39 +)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-bugfixes-v1
  http://git.yoctoproject.org/cgit.cgi//log/?h=tzanussi/wic-bugfixes-v1

Tom Zanussi (6):
  wic: Don't allow mkfs to fail silently in partition command
  wic: Use overhead factor when creating partitions from rootfs
directories
  wic: Update the help text to include -D (--debug)
  Revert wic: set bootimg_dir when using image-name artifacts
  wic: Remove special-case bootimg_dir
  wic: Update bootimg-partition to use bootimg_dir

 scripts/lib/image/engine.py| 42 +-
 scripts/lib/image/help.py  | 23 
 scripts/lib/wic/imager/direct.py   |  5 +--
 .../lib/wic/kickstart/custom_commands/partition.py | 24 +
 scripts/lib/wic/plugins/imager/direct_plugin.py| 20 +--
 scripts/lib/wic/plugins/source/bootimg-efi.py  |  5 ++-
 .../lib/wic/plugins/source/bootimg-partition.py|  9 +++--
 scripts/lib/wic/plugins/source/bootimg-pcbios.py   |  3 +-
 scripts/lib/wic/utils/oe/misc.py   |  1 +
 scripts/wic| 13 +++
 10 files changed, 68 insertions(+), 77 deletions(-)

-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 5/6] wic: Remove special-case bootimg_dir

2014-10-29 Thread Tom Zanussi
The first iterations of wic very shortsightedly catered to two
specific use-cases and added special-purpose params for those cases so
that they could be directly given their corresponding boot artifacts.
(hdddir and staging_data_dir).

As more use-cases are added, it becomes rather obvious that such a
scheme doens't scale, and additionally causes confusion for plugin
writers.

This removes those special cases and states explicitly in the help
text that plugins are responsible for locating their own boot
artifacts.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/engine.py  | 37 ++--
 scripts/lib/image/help.py|  2 +-
 scripts/lib/wic/imager/direct.py |  5 +---
 scripts/lib/wic/plugins/imager/direct_plugin.py  | 20 +
 scripts/lib/wic/plugins/source/bootimg-efi.py|  5 ++--
 scripts/lib/wic/plugins/source/bootimg-pcbios.py |  3 +-
 scripts/wic  | 12 
 7 files changed, 27 insertions(+), 57 deletions(-)

diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index f1df8b4..e794545 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -67,7 +67,7 @@ def find_artifacts(image_name):
 
 bitbake_env_lines = get_bitbake_env_lines()
 
-rootfs_dir = kernel_dir = hdddir = staging_data_dir = native_sysroot = 
+rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = 
 
 for line in bitbake_env_lines.split('\n'):
 if (get_line_val(line, IMAGE_ROOTFS)):
@@ -76,17 +76,11 @@ def find_artifacts(image_name):
 if (get_line_val(line, STAGING_KERNEL_DIR)):
 kernel_dir = get_line_val(line, STAGING_KERNEL_DIR)
 continue
-if (get_line_val(line, HDDDIR)):
-hdddir = get_line_val(line, HDDDIR)
-continue
-if (get_line_val(line, STAGING_DATADIR)):
-staging_data_dir = get_line_val(line, STAGING_DATADIR)
-continue
 if (get_line_val(line, STAGING_DIR_NATIVE)):
 native_sysroot = get_line_val(line, STAGING_DIR_NATIVE)
 continue
 
-return (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot)
+return (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot)
 
 
 CANNED_IMAGE_DIR = lib/image/canned-wks # relative to scripts
@@ -185,18 +179,15 @@ def list_source_plugins():
 
 
 def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
-   native_sysroot, hdddir, staging_data_dir, scripts_path,
-   image_output_dir, debug, properties_file, properties=None):
-
-Create image
+   native_sysroot, scripts_path, image_output_dir, debug,
+   properties_file, properties=None):
+Create image
 
 wks_file - user-defined OE kickstart file
 rootfs_dir - absolute path to the build's /rootfs dir
 bootimg_dir - absolute path to the build's boot artifacts directory
 kernel_dir - absolute path to the build's kernel directory
 native_sysroot - absolute path to the build's native sysroots dir
-hdddir - absolute path to the build's HDDDIR dir
-staging_data_dir - absolute path to the build's STAGING_DATA_DIR dir
 scripts_path - absolute path to /scripts dir
 image_output_dir - dirname to create for image
 properties_file - use values from this file if nonempty i.e no prompting
@@ -211,22 +202,14 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, 
kernel_dir,
 rootfs_dir:IMAGE_ROOTFS
 kernel_dir:STAGING_KERNEL_DIR
 native_sysroot:STAGING_DIR_NATIVE
-hdddir:HDDDIR
-staging_data_dir:  STAGING_DATA_DIR
 
-In the above case, bootimg_dir remains unset and the image
-creation code determines which of the passed-in directories to
-use.
+In the above case, bootimg_dir remains unset and the
+plugin-specific image creation code is responsible for finding the
+bootimg artifacts.
 
 In the case where the values are passed in explicitly i.e 'wic -e'
 is not used but rather the individual 'wic' options are used to
-explicitly specify these values, hdddir and staging_data_dir will
-be unset, but bootimg_dir must be explicit i.e. explicitly set to
-either hdddir or staging_data_dir, depending on the image being
-generated.  The other values (rootfs_dir, kernel_dir, and
-native_sysroot) correspond to the same values found above via
-'bitbake -e').
-
+explicitly specify these values.
 
 try:
 oe_builddir = os.environ[BUILDDIR]
@@ -242,8 +225,6 @@ def wic_create(args, wks_file, rootfs_dir, bootimg_dir, 
kernel_dir,
 direct_args.insert(0, bootimg_dir)
 direct_args.insert(0, kernel_dir)
 direct_args.insert(0, native_sysroot)
-direct_args.insert(0, hdddir)
-direct_args.insert(0, staging_data_dir)
 direct_args.insert(0, direct)
 
 if debug:
diff

[OE-core] [PATCH 6/6] wic: Update bootimg-partition to use bootimg_dir

2014-10-29 Thread Tom Zanussi
Update bootimg-partition to use bootimg_dir instead of img_deploy_dir,
to match similar usage in other plugins.

As mentioned elsewhere, plugins should use the passed-in value for
bootimg_dir directly if non-null, which corresponds to a user-assigned
value specified via a -b command-line param, and only fetch the value
from bitbake if that value is null.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/plugins/source/bootimg-partition.py | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py 
b/scripts/lib/wic/plugins/source/bootimg-partition.py
index cc72b2f..abf2494 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -71,8 +71,13 @@ class BootimgPartitionPlugin(SourcePlugin):
 install_cmd = install -d %s % hdddir
 exec_cmd(install_cmd)
 
+if not bootimg_dir:
+bootimg_dir = get_bitbake_var(DEPLOY_DIR_IMAGE)
+if not bootimg_dir:
+msger.error(Couldn't find DEPLOY_DIR_IMAGE, exiting\n)
+
 msger.debug('Bootimg dir: %s' % bootimg_dir)
-img_deploy_dir = get_bitbake_var(DEPLOY_DIR_IMAGE)
+
 boot_files = get_bitbake_var(IMAGE_BOOT_FILES)
 
 if not boot_files:
@@ -93,7 +98,7 @@ class BootimgPartitionPlugin(SourcePlugin):
 
 for deploy_entry in deploy_files:
 src, dst = deploy_entry
-src_path = os.path.join(img_deploy_dir, src)
+src_path = os.path.join(bootimg_dir, src)
 dst_path = os.path.join(hdddir, dst)
 
 msger.debug('Install %s as %s' % (os.path.basename(src_path),
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 3/6] wic: Update the help text to include -D (--debug)

2014-10-29 Thread Tom Zanussi
The --debug option is missing from the wic help text; this adds it and
at the same time rearranges the usage into a more logical arrangement.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/help.py | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index 080795e..0963532 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -109,8 +109,9 @@ wic_create_usage = 
 
  usage: wic create wks file or image name [-o DIRNAME | --outdir DIRNAME]
 [-i JSON PROPERTY FILE | --infile JSON PROPERTY_FILE]
-[-e | --image-name] [-r, --rootfs-dir] [-b, --bootimg-dir]
-[-k, --kernel-dir] [-n, --native-sysroot] [-s, --skip-build-check]
+[-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+[-r, --rootfs-dir] [-b, --bootimg-dir]
+[-k, --kernel-dir] [-n, --native-sysroot]
 
  This command creates an OpenEmbedded image based on the 'OE kickstart
  commands' found in the wks file.
@@ -129,8 +130,9 @@ NAME
 SYNOPSIS
 wic create wks file or image name [-o DIRNAME | --outdir DIRNAME]
 [-i JSON PROPERTY FILE | --infile JSON PROPERTY_FILE]
-[-e | --image-name] [-r, --rootfs-dir] [-b, --bootimg-dir]
-[-k, --kernel-dir] [-n, --native-sysroot] [-s, --skip-build-check]
+[-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+[-r, --rootfs-dir] [-b, --bootimg-dir]
+[-k, --kernel-dir] [-n, --native-sysroot]
 
 DESCRIPTION
 This command creates an OpenEmbedded image based on the 'OE
@@ -172,6 +174,12 @@ DESCRIPTION
 explicitly, 'wic' assumes the user knows what he or she is doing
 and skips the build check.
 
+The -D option is used to display debug information detailing
+exactly what happens behind the scenes when a create request is
+fulfilled (or not, as the case may be).  It enumerates and
+displays the command sequence used, and should be included in any
+bug report describing unexpected results.
+
 When 'wic -e' is used, the locations for the build artifacts
 values are determined by 'wic -e' from the output of the 'bitbake
 -e' command given an image name e.g. 'core-image-minimal' and a
@@ -519,8 +527,9 @@ DESCRIPTION
 
usage: wic create wks file or image name [-o DIRNAME | ...]
 [-i JSON PROPERTY FILE | --infile JSON PROPERTY_FILE]
-[-e | --image-name] [-r, --rootfs-dir] [-b, --bootimg-dir]
-[-k, --kernel-dir] [-n, --native-sysroot] [-s, --skip-build-check]
+[-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+[-r, --rootfs-dir] [-b, --bootimg-dir]
+[-k, --kernel-dir] [-n, --native-sysroot]
 
This command creates an OpenEmbedded image based on the 'OE
kickstart commands' found in the wks file.
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 4/6] Revert wic: set bootimg_dir when using image-name artifacts

2014-10-29 Thread Tom Zanussi
This reverts commit 7ce1dc13f91df70e8a2f420e7c3eba51cbc4bd48.

This patch broke the assumption that a non-null boot_dir means a
user-assigned (-b command-line param) value.

Reverting doesn't break anything, since the case it was added for
doesn't use the boot_dir for anything except debugging anyhow.

Fixes [YOCTO #6290]
---
 scripts/lib/image/engine.py | 9 ++---
 scripts/wic | 7 +++
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index 3813fec..f1df8b4 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -67,8 +67,7 @@ def find_artifacts(image_name):
 
 bitbake_env_lines = get_bitbake_env_lines()
 
-rootfs_dir = kernel_dir = bootimg_dir = 
-hdddir = staging_data_dir = native_sysroot = 
+rootfs_dir = kernel_dir = hdddir = staging_data_dir = native_sysroot = 
 
 for line in bitbake_env_lines.split('\n'):
 if (get_line_val(line, IMAGE_ROOTFS)):
@@ -86,12 +85,8 @@ def find_artifacts(image_name):
 if (get_line_val(line, STAGING_DIR_NATIVE)):
 native_sysroot = get_line_val(line, STAGING_DIR_NATIVE)
 continue
-if (get_line_val(line, DEPLOY_DIR_IMAGE)):
-bootimg_dir = get_line_val(line, DEPLOY_DIR_IMAGE)
-continue
 
-return (rootfs_dir, kernel_dir, bootimg_dir, hdddir, staging_data_dir, \
-native_sysroot)
+return (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot)
 
 
 CANNED_IMAGE_DIR = lib/image/canned-wks # relative to scripts
diff --git a/scripts/wic b/scripts/wic
index 7314810..15cc9b3 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -134,8 +134,8 @@ def wic_create_subcommand(args, usage_str):
 bootimg_dir = staging_data_dir = hdddir = 
 
 if options.image_name:
-(rootfs_dir, kernel_dir, bootimg_dir, hdddir, \
- staging_data_dir, native_sysroot) = find_artifacts(options.image_name)
+(rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot) = \
+find_artifacts(options.image_name)
 
 wks_file = args[0]
 
@@ -172,8 +172,7 @@ def wic_create_subcommand(args, usage_str):
 not_found = not_found_dir = 
 if not os.path.isdir(rootfs_dir):
 (not_found, not_found_dir) = (rootfs-dir, rootfs_dir)
-elif not os.path.isdir(bootimg_dir) and not os.path.isdir(hdddir) \
- and not os.path.isdir(staging_data_dir):
+elif not os.path.isdir(hdddir) and not os.path.isdir(staging_data_dir):
 (not_found, not_found_dir) = (bootimg-dir, bootimg_dir)
 elif not os.path.isdir(kernel_dir):
 (not_found, not_found_dir) = (kernel-dir, kernel_dir)
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/6] wic: Use overhead factor when creating partitions from rootfs directories

2014-10-29 Thread Tom Zanussi
When creating partitions sized to given rootfs directories, filesystem
creation could fail in cases where the calculated target partition
size was too small to contain the filesystem created using mkfs.  This
occurred in particular when creating partitions to contain very large
filesystems such as those containing sdk image artifacts.

This same limition is present in the oe-core image creation classes,
which can be readily see by changing IMAGE_OVERHEAD_FACTOR from the
default 1.3 to 1.0 and building a sato-sdk image.

It should be possible to calculate required sizes exactly given the
source rootfs and target filesystem types, but for now, to address the
specific problem users are hitting in such situations, we'll just do
exactly what oe-core does and define and use an IMAGE_OVERHEAD_FACTOR
or 1.3 in those cases.

Fixes [YOCTO #6863].

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/kickstart/custom_commands/partition.py | 2 ++
 scripts/lib/wic/utils/oe/misc.py   | 1 +
 2 files changed, 3 insertions(+)

diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py 
b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 3950b43..54a494e 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -229,6 +229,7 @@ class Wic_PartData(Mic_PartData):
 extra_blocks = IMAGE_EXTRA_SPACE
 
 rootfs_size = actual_rootfs_size + extra_blocks
+rootfs_size *= IMAGE_OVERHEAD_FACTOR
 
 msger.debug(Added %d extra blocks to %s to get to %d total blocks % \
 (extra_blocks, self.mountpoint, rootfs_size))
@@ -276,6 +277,7 @@ class Wic_PartData(Mic_PartData):
 extra_blocks = IMAGE_EXTRA_SPACE
 
 rootfs_size = actual_rootfs_size + extra_blocks
+rootfs_size *= IMAGE_OVERHEAD_FACTOR
 
 msger.debug(Added %d extra blocks to %s to get to %d total blocks % \
 (extra_blocks, self.mountpoint, rootfs_size))
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index aa9b235..b0b5baa 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -123,6 +123,7 @@ def add_wks_var(key, val):
 
 BOOTDD_EXTRA_SPACE = 16384
 IMAGE_EXTRA_SPACE = 10240
+IMAGE_OVERHEAD_FACTOR = 1.3
 
 __bitbake_env_lines = 
 
-- 
1.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [Patch 0/9]: support for generating SD images from wic

2014-09-23 Thread Tom Zanussi
On Mon, 2014-09-22 at 13:35 +0200, Maciej Borzecki wrote:
 This patch series is a proposal that adds support for generating SD
 card images for embedded boards using wic. I did not want to cross
 post to meta-ti and meta-freescale so Denys and Otavio are added in
 CC. I would be glad to receive some feedback from you.
 
 So far, the 2 most common scenarios I've seen are that either the boot
 files need to be located in a specific partition, or the bootloader is
 located within the disk image, typically directly following MBR. The
 series implements support for the first case. The second case should
 be easily supportable on top of this code.
 
 Within the context of boot partition, the proposal adds a new variable
 IMAGE_BOOT_FILES. The variable contains a list of files that need to
 be copied to the boot partition, possibly being renamed during the
 process (example BBB support lists u-boot.img and MLO, analogical
 config can be made up for RsPI). By default the files are picked up
 from DEPLOY_DIR_IMAGE.
 
 Patches 1-4 solve some general problems in wic, so if these go through
 review I'd recommend merging them to master. If that's more convenient
 I can post them again as a separate series.
 
 Patches 5-8 implement IMAGE_BOOT_FILES support, wic source plugin and
 a kickstart for SD card.
 
 Patch 9 adds IMAGE_BOOT_FILES to yocto-bsp BBB config.
 

This is a nice addition and thanks for fixing the smaller problems you
found.

For the whole series:

Acked-by: Tom Zanussi tom.zanu...@intel.com


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/1] wic: remove all urlgrabber references

2014-09-09 Thread Tom Zanussi
This fixes a problem noticed by a user, that urlgrabber was still
being referenced even though it had been removed from the 3rdparty
code.

The following changes since commit a44006262cf3b810ec78b4cccd8076102a7a0f3e:

  distro/poky: Add Debian 7.5 and 7.6 version as validated (2014-09-03 16:00:29 
+0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-urlgrabber-fixes-2
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-urlgrabber-fixes-2

Tom Zanussi (1):
  wic: Completely remove all urlgrabber references

 scripts/lib/wic/3rdparty/pykickstart/parser.py  | 87 +
 scripts/lib/wic/3rdparty/pykickstart/version.py | 29 -
 2 files changed, 2 insertions(+), 114 deletions(-)

-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/1] wic: Completely remove all urlgrabber references

2014-09-09 Thread Tom Zanussi
The previous commit, 'wic: Remove 3rdparty/urlgrabber' didn't actually
remove all references to urlgrabber - this does however.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/3rdparty/pykickstart/parser.py  | 87 +
 scripts/lib/wic/3rdparty/pykickstart/version.py | 29 -
 2 files changed, 2 insertions(+), 114 deletions(-)

diff --git a/scripts/lib/wic/3rdparty/pykickstart/parser.py 
b/scripts/lib/wic/3rdparty/pykickstart/parser.py
index 840a448..9c9674b 100644
--- a/scripts/lib/wic/3rdparty/pykickstart/parser.py
+++ b/scripts/lib/wic/3rdparty/pykickstart/parser.py
@@ -38,8 +38,6 @@ import sys
 import tempfile
 from copy import copy
 from optparse import *
-from urlgrabber import urlread
-import urlgrabber.grabber as grabber
 
 import constants
 from errors import KickstartError, KickstartParseError, KickstartValueError, 
formatErrorMsg
@@ -55,87 +53,6 @@ STATE_COMMANDS = commands
 
 ver = version.DEVEL
 
-def _preprocessStateMachine (lineIter):
-l = None
-lineno = 0
-
-# Now open an output kickstart file that we are going to write to one
-# line at a time.
-(outF, outName) = tempfile.mkstemp(-ks.cfg, , /tmp)
-
-while True:
-try:
-l = lineIter.next()
-except StopIteration:
-break
-
-# At the end of the file?
-if l == :
-break
-
-lineno += 1
-url = None
-
-ll = l.strip()
-if not ll.startswith(%ksappend):
-os.write(outF, l)
-continue
-
-# Try to pull down the remote file.
-try:
-ksurl = ll.split(' ')[1]
-except:
-raise KickstartParseError, formatErrorMsg(lineno, msg=_(Illegal 
url for %%ksappend: %s) % ll)
-
-try:
-url = grabber.urlopen(ksurl)
-except grabber.URLGrabError, e:
-raise KickstartError, formatErrorMsg(lineno, msg=_(Unable to open 
%%ksappend file: %s) % e.strerror)
-else:
-# Sanity check result.  Sometimes FTP doesn't catch a file
-# is missing.
-try:
-if url.size  1:
-raise KickstartError, formatErrorMsg(lineno, msg=_(Unable 
to open %%ksappend file))
-except:
-raise KickstartError, formatErrorMsg(lineno, msg=_(Unable to 
open %%ksappend file))
-
-# If that worked, write the remote file to the output kickstart
-# file in one burst.  Then close everything up to get ready to
-# read ahead in the input file.  This allows multiple %ksappend
-# lines to exist.
-if url is not None:
-os.write(outF, url.read())
-url.close()
-
-# All done - close the temp file and return its location.
-os.close(outF)
-return outName
-
-def preprocessFromString (s):
-Preprocess the kickstart file, provided as the string str.  This
-method is currently only useful for handling %ksappend lines,
-which need to be fetched before the real kickstart parser can be
-run.  Returns the location of the complete kickstart file.
-
-i = iter(s.splitlines(True) + [])
-rc = _preprocessStateMachine (i.next)
-return rc
-
-def preprocessKickstart (f):
-Preprocess the kickstart file, given by the filename file.  This
-method is currently only useful for handling %ksappend lines,
-which need to be fetched before the real kickstart parser can be
-run.  Returns the location of the complete kickstart file.
-
-try:
-fh = urlopen(f)
-except grabber.URLGrabError, e:
-raise KickstartError, formatErrorMsg(0, msg=_(Unable to open input 
kickstart file: %s) % e.strerror)
-
-rc = _preprocessStateMachine (iter(fh.readlines()))
-fh.close()
-return rc
 
 class PutBackIterator(Iterator):
 def __init__(self, iterable):
@@ -682,8 +599,8 @@ class KickstartParser:
 self.currentdir[self._includeDepth] = cd
 
 try:
-s = urlread(f)
-except grabber.URLGrabError, e:
+s = file(f).read()
+except IOError, e:
 raise KickstartError, formatErrorMsg(0, msg=_(Unable to open 
input kickstart file: %s) % e.strerror)
 
 self.readKickstartFromString(s, reset=False)
diff --git a/scripts/lib/wic/3rdparty/pykickstart/version.py 
b/scripts/lib/wic/3rdparty/pykickstart/version.py
index 102cc37..8a8e6aa 100644
--- a/scripts/lib/wic/3rdparty/pykickstart/version.py
+++ b/scripts/lib/wic/3rdparty/pykickstart/version.py
@@ -44,7 +44,6 @@ This module also exports several functions:
   have a version= comment in it.
 
 import imputil, re, sys
-from urlgrabber import urlopen
 
 import gettext
 _ = lambda x: gettext.ldgettext(pykickstart, x)
@@ -132,34 +131,6 @@ def versionToString(version, skipDevel=False):
 
 raise KickstartVersionError(_(Unsupported version specified: %s) % 
version)
 
-def versionFromFile

Re: [OE-core] [PATCH 15/35] wic: Remove 3rdparty/urlgrabber

2014-09-09 Thread Tom Zanussi
On Tue, 2014-09-09 at 13:48 +0200, Ola X Nilsson wrote:
 This commit breaks wic for me. 
 Urlgrabber is imported from pykickstart/version.py and pykickstart/parser.py.
 
 Having python-urlgrabber installed in your distro hides this problem.
 

Thanks for the report - I just posted a patch to fix this to the list -
please try it out.

Thanks,

Tom

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/7] wic: Add gummiboot support

2014-08-11 Thread Tom Zanussi
This add gummiboot support to wic.  It also adds a new --sourceparams
variable to the partition command, allowing plugins to be
parameterized.  The BootImgEFIPlugin makes use of it to support
multiple loaders.

The following changes since commit 0f24d9c569db733b4f63803ee4a9c12ec1789791:

  SIGGEN_EXCLUDERECIPES_ABISAFE: add initscripts (2014-08-11 17:44:12 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-gummiboot-v1
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-gummiboot-v1

Tom Zanussi (7):
  wic: Add '--sourceparams' partition option
  wic: Add utility function for parsing sourceparams
  wic: Add sourceparam param to partition plugin methods
  wic: Parse and pass sourceparams to partition plugin methods
  wic: Add gummiboot support to bootimg-efi
  wic: Add sourceparams to mkefidisk.wks
  wic: Add mkgummidisk kickstart file

 scripts/lib/image/canned-wks/mkefidisk.wks |   2 +-
 scripts/lib/image/canned-wks/mkgummidisk.wks   |  11 ++
 .../lib/wic/kickstart/custom_commands/partition.py |  20 +++-
 scripts/lib/wic/pluginbase.py  |  15 +--
 scripts/lib/wic/plugins/source/bootimg-efi.py  | 117 +
 scripts/lib/wic/plugins/source/bootimg-pcbios.py   |  10 +-
 scripts/lib/wic/plugins/source/rootfs.py   |   5 +-
 scripts/lib/wic/utils/oe/misc.py   |  23 
 8 files changed, 164 insertions(+), 39 deletions(-)
 create mode 100644 scripts/lib/image/canned-wks/mkgummidisk.wks

-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 6/7] wic: Add sourceparams to mkefidisk.wks

2014-08-11 Thread Tom Zanussi
The bootimg-efi plugin now requires a loader param, so supply it to
retain existing behavior.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/canned-wks/mkefidisk.wks | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/image/canned-wks/mkefidisk.wks 
b/scripts/lib/image/canned-wks/mkefidisk.wks
index db86caa..58d42e6 100644
--- a/scripts/lib/image/canned-wks/mkefidisk.wks
+++ b/scripts/lib/image/canned-wks/mkefidisk.wks
@@ -2,7 +2,7 @@
 # long-description: Creates a partitioned EFI disk image that the user
 # can directly dd to boot media.
 
-part /boot --source bootimg-efi --ondisk sda --label msdos --active --align 
1024
+part /boot --source bootimg-efi --sourceparams=loader=grub-efi --ondisk sda 
--label msdos --active --align 1024
 
 part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024
 
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 4/7] wic: Parse and pass sourceparams to partition plugin methods

2014-08-11 Thread Tom Zanussi
Add code to parse the sourceparams and pass them to the partition
plugin methods.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/kickstart/custom_commands/partition.py | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py 
b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 76cf7a9..a3d5ef3 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -126,6 +126,11 @@ class Wic_PartData(Mic_PartData):
 Prepare content for individual partitions, depending on
 partition command parameters.
 
+self.sourceparams_dict = {}
+
+if self.sourceparams:
+self.sourceparams_dict = parse_sourceparams(self.sourceparams)
+
 if not self.source:
 if not self.size:
 msger.error(The %s partition has a size of zero.  Please 
specify a non-zero --size for that partition. % self.mountpoint)
@@ -143,16 +148,19 @@ class Wic_PartData(Mic_PartData):
 msger.error(The '%s' --source specified for %s doesn't 
exist.\n\tSee 'wic list source-plugins' for a list of available 
--sources.\n\tSee 'wic help source-plugins' for details on adding a new source 
plugin. % (self.source, self.mountpoint))
 
 self._source_methods = 
pluginmgr.get_source_plugin_methods(self.source, partition_methods)
-self._source_methods[do_configure_partition](self, None, cr, 
cr_workdir,
+self._source_methods[do_configure_partition](self, 
self.sourceparams_dict,
+   cr, cr_workdir,
oe_builddir,
bootimg_dir,
kernel_dir,
native_sysroot)
-self._source_methods[do_stage_partition](self, None, cr, cr_workdir,
+self._source_methods[do_stage_partition](self, 
self.sourceparams_dict,
+   cr, cr_workdir,
oe_builddir,
bootimg_dir, kernel_dir,
native_sysroot)
-self._source_methods[do_prepare_partition](self, None, cr, 
cr_workdir,
+self._source_methods[do_prepare_partition](self, 
self.sourceparams_dict,
+ cr, cr_workdir,
  oe_builddir,
  bootimg_dir, kernel_dir, 
rootfs_dir,
  native_sysroot)
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/7] wic: Add '--sourceparams' partition option

2014-08-11 Thread Tom Zanussi
To go along with '--source' as a way to parameterize source plugins.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/kickstart/custom_commands/partition.py | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py 
b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 24f523a..3920adb 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -47,6 +47,7 @@ class Wic_PartData(Mic_PartData):
 Mic_PartData.__init__(self, *args, **kwargs)
 self.deleteRemovedAttrs()
 self.source = kwargs.get(source, None)
+self.sourceparams = kwargs.get(sourceparams, None)
 self.rootfs = kwargs.get(rootfs-dir, None)
 self.source_file = 
 self.size = 0
@@ -56,6 +57,8 @@ class Wic_PartData(Mic_PartData):
 
 if self.source:
 retval +=  --source=%s % self.source
+if self.sourceparams:
+retval +=  --sourceparams=%s % self.sourceparams
 if self.rootfs:
 retval +=  --rootfs-dir=%s % self.rootfs
 
@@ -490,6 +493,9 @@ class Wic_Partition(Mic_Partition):
 # and calculate partition size
 op.add_option(--source, type=string, action=store,
   dest=source, default=None)
+# comma-separated list of param=value pairs
+op.add_option(--sourceparams, type=string, action=store,
+  dest=sourceparams, default=None)
 # use specified rootfs path to fill the partition
 op.add_option(--rootfs-dir, type=string, action=store,
   dest=rootfs, default=None)
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/7] wic: Add utility function for parsing sourceparams

2014-08-11 Thread Tom Zanussi
Parses strings of the form key1=val1[,key2=val2,...] and returns a
dict.  Also accepts valueless keys i.e. without =.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/utils/oe/misc.py | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index 87e3041..aa9b235 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -179,3 +179,26 @@ def get_bitbake_var(key):
 val = get_line_val(line, key)
 return val
 return None
+
+def parse_sourceparams(sourceparams):
+
+Split sourceparams string of the form key1=val1[,key2=val2,...]
+into a dict.  Also accepts valueless keys i.e. without =.
+
+Returns dict of param key/val pairs (note that val may be None).
+
+params_dict = {}
+
+params = sourceparams.split(',')
+if params:
+for p in params:
+if not p:
+continue
+if not '=' in p:
+key = p
+val = None
+else:
+key, val = p.split('=')
+params_dict[key] = val
+
+return params_dict
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 5/7] wic: Add gummiboot support to bootimg-efi

2014-08-11 Thread Tom Zanussi
Add gummiboot support to bootimg-efi, which retains the existing
grub-efi support (though requires an update to the .wks file).

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 113 +-
 1 file changed, 91 insertions(+), 22 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py 
b/scripts/lib/wic/plugins/source/bootimg-efi.py
index ea94fd2..855bbc2 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -42,19 +42,10 @@ class BootimgEFIPlugin(SourcePlugin):
 name = 'bootimg-efi'
 
 @classmethod
-def do_configure_partition(self, source_params, part, cr, cr_workdir,
-   oe_builddir, bootimg_dir, kernel_dir,
-   native_sysroot):
+def do_configure_grubefi(self, hdddir, cr, cr_workdir):
 
-Called before do_prepare_partition(), creates grubefi config
+Create loader-specific (grub-efi) config
 
-hdddir = %s/hdd/boot % cr_workdir
-rm_cmd = rm -rf %s % cr_workdir
-exec_cmd(rm_cmd)
-
-install_cmd = install -d %s/EFI/BOOT % hdddir
-exec_cmd(install_cmd)
-
 splash = os.path.join(cr_workdir, /EFI/boot/splash.jpg)
 if os.path.exists(splash):
 splashline = menu background splash.jpg
@@ -73,7 +64,7 @@ class BootimgEFIPlugin(SourcePlugin):
 grubefi_conf += timeout=%s\n % timeout
 grubefi_conf += menuentry 'boot'{\n
 
-kernel = /vmlinuz
+kernel = /bzImage
 
 if cr._ptable_format == 'msdos':
 rootstr = rootdev
@@ -93,6 +84,79 @@ class BootimgEFIPlugin(SourcePlugin):
 cfg.close()
 
 @classmethod
+def do_configure_gummiboot(self, hdddir, cr, cr_workdir):
+
+Create loader-specific (gummiboot) config
+
+install_cmd = install -d %s/loader % hdddir
+exec_cmd(install_cmd)
+
+install_cmd = install -d %s/loader/entries % hdddir
+exec_cmd(install_cmd)
+
+(rootdev, root_part_uuid) = cr._get_boot_config()
+options = cr.ks.handler.bootloader.appendLine
+
+timeout = kickstart.get_timeout(cr.ks)
+if not timeout:
+timeout = 0
+
+loader_conf = 
+loader_conf += default boot\n
+loader_conf += timeout %d\n % timeout
+
+msger.debug(Writing gummiboot config %s/hdd/boot/loader/loader.conf \
+% cr_workdir)
+cfg = open(%s/hdd/boot/loader/loader.conf % cr_workdir, w)
+cfg.write(loader_conf)
+cfg.close()
+
+kernel = /bzImage
+
+if cr._ptable_format == 'msdos':
+rootstr = rootdev
+else:
+raise ImageError(Unsupported partition table format found)
+
+boot_conf = 
+boot_conf += title boot\n
+boot_conf += linux %s\n % kernel
+boot_conf += options LABEL=Boot root=%s %s\n \
+% (rootstr, options)
+
+msger.debug(Writing gummiboot config 
%s/hdd/boot/loader/entries/boot.conf \
+% cr_workdir)
+cfg = open(%s/hdd/boot/loader/entries/boot.conf % cr_workdir, w)
+cfg.write(boot_conf)
+cfg.close()
+
+
+@classmethod
+def do_configure_partition(self, part, source_params, cr, cr_workdir,
+   oe_builddir, bootimg_dir, kernel_dir,
+   native_sysroot):
+
+Called before do_prepare_partition(), creates loader-specific config
+
+hdddir = %s/hdd/boot % cr_workdir
+rm_cmd = rm -rf %s % cr_workdir
+exec_cmd(rm_cmd)
+
+install_cmd = install -d %s/EFI/BOOT % hdddir
+exec_cmd(install_cmd)
+
+try:
+if source_params['loader'] == 'grub-efi':
+self.do_configure_grubefi(hdddir, cr, cr_workdir)
+elif source_params['loader'] == 'gummiboot':
+self.do_configure_gummiboot(hdddir, cr, cr_workdir)
+else:
+msger.error(unrecognized bootimg-efi loader: %s % 
source_params['loader'])
+except KeyError:
+msger.error(bootimg-efi requires a loader, none specified)
+
+
+@classmethod
 def do_prepare_partition(self, part, source_params, cr, cr_workdir,
  oe_builddir, bootimg_dir, kernel_dir,
  rootfs_dir, native_sysroot):
@@ -117,14 +181,21 @@ class BootimgEFIPlugin(SourcePlugin):
 (staging_kernel_dir, hdddir)
 exec_cmd(install_cmd)
 
-shutil.copyfile(%s/hdd/boot/EFI/BOOT/grub.cfg % cr_workdir,
-%s/grub.cfg % cr_workdir)
-
-cp_cmd = cp %s/EFI/BOOT/* %s/EFI/BOOT % (staging_data_dir, hdddir)
-exec_cmd(cp_cmd, True)
-
-shutil.move(%s/grub.cfg % cr_workdir,
-%s/hdd/boot/EFI/BOOT/grub.cfg % cr_workdir

[OE-core] [PATCH 7/7] wic: Add mkgummidisk kickstart file

2014-08-11 Thread Tom Zanussi
This is the same as mkefidisk but uses gummiboot instead of grub-efi.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/canned-wks/mkgummidisk.wks | 11 +++
 1 file changed, 11 insertions(+)
 create mode 100644 scripts/lib/image/canned-wks/mkgummidisk.wks

diff --git a/scripts/lib/image/canned-wks/mkgummidisk.wks 
b/scripts/lib/image/canned-wks/mkgummidisk.wks
new file mode 100644
index 000..f81cbdf
--- /dev/null
+++ b/scripts/lib/image/canned-wks/mkgummidisk.wks
@@ -0,0 +1,11 @@
+# short-description: Create an EFI disk image
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media.
+
+part /boot --source bootimg-efi --sourceparams=loader=gummiboot --ondisk sda 
--label msdos --active --align 1024
+
+part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader  --timeout=10  --append=rootwait rootfstype=ext3 
console=ttyPCH0,115200 console=tty0 vmalloc=256MB snd-hda-intel.enable_msi=0
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 3/7] wic: Add sourceparam param to partition plugin methods

2014-08-11 Thread Tom Zanussi
The sourceparam param allows source plugins to be parameterized
generically (via --sourceparams=key=val[,key=val], implemented
previously).

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/kickstart/custom_commands/partition.py |  6 +++---
 scripts/lib/wic/pluginbase.py  | 15 +--
 scripts/lib/wic/plugins/source/bootimg-efi.py  | 10 ++
 scripts/lib/wic/plugins/source/bootimg-pcbios.py   | 10 ++
 scripts/lib/wic/plugins/source/rootfs.py   |  5 +++--
 5 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py 
b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 3920adb..76cf7a9 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -143,16 +143,16 @@ class Wic_PartData(Mic_PartData):
 msger.error(The '%s' --source specified for %s doesn't 
exist.\n\tSee 'wic list source-plugins' for a list of available 
--sources.\n\tSee 'wic help source-plugins' for details on adding a new source 
plugin. % (self.source, self.mountpoint))
 
 self._source_methods = 
pluginmgr.get_source_plugin_methods(self.source, partition_methods)
-self._source_methods[do_configure_partition](self, cr, cr_workdir,
+self._source_methods[do_configure_partition](self, None, cr, 
cr_workdir,
oe_builddir,
bootimg_dir,
kernel_dir,
native_sysroot)
-self._source_methods[do_stage_partition](self, cr, cr_workdir,
+self._source_methods[do_stage_partition](self, None, cr, cr_workdir,
oe_builddir,
bootimg_dir, kernel_dir,
native_sysroot)
-self._source_methods[do_prepare_partition](self, cr, cr_workdir,
+self._source_methods[do_prepare_partition](self, None, cr, 
cr_workdir,
  oe_builddir,
  bootimg_dir, kernel_dir, 
rootfs_dir,
  native_sysroot)
diff --git a/scripts/lib/wic/pluginbase.py b/scripts/lib/wic/pluginbase.py
index 06f318f..b8b3a46 100644
--- a/scripts/lib/wic/pluginbase.py
+++ b/scripts/lib/wic/pluginbase.py
@@ -64,8 +64,9 @@ class SourcePlugin(_Plugin):
 msger.debug(SourcePlugin: do_install_disk: disk: %s % disk_name)
 
 @classmethod
-def do_stage_partition(self, part, cr, workdir, oe_builddir, bootimg_dir,
-   kernel_dir, native_sysroot):
+def do_stage_partition(self, part, source_params, cr, cr_workdir,
+   oe_builddir, bootimg_dir, kernel_dir,
+   native_sysroot):
 
 Special content staging hook called before do_prepare_partition(),
 normally empty.
@@ -80,8 +81,9 @@ class SourcePlugin(_Plugin):
 msger.debug(SourcePlugin: do_stage_partition: part: %s % part)
 
 @classmethod
-def do_configure_partition(self, part, cr, cr_workdir, oe_builddir,
-   bootimg_dir, kernel_dir, native_sysroot):
+def do_configure_partition(self, part, source_params, cr, cr_workdir,
+   oe_builddir, bootimg_dir, kernel_dir,
+   native_sysroot):
 
 Called before do_prepare_partition(), typically used to create
 custom configuration files for a partition, for example
@@ -90,8 +92,9 @@ class SourcePlugin(_Plugin):
 msger.debug(SourcePlugin: do_configure_partition: part: %s % part)
 
 @classmethod
-def do_prepare_partition(self, part, cr, cr_workdir, oe_builddir, 
bootimg_dir,
- kernel_dir, rootfs_dir, native_sysroot):
+def do_prepare_partition(self, part, source_params, cr, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir, rootfs_dir,
+ native_sysroot):
 
 Called to do the actual content population for a partition i.e. it
 'prepares' the partition to be incorporated into the image.
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py 
b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 53f1782..ea94fd2 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -42,8 +42,9 @@ class BootimgEFIPlugin(SourcePlugin):
 name = 'bootimg-efi'
 
 @classmethod
-def do_configure_partition(self, part, cr, cr_workdir, oe_builddir,
-   bootimg_dir, kernel_dir

[OE-core] [PATCH 10/35] wic: Remove grabber implementation

2014-08-08 Thread Tom Zanussi
wic doesn't need to grab any urls, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/grabber.py | 97 
 1 file changed, 97 deletions(-)
 delete mode 100644 scripts/lib/mic/utils/grabber.py

diff --git a/scripts/lib/mic/utils/grabber.py b/scripts/lib/mic/utils/grabber.py
deleted file mode 100644
index 45e30b4..000
--- a/scripts/lib/mic/utils/grabber.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/python
-
-import os
-import sys
-import rpm
-import fcntl
-import struct
-import termios
-
-from mic import msger
-from mic.utils import runner
-from mic.utils.errors import CreatorError
-
-from urlgrabber import grabber
-from urlgrabber import __version__ as grabber_version
-
-if rpm.labelCompare(grabber_version.split('.'), '3.9.0'.split('.')) == -1:
-msger.warning(Version of python-urlgrabber is %s, lower than '3.9.0', 
-  you may encounter some network issues % grabber_version)
-
-def myurlgrab(url, filename, proxies, progress_obj = None):
-g = grabber.URLGrabber()
-if progress_obj is None:
-progress_obj = TextProgress()
-
-if url.startswith(file:/):
-filepath = /%s % url.replace(file:, ).lstrip('/')
-if not os.path.exists(filepath):
-raise CreatorError(URLGrabber error: can't find file %s % url)
-if url.endswith('.rpm'):
-return filepath
-else:
-# untouch repometadata in source path
-runner.show(['cp', '-f', filepath, filename])
-
-else:
-try:
-filename = g.urlgrab(url=str(url),
- filename=filename,
- ssl_verify_host=False,
- ssl_verify_peer=False,
- proxies=proxies,
- http_headers=(('Pragma', 'no-cache'),),
- quote=0,
- progress_obj=progress_obj)
-except grabber.URLGrabError, err:
-msg = str(err)
-if msg.find(url)  0:
-msg += ' on %s' % url
-raise CreatorError(msg)
-
-return filename
-
-def terminal_width(fd=1):
- Get the real terminal width 
-try:
-buf = 'abcdefgh'
-buf = fcntl.ioctl(fd, termios.TIOCGWINSZ, buf)
-return struct.unpack('', buf)[1]
-except: # IOError
-return 80
-
-def truncate_url(url, width):
-return os.path.basename(url)[0:width]
-
-class TextProgress(object):
-# make the class as singleton
-_instance = None
-def __new__(cls, *args, **kwargs):
-if not cls._instance:
-cls._instance = super(TextProgress, cls).__new__(cls, *args, 
**kwargs)
-
-return cls._instance
-
-def __init__(self, totalnum = None):
-self.total = totalnum
-self.counter = 1
-
-def start(self, filename, url, *args, **kwargs):
-self.url = url
-self.termwidth = terminal_width()
-msger.info(\r%-*s % (self.termwidth,  ))
-if self.total is None:
-msger.info(\rRetrieving %s ... % truncate_url(self.url, 
self.termwidth - 15))
-else:
-msger.info(\rRetrieving %s [%d/%d] ... % (truncate_url(self.url, 
self.termwidth - 25), self.counter, self.total))
-
-def update(self, *args):
-pass
-
-def end(self, *args):
-if self.counter == self.total:
-msger.raw(\n)
-
-if self.total is not None:
-self.counter += 1
-
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 07/35] wic: Remove mic package managers

2014-08-08 Thread Tom Zanussi
wic doesn't use the yum or zypp package managers, remove them.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/plugins/backend/yumpkgmgr.py  | 490 -
 scripts/lib/mic/plugins/backend/zypppkgmgr.py | 973 --
 2 files changed, 1463 deletions(-)
 delete mode 100644 scripts/lib/mic/plugins/backend/yumpkgmgr.py
 delete mode 100755 scripts/lib/mic/plugins/backend/zypppkgmgr.py

Patch too large to post - see git repository.

-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 00/35] wic: diet and refactor

2014-08-08 Thread Tom Zanussi
This patchset refactors wic to have the code better reflect what it
actually does, rather than look like something shoehorned into the
existing mic codebase, which is essentially what it was.

It also removes most of code inherited from mic but sitting
essentially unused; there's no reason to be carrying it around other
than some vague intention of reusing it, but that can still be done -
anything needed can always be added back.  As it stands, it's only
taking up space and obscuring a clear view of what's actually used.

Removing the bsp subdir from scripts/lib, and taking a size
measurement using 'du -bh lib', we get:

before:
  1.2M  lib

after:
  385K  lib

About half the code remaining after this exercise belongs to the
parser and related infrastructure, which could be drop-in replaced by
something lighter:

116Klib/wic/3rdparty
7.9Klib/wic/msger.py
3.2Klib/wic/conf.py
3.1Klib/wic/utils/runner.py
57K lib/wic/utils/cmdln.py
1.6Klib/wic/utils/errors.py

And about 50k of it is wic command boilerplate and help text patterned
after other tools in yocto such as yocto-bsp:

52K lib/image

That leaves about 150k related to the actual image creation
infrastructure, which should be much more easily digestible than the
previous code.

[NOTE: this patchset supersedes the 'phase1' patchset ('[PATCH 00/24]
wic: Remove unused code') from Aug 5.]

The following changes since commit 4a226369b7bb37a971c77d4abc88df81033f56c5:

  dev-manual: Updates for checksums and wic (2014-08-02 10:00:26 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-diet-v1
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-diet-v1

Tom Zanussi (35):
  wic: Make exec_cmd() error out instead of warn
  wic: Remove unused custom commands
  wic: Remove packaging, config commands
  wic: Remove mic bootstrap
  wic: Remove mic chroot
  wic: Remove rt_util
  wic: Remove mic package managers
  wic: Remove bmap support
  wic: Remove fiemap support
  wic: Remove grabber implementation
  wic: Remove proxy support
  wic: Remove rpmmisc
  wic: Remove unused fs_related code
  wic: Remove unused misc code
  wic: Remove 3rdparty/urlgrabber
  wic: Remove unused 3rdparty/commands
  wic: Remove gpt_parser
  wic: Remove unused plugin and error code
  wic: Clean up BaseImageCreator
  wic: Clean up DirectImageCreator
  wic: Clean up PartitionedMount
  wic: Clean up Creator
  wic: Remove unused command versioning support
  wic: Update 'Background and Motivation' help section
  wic: Remove unused conf support
  wic: Remove Mount object
  wic: Update/rename/delete mount-related code
  wic: Update cleanup/unmount-related code
  wic: Update/rename install-related code
  wic: Update/rename configure-related code
  wic: Rename PartitionedMount
  wic: Rename MountError
  wic: Update Disk description
  wic: Rename /mic to /wic
  wic: Bump the version to 2.0

 scripts/lib/image/config/wic.conf  |1 -
 scripts/lib/image/engine.py|   12 +-
 scripts/lib/image/help.py  |   22 +-
 .../mic/3rdparty/pykickstart/commands/__init__.py  |   26 -
 .../3rdparty/pykickstart/commands/authconfig.py|   40 -
 .../mic/3rdparty/pykickstart/commands/autopart.py  |  119 --
 .../mic/3rdparty/pykickstart/commands/autostep.py  |   55 -
 .../mic/3rdparty/pykickstart/commands/clearpart.py |   86 --
 .../mic/3rdparty/pykickstart/commands/device.py|  125 --
 .../3rdparty/pykickstart/commands/deviceprobe.py   |   40 -
 .../3rdparty/pykickstart/commands/displaymode.py   |   68 -
 .../mic/3rdparty/pykickstart/commands/dmraid.py|   91 --
 .../3rdparty/pykickstart/commands/driverdisk.py|  184 ---
 .../lib/mic/3rdparty/pykickstart/commands/fcoe.py  |  114 --
 .../mic/3rdparty/pykickstart/commands/firewall.py  |  193 ---
 .../mic/3rdparty/pykickstart/commands/firstboot.py |   62 -
 .../lib/mic/3rdparty/pykickstart/commands/group.py |   88 --
 .../3rdparty/pykickstart/commands/ignoredisk.py|  139 --
 .../3rdparty/pykickstart/commands/interactive.py   |   58 -
 .../lib/mic/3rdparty/pykickstart/commands/iscsi.py |  133 --
 .../mic/3rdparty/pykickstart/commands/iscsiname.py |   54 -
 .../lib/mic/3rdparty/pykickstart/commands/key.py   |   64 -
 .../mic/3rdparty/pykickstart/commands/keyboard.py  |   55 -
 .../lib/mic/3rdparty/pykickstart/commands/lang.py  |   60 -
 .../3rdparty/pykickstart/commands/langsupport.py   |   58 -
 .../mic/3rdparty/pykickstart/commands/lilocheck.py |   54 -
 .../mic/3rdparty/pykickstart/commands/logging.py   |   66 -
 .../mic/3rdparty/pykickstart/commands/logvol.py|  304 
 .../3rdparty/pykickstart/commands/mediacheck.py|   53 -
 .../mic/3rdparty/pykickstart/commands/method.py|  186 ---
 .../mic/3rdparty/pykickstart/commands/monitor.py   |  106 --
 .../lib/mic/3rdparty/pykickstart/commands/mouse.py |   70 -
 .../mic/3rdparty/pykickstart/commands

[OE-core] [PATCH 05/35] wic: Remove mic chroot

2014-08-08 Thread Tom Zanussi
mic chroot allows users to chroot into an existing mic image and isn't
used by wic, so remove it.

Removing chroot.py leads in turn to various plugin-loading failures
for a number of plugins that wic doesn't use either, so remove those
as well.

The existing source plugins refer to chroot but don't use it, so fix
those up.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/chroot.py| 343 ---
 scripts/lib/mic/imager/fs.py |  99 ---
 scripts/lib/mic/imager/livecd.py | 750 ---
 scripts/lib/mic/imager/liveusb.py| 308 --
 scripts/lib/mic/imager/loop.py   | 418 -
 scripts/lib/mic/imager/raw.py| 501 ---
 scripts/lib/mic/plugins/imager/direct_plugin.py  |   2 +-
 scripts/lib/mic/plugins/imager/fs_plugin.py  | 143 -
 scripts/lib/mic/plugins/imager/livecd_plugin.py  | 255 
 scripts/lib/mic/plugins/imager/liveusb_plugin.py | 260 
 scripts/lib/mic/plugins/imager/loop_plugin.py| 255 
 scripts/lib/mic/plugins/imager/raw_plugin.py | 275 -
 scripts/lib/mic/plugins/source/bootimg-efi.py|   2 +-
 scripts/lib/mic/plugins/source/bootimg-pcbios.py |   2 +-
 scripts/lib/mic/plugins/source/rootfs.py |   2 +-
 15 files changed, 4 insertions(+), 3611 deletions(-)
 delete mode 100644 scripts/lib/mic/chroot.py
 delete mode 100644 scripts/lib/mic/imager/fs.py
 delete mode 100644 scripts/lib/mic/imager/livecd.py
 delete mode 100644 scripts/lib/mic/imager/liveusb.py
 delete mode 100644 scripts/lib/mic/imager/loop.py
 delete mode 100644 scripts/lib/mic/imager/raw.py
 delete mode 100644 scripts/lib/mic/plugins/imager/fs_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/livecd_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/liveusb_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/loop_plugin.py
 delete mode 100644 scripts/lib/mic/plugins/imager/raw_plugin.py

Patch too large to post - see git repository.

-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 18/35] wic: Remove unused plugin and error code

2014-08-08 Thread Tom Zanussi
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/plugin.py  |  2 +-
 scripts/lib/mic/pluginbase.py  | 45 ++
 scripts/lib/mic/plugins/hook/.py   |  0
 scripts/lib/mic/plugins/hook/empty_hook.py |  3 --
 scripts/lib/mic/utils/errors.py| 21 --
 5 files changed, 3 insertions(+), 68 deletions(-)
 delete mode 100644 scripts/lib/mic/plugins/hook/.py
 delete mode 100644 scripts/lib/mic/plugins/hook/empty_hook.py

diff --git a/scripts/lib/mic/plugin.py b/scripts/lib/mic/plugin.py
index f836950..43afdbc 100644
--- a/scripts/lib/mic/plugin.py
+++ b/scripts/lib/mic/plugin.py
@@ -24,7 +24,7 @@ from mic.utils.oe.misc import *
 
 __ALL__ = ['PluginMgr', 'pluginmgr']
 
-PLUGIN_TYPES = [imager, source] # TODO  hook
+PLUGIN_TYPES = [imager, source]
 
 PLUGIN_DIR = /lib/mic/plugins # relative to scripts
 SCRIPTS_PLUGIN_DIR = scripts + PLUGIN_DIR
diff --git a/scripts/lib/mic/pluginbase.py b/scripts/lib/mic/pluginbase.py
index 9cf4c62..46a4f4a 100644
--- a/scripts/lib/mic/pluginbase.py
+++ b/scripts/lib/mic/pluginbase.py
@@ -40,45 +40,10 @@ class _Plugin(object):
 def get_plugins(cls):
 return cls.plugins
 
+
 class ImagerPlugin(_Plugin):
 mic_plugin_type = imager
 
-@classmethod
-def check_image_exists(self, destdir, apacking=None,
-  images=(),
-  release=None):
-
-# if it's a packing file, reset images
-if apacking:
-images = [apacking]
-
-# release option will override images
-if release is not None:
-images = [os.path.basename(destdir.rstrip('/'))]
-destdir = os.path.dirname(destdir.rstrip('/'))
-
-for name in images:
-if not name:
-continue
-
-image = os.path.join(destdir, name)
-if not os.path.exists(image):
-continue
-
-if msger.ask(Target image/dir: %s already exists, 
- clean up and continue? % image):
-if os.path.isdir(image):
-shutil.rmtree(image)
-else:
-os.unlink(image)
-else:
-raise errors.Abort(Cancled)
-
-def do_create(self):
-pass
-
-def do_chroot(self):
-pass
 
 class SourcePlugin(_Plugin):
 mic_plugin_type = source
@@ -133,12 +98,6 @@ class SourcePlugin(_Plugin):
 
 msger.debug(SourcePlugin: do_prepare_partition: part: %s % part)
 
-class BackendPlugin(_Plugin):
-mic_plugin_type=backend
-
-def addRepository(self):
-pass
-
 def get_plugins(typen):
 ps = ImagerPlugin.get_plugins()
 if typen in ps:
@@ -146,4 +105,4 @@ def get_plugins(typen):
 else:
 return None
 
-__all__ = ['ImagerPlugin', 'BackendPlugin', 'SourcePlugin', 'get_plugins']
+__all__ = ['ImagerPlugin', 'SourcePlugin', 'get_plugins']
diff --git a/scripts/lib/mic/plugins/hook/.py b/scripts/lib/mic/plugins/hook/.py
deleted file mode 100644
index e69de29..000
diff --git a/scripts/lib/mic/plugins/hook/empty_hook.py 
b/scripts/lib/mic/plugins/hook/empty_hook.py
deleted file mode 100644
index 397585d..000
--- a/scripts/lib/mic/plugins/hook/empty_hook.py
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/python
-
-# TODO: plugin base for hooks
diff --git a/scripts/lib/mic/utils/errors.py b/scripts/lib/mic/utils/errors.py
index 8d720f9..38fda30 100644
--- a/scripts/lib/mic/utils/errors.py
+++ b/scripts/lib/mic/utils/errors.py
@@ -43,29 +43,8 @@ class Usage(CreatorError):
 class Abort(CreatorError):
 keyword = ''
 
-class ConfigError(CreatorError):
-keyword = 'config'
-
 class KsError(CreatorError):
 keyword = 'kickstart'
 
-class RepoError(CreatorError):
-keyword = 'repo'
-
-class RpmError(CreatorError):
-keyword = 'rpm'
-
 class MountError(CreatorError):
 keyword = 'mount'
-
-class SnapshotError(CreatorError):
-keyword = 'snapshot'
-
-class SquashfsError(CreatorError):
-keyword = 'squashfs'
-
-class BootstrapError(CreatorError):
-keyword = 'bootstrap'
-
-class RuntimeError(CreatorError):
-keyword = 'runtime'
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 01/35] wic: Make exec_cmd() error out instead of warn

2014-08-08 Thread Tom Zanussi
The reason exec_cmd() warns but doesn't error out (broken parted)
doesn't really make sense, since the parted invocations don't even use
exec_cmd().  It really should just fail since by not doing so it's
actually enabling invalid images in some cases.

Also, since the return code is now always zero, there's no point in
having a return code, so remove it.  This represents a change in the
API, so we also need to update all callers.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 .../lib/mic/kickstart/custom_commands/partition.py | 44 +++---
 scripts/lib/mic/plugins/source/bootimg-efi.py  |  8 ++--
 scripts/lib/mic/plugins/source/bootimg-pcbios.py   | 10 ++---
 scripts/lib/mic/utils/fs_related.py|  2 +-
 scripts/lib/mic/utils/oe/misc.py   | 33 +---
 scripts/lib/mic/utils/partitionedfs.py |  2 +-
 6 files changed, 53 insertions(+), 46 deletions(-)

diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py 
b/scripts/lib/mic/kickstart/custom_commands/partition.py
index 3b652b3..101b90e 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -161,7 +161,7 @@ class Wic_PartData(Mic_PartData):
 
 rootfs = oe_builddir
 du_cmd = du -Lbms %s % rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 rootfs_size = out.split()[0]
 
 self.size = rootfs_size
@@ -209,7 +209,7 @@ class Wic_PartData(Mic_PartData):
 rootfs = %s/rootfs_%s.%s % (cr_workdir, self.label ,self.fstype)
 
 du_cmd = du -ks %s % image_rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 actual_rootfs_size = int(out.split()[0])
 
 extra_blocks = self.get_extra_block_count(actual_rootfs_size)
@@ -224,18 +224,18 @@ class Wic_PartData(Mic_PartData):
 
 dd_cmd = dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k % \
 (rootfs, rootfs_size)
-rc, out = exec_cmd(dd_cmd)
+exec_cmd(dd_cmd)
 
 extra_imagecmd = -i 8192
 
 mkfs_cmd = mkfs.%s -F %s %s -d %s % \
 (self.fstype, extra_imagecmd, rootfs, image_rootfs)
-rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
 
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 rootfs_size = out.split()[0]
 
 self.size = rootfs_size
@@ -254,7 +254,7 @@ class Wic_PartData(Mic_PartData):
 rootfs = %s/rootfs_%s.%s % (cr_workdir, self.label, self.fstype)
 
 du_cmd = du -ks %s % image_rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 actual_rootfs_size = int(out.split()[0])
 
 extra_blocks = self.get_extra_block_count(actual_rootfs_size)
@@ -269,15 +269,15 @@ class Wic_PartData(Mic_PartData):
 
 dd_cmd = dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k % \
 (rootfs, rootfs_size)
-rc, out = exec_cmd(dd_cmd)
+exec_cmd(dd_cmd)
 
 mkfs_cmd = mkfs.%s -b %d -r %s %s % \
 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs)
-rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
+exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 rootfs_size = out.split()[0]
 
 self.size = rootfs_size
@@ -292,7 +292,7 @@ class Wic_PartData(Mic_PartData):
 rootfs = %s/rootfs_%s.%s % (cr_workdir, self.label, self.fstype)
 
 du_cmd = du -bks %s % image_rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 blocks = int(out.split()[0])
 
 extra_blocks = self.get_extra_block_count(blocks)
@@ -324,7 +324,7 @@ class Wic_PartData(Mic_PartData):
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 rootfs_size = out.split()[0]
 
 self.set_size(rootfs_size)
@@ -340,11 +340,11 @@ class Wic_PartData(Mic_PartData):
 
 squashfs_cmd = mksquashfs %s %s -noappend % \
(image_rootfs, rootfs)
-rc, out = exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
+exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
 
 # get the rootfs size in the right units for kickstart (Mb)
 du_cmd = du -Lbms %s % rootfs
-rc, out = exec_cmd(du_cmd)
+out = exec_cmd(du_cmd)
 rootfs_size = out.split()[0]
 
 self.size = rootfs_size
@@ -378,12 +378,12 @@ class Wic_PartData(Mic_PartData):
 
 dd_cmd = dd

[OE-core] [PATCH 12/35] wic: Remove rpmmisc

2014-08-08 Thread Tom Zanussi
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/rpmmisc.py | 600 ---
 1 file changed, 600 deletions(-)
 delete mode 100644 scripts/lib/mic/utils/rpmmisc.py

diff --git a/scripts/lib/mic/utils/rpmmisc.py b/scripts/lib/mic/utils/rpmmisc.py
deleted file mode 100644
index af15763..000
--- a/scripts/lib/mic/utils/rpmmisc.py
+++ /dev/null
@@ -1,600 +0,0 @@
-#!/usr/bin/python -tt
-#
-# Copyright (c) 2008, 2009, 2010, 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import sys
-import re
-import rpm
-
-from mic import msger
-from mic.utils.errors import CreatorError
-from mic.utils.proxy import get_proxy_for
-from mic.utils import runner
-
-
-class RPMInstallCallback:
- Command line callback class for callbacks from the RPM library.
-
-
-def __init__(self, ts, output=1):
-self.output = output
-self.callbackfilehandles = {}
-self.total_actions = 0
-self.total_installed = 0
-self.installed_pkg_names = []
-self.total_removed = 0
-self.mark = +
-self.marks = 40
-self.lastmsg = None
-self.tsInfo = None # this needs to be set for anything else to work
-self.ts = ts
-self.filelog = False
-self.logString = []
-self.headmsg = Installing
-
-def _dopkgtup(self, hdr):
-tmpepoch = hdr['epoch']
-if tmpepoch is None: epoch = '0'
-else: epoch = str(tmpepoch)
-
-return (hdr['name'], hdr['arch'], epoch, hdr['version'], 
hdr['release'])
-
-def _makeHandle(self, hdr):
-handle = '%s:%s.%s-%s-%s' % (hdr['epoch'], hdr['name'], hdr['version'],
-  hdr['release'], hdr['arch'])
-
-return handle
-
-def _localprint(self, msg):
-if self.output:
-msger.info(msg)
-
-def _makefmt(self, percent, progress = True):
-l = len(str(self.total_actions))
-size = %s.%s % (l, l)
-fmt_done = [% + size + s/% + size + s]
-done = fmt_done % (self.total_installed + self.total_removed,
-   self.total_actions)
-marks = self.marks - (2 * l)
-width = %s.%s % (marks, marks)
-fmt_bar = %- + width + s
-if progress:
-bar = fmt_bar % (self.mark * int(marks * (percent / 100.0)), )
-fmt = \r  %-10.10s: %-20.20s  + bar +   + done
-else:
-bar = fmt_bar % (self.mark * marks, )
-fmt =   %-10.10s: %-20.20s   + bar +   + done
-return fmt
-
-def _logPkgString(self, hdr):
-return nice representation of the package for the log
-(n,a,e,v,r) = self._dopkgtup(hdr)
-if e == '0':
-pkg = '%s.%s %s-%s' % (n, a, v, r)
-else:
-pkg = '%s.%s %s:%s-%s' % (n, a, e, v, r)
-
-return pkg
-
-def callback(self, what, bytes, total, h, user):
-if what == rpm.RPMCALLBACK_TRANS_START:
-if bytes == 6:
-self.total_actions = total
-
-elif what == rpm.RPMCALLBACK_TRANS_PROGRESS:
-pass
-
-elif what == rpm.RPMCALLBACK_TRANS_STOP:
-pass
-
-elif what == rpm.RPMCALLBACK_INST_OPEN_FILE:
-self.lastmsg = None
-hdr = None
-if h is not None:
-try:
-hdr, rpmloc = h
-except:
-rpmloc = h
-hdr = readRpmHeader(self.ts, h)
-
-handle = self._makeHandle(hdr)
-fd = os.open(rpmloc, os.O_RDONLY)
-self.callbackfilehandles[handle]=fd
-if hdr['name'] not in self.installed_pkg_names:
-self.installed_pkg_names.append(hdr['name'])
-self.total_installed += 1
-return fd
-else:
-self._localprint(No header - huh?)
-
-elif what == rpm.RPMCALLBACK_INST_CLOSE_FILE:
-hdr = None
-if h is not None:
-try:
-hdr, rpmloc = h
-except:
-rpmloc = h
-hdr = readRpmHeader(self.ts, h)
-
-handle = self._makeHandle(hdr)
-os.close(self.callbackfilehandles[handle

[OE-core] [PATCH 02/35] wic: Remove unused custom commands

2014-08-08 Thread Tom Zanussi
installer, repo, desktop-related stuff

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/kickstart/__init__.py  |   6 +-
 .../lib/mic/kickstart/custom_commands/__init__.py  |   7 --
 .../lib/mic/kickstart/custom_commands/desktop.py   |  95 ---
 .../mic/kickstart/custom_commands/installerfw.py   |  63 --
 .../lib/mic/kickstart/custom_commands/micrepo.py   | 127 -
 5 files changed, 1 insertion(+), 297 deletions(-)
 delete mode 100644 scripts/lib/mic/kickstart/custom_commands/desktop.py
 delete mode 100644 scripts/lib/mic/kickstart/custom_commands/installerfw.py
 delete mode 100644 scripts/lib/mic/kickstart/custom_commands/micrepo.py

diff --git a/scripts/lib/mic/kickstart/__init__.py 
b/scripts/lib/mic/kickstart/__init__.py
index 72f3ca6..11cdf63 100644
--- a/scripts/lib/mic/kickstart/__init__.py
+++ b/scripts/lib/mic/kickstart/__init__.py
@@ -32,7 +32,7 @@ from pykickstart.handlers.control import dataMap
 
 from mic import msger
 from mic.utils import errors, misc, runner, fs_related as fs
-from custom_commands import desktop, micrepo, wicboot, partition, installerfw
+from custom_commands import wicboot, partition
 
 
 AUTH_URL_PTN = 
r(?Pscheme.*)://(?Pusername.*)(:?Ppassword.*)?@(?Purl.*)
@@ -96,13 +96,9 @@ def read_kickstart(path):
 #ks = ksparser.KickstartParser(version)
 
 using_version = ksversion.DEVEL
-commandMap[using_version][desktop] = desktop.Mic_Desktop
-commandMap[using_version][repo] = micrepo.Mic_Repo
 commandMap[using_version][bootloader] = wicboot.Wic_Bootloader
 commandMap[using_version][part] = partition.Wic_Partition
 commandMap[using_version][partition] = partition.Wic_Partition
-commandMap[using_version][installerfw] = installerfw.Mic_installerfw
-dataMap[using_version][RepoData] = micrepo.Mic_RepoData
 dataMap[using_version][PartData] = partition.Wic_PartData
 superclass = ksversion.returnClassForVersion(version=using_version)
 
diff --git a/scripts/lib/mic/kickstart/custom_commands/__init__.py 
b/scripts/lib/mic/kickstart/custom_commands/__init__.py
index 6aed0ff..f84c6d9 100644
--- a/scripts/lib/mic/kickstart/custom_commands/__init__.py
+++ b/scripts/lib/mic/kickstart/custom_commands/__init__.py
@@ -1,17 +1,10 @@
-from desktop import Mic_Desktop
-from micrepo import Mic_Repo, Mic_RepoData
 from micpartition import Mic_Partition
 from micpartition import Mic_PartData
-from installerfw import Mic_installerfw
 from partition import Wic_Partition
 
 __all__ = (
-Mic_Desktop,
-Mic_Repo,
-Mic_RepoData,
 Mic_Partition,
 Mic_PartData,
-Mic_installerfw,
 Wic_Partition,
 Wic_PartData,
 )
diff --git a/scripts/lib/mic/kickstart/custom_commands/desktop.py 
b/scripts/lib/mic/kickstart/custom_commands/desktop.py
deleted file mode 100644
index c8bd647..000
--- a/scripts/lib/mic/kickstart/custom_commands/desktop.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/python -tt
-#
-# Copyright (c) 2008, 2009, 2010 Intel, Inc.
-#
-# Yi Yang yi.y.y...@intel.com
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-from pykickstart.base import *
-from pykickstart.errors import *
-from pykickstart.options import *
-
-class Mic_Desktop(KickstartCommand):
-def __init__(self, writePriority=0,
-   defaultdesktop=None,
-   defaultdm=None,
-   autologinuser=None,
-   session=None):
-
-KickstartCommand.__init__(self, writePriority)
-
-self.__new_version = False
-self.op = self._getParser()
-
-self.defaultdesktop = defaultdesktop
-self.autologinuser = autologinuser
-self.defaultdm = defaultdm
-self.session = session
-
-def __str__(self):
-retval = 
-
-if self.defaultdesktop != None:
-retval +=  --defaultdesktop=%s % self.defaultdesktop
-if self.session != None:
-retval +=  --session=\%s\ % self.session
-if self.autologinuser != None:
-retval +=  --autologinuser=%s % self.autologinuser
-if self.defaultdm != None:
-retval +=  --defaultdm=%s % self.defaultdm
-
-if retval != :
-retval = # Default Desktop Settings\ndesktop %s\n % retval
-
-return retval
-
-def _getParser(self):
-try

[OE-core] [PATCH 08/35] wic: Remove bmap support

2014-08-08 Thread Tom Zanussi
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/BmapCreate.py | 298 
 1 file changed, 298 deletions(-)
 delete mode 100644 scripts/lib/mic/utils/BmapCreate.py

diff --git a/scripts/lib/mic/utils/BmapCreate.py 
b/scripts/lib/mic/utils/BmapCreate.py
deleted file mode 100644
index 65b19a5..000
--- a/scripts/lib/mic/utils/BmapCreate.py
+++ /dev/null
@@ -1,298 +0,0 @@
- This module implements the block map (bmap) creation functionality and
-provides the corresponding API in form of the 'BmapCreate' class.
-
-The idea is that while images files may generally be very large (e.g., 4GiB),
-they may nevertheless contain only little real data, e.g., 512MiB. This data
-are files, directories, file-system meta-data, partition table, etc. When
-copying the image to the target device, you do not have to copy all the 4GiB of
-data, you can copy only 512MiB of it, which is 4 times less, so copying should
-presumably be 4 times faster.
-
-The block map file is an XML file which contains a list of blocks which have to
-be copied to the target device. The other blocks are not used and there is no
-need to copy them. The XML file also contains some additional information like
-block size, image size, count of mapped blocks, etc. There are also many
-commentaries, so it is human-readable.
-
-The image has to be a sparse file. Generally, this means that when you generate
-this image file, you should start with a huge sparse file which contains a
-single hole spanning the entire file. Then you should partition it, write all
-the data (probably by means of loop-back mounting the image or parts of it),
-etc. The end result should be a sparse file where mapped areas represent useful
-parts of the image and holes represent useless parts of the image, which do not
-have to be copied when copying the image to the target device.
-
-This module uses the FIBMAP ioctl to detect holes. 
-
-# Disable the following pylint recommendations:
-#   *  Too many instance attributes - R0902
-#   *  Too few public methods - R0903
-# pylint: disable=R0902,R0903
-
-import hashlib
-from mic.utils.misc import human_size
-from mic.utils import Fiemap
-
-# The bmap format version we generate
-SUPPORTED_BMAP_VERSION = 1.3
-
-_BMAP_START_TEMPLATE = \
-?xml version=1.0 ?
-!-- This file contains the block map for an image file, which is basically
- a list of useful (mapped) block numbers in the image file. In other words,
- it lists only those blocks which contain data (boot sector, partition
- table, file-system metadata, files, directories, extents, etc). These
- blocks have to be copied to the target device. The other blocks do not
- contain any useful data and do not have to be copied to the target
- device.
-
- The block map an optimization which allows to copy or flash the image to
- the image quicker than copying of flashing the entire image. This is
- because with bmap less data is copied: MappedBlocksCount blocks instead
- of BlocksCount blocks.
-
- Besides the machine-readable data, this file contains useful commentaries
- which contain human-readable information like image size, percentage of
- mapped data, etc.
-
- The 'version' attribute is the block map file format version in the
- 'major.minor' format. The version major number is increased whenever an
- incompatible block map format change is made. The minor number changes
- in case of minor backward-compatible changes. --
-
-bmap version=%s
-!-- Image size in bytes: %s --
-ImageSize %u /ImageSize
-
-!-- Size of a block in bytes --
-BlockSize %u /BlockSize
-
-!-- Count of blocks in the image file --
-BlocksCount %u /BlocksCount
-
-
-
-class Error(Exception):
- A class for exceptions generated by this module. We currently support
-only one type of exceptions, and we basically throw human-readable problem
-description in case of errors. 
-pass
-
-class BmapCreate:
- This class implements the bmap creation functionality. To generate a
-bmap for an image (which is supposedly a sparse file), you should first
-create an instance of 'BmapCreate' and provide:
-
-* full path or a file-like object of the image to create bmap for
-* full path or a file object to use for writing the results to
-
-Then you should invoke the 'generate()' method of this class. It will use
-the FIEMAP ioctl to generate the bmap. 
-
-def _open_image_file(self):
- Open the image file. 
-
-try:
-self._f_image = open(self._image_path, 'rb')
-except IOError as err:
-raise Error(cannot open image file '%s': %s \
-% (self._image_path, err))
-
-self._f_image_needs_close = True
-
-def _open_bmap_file(self):
- Open the bmap file. 
-
-try:
-self._f_bmap = open(self._bmap_path, 'w

[OE-core] [PATCH 14/35] wic: Remove unused misc code

2014-08-08 Thread Tom Zanussi
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/misc.py | 180 +-
 1 file changed, 1 insertion(+), 179 deletions(-)

diff --git a/scripts/lib/mic/utils/misc.py b/scripts/lib/mic/utils/misc.py
index 8c1f016..010b16c 100644
--- a/scripts/lib/mic/utils/misc.py
+++ b/scripts/lib/mic/utils/misc.py
@@ -18,29 +18,9 @@
 import os
 import sys
 import time
-import tempfile
-import re
-import shutil
-import glob
-import hashlib
-import subprocess
-import platform
-import traceback
-
-
-try:
-import sqlite3 as sqlite
-except ImportError:
-import sqlite
-
-try:
-from xml.etree import cElementTree
-except ImportError:
-import cElementTree
-xmlparse = cElementTree.parse
 
 from mic import msger
-from mic.utils.errors import CreatorError, SquashfsError
+from mic.utils.errors import CreatorError
 from mic.utils.fs_related import find_binary_path, makedirs
 from mic.utils import runner
 
@@ -82,115 +62,6 @@ def build_name(kscfg, release=None, prefix = None, suffix = 
None):
 ret = prefix + name + suffix
 return ret
 
-def get_distro():
-Detect linux distribution, support meego
-
-
-support_dists = ('SuSE',
- 'debian',
- 'fedora',
- 'redhat',
- 'centos',
- 'meego',
- 'moblin',
- 'tizen')
-try:
-(dist, ver, id) = platform.linux_distribution( \
-  supported_dists = support_dists)
-except:
-(dist, ver, id) = platform.dist( \
-  supported_dists = support_dists)
-
-return (dist, ver, id)
-
-def get_distro_str():
-Get composited string for current linux distribution
-
-(dist, ver, id) = get_distro()
-
-if not dist:
-return 'Unknown Linux Distro'
-else:
-distro_str = ' '.join(map(str.strip, (dist, ver, id)))
-return distro_str.strip()
-
-_LOOP_RULE_PTH = None
-
-def human_size(size):
-Return human readable string for Bytes size
-
-
-if size = 0:
-return 0M
-import math
-measure = ['B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
-expo = int(math.log(size, 1024))
-mant = float(size/math.pow(1024, expo))
-return {0:.1f}{1:s}.format(mant, measure[expo])
-
-def get_block_size(file_obj):
- Returns block size for file object 'file_obj'. Errors are indicated by
-the 'IOError' exception. 
-
-from fcntl import ioctl
-import struct
-
-# Get the block size of the host file-system for the image file by calling
-# the FIGETBSZ ioctl (number 2).
-binary_data = ioctl(file_obj, 2, struct.pack('I', 0))
-return struct.unpack('I', binary_data)[0]
-
-def check_space_pre_cp(src, dst):
-Check whether disk space is enough before 'cp' like
-operations, else exception will be raised.
-
-
-srcsize  = get_file_size(src) * 1024 * 1024
-freesize = get_filesystem_avail(dst)
-if srcsize  freesize:
-raise CreatorError(space on %s(%s) is not enough for about %s files
-   % (dst, human_size(freesize), human_size(srcsize)))
-
-def calc_hashes(file_path, hash_names, start = 0, end = None):
- Calculate hashes for a file. The 'file_path' argument is the file
-to calculate hash functions for, 'start' and 'end' are the starting and
-ending file offset to calculate the has functions for. The 'hash_names'
-argument is a list of hash names to calculate. Returns the the list
-of calculated hash values in the hexadecimal form in the same order
-as 'hash_names'.
-
-if end == None:
-end = os.path.getsize(file_path)
-
-chunk_size = 65536
-to_read = end - start
-read = 0
-
-hashes = []
-for hash_name in hash_names:
-hashes.append(hashlib.new(hash_name))
-
-with open(file_path, rb) as f:
-f.seek(start)
-
-while read  to_read:
-if read + chunk_size  to_read:
-chunk_size = to_read - read
-chunk = f.read(chunk_size)
-for hash_obj in hashes:
-hash_obj.update(chunk)
-read += chunk_size
-
-result = []
-for hash_obj in hashes:
-result.append(hash_obj.hexdigest())
-
-return result
-
-def get_md5sum(fpath):
-return calc_hashes(fpath, ('md5', ))[0]
-
-
 def normalize_ksfile(ksconf, release, arch):
 '''
 Return the name of a normalized ks file in which macro variables
@@ -232,52 +103,3 @@ def normalize_ksfile(ksconf, release, arch):
 atexit.register(remove_temp_ks)
 
 return ksconf
-
-
-def selinux_check(arch, fstypes):
-try:
-getenforce = find_binary_path('getenforce')
-except CreatorError:
-return
-
-selinux_status = runner.outs([getenforce])
-if arch and arch.startswith(arm) and selinux_status == Enforcing:
-raise

[OE-core] [PATCH 17/35] wic: Remove gpt_parser

2014-08-08 Thread Tom Zanussi
wic doesn't currently use it, so remove.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/plugins/source/bootimg-efi.py|   4 +-
 scripts/lib/mic/plugins/source/bootimg-pcbios.py |   8 +-
 scripts/lib/mic/utils/gpt_parser.py  | 331 ---
 scripts/lib/mic/utils/partitionedfs.py   |  58 +---
 4 files changed, 11 insertions(+), 390 deletions(-)
 delete mode 100644 scripts/lib/mic/utils/gpt_parser.py

diff --git a/scripts/lib/mic/plugins/source/bootimg-efi.py 
b/scripts/lib/mic/plugins/source/bootimg-efi.py
index 95e1c05..d4a7771 100644
--- a/scripts/lib/mic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/mic/plugins/source/bootimg-efi.py
@@ -78,9 +78,7 @@ class BootimgEFIPlugin(SourcePlugin):
 if cr._ptable_format == 'msdos':
 rootstr = rootdev
 else:
-if not root_part_uuid:
-raise MountError(Cannot find the root GPT partition UUID)
-rootstr = PARTUUID=%s % root_part_uuid
+raise MountError(Unsupported partition table format found)
 
 grubefi_conf += linux %s root=%s rootwait %s\n \
 % (kernel, rootstr, options)
diff --git a/scripts/lib/mic/plugins/source/bootimg-pcbios.py 
b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
index 9959645..3434320 100644
--- a/scripts/lib/mic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
@@ -50,9 +50,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
 disk image.  In this case, we install the MBR.
 
 mbrfile = %s/syslinux/ % bootimg_dir
-if cr._ptable_format == 'gpt':
-mbrfile += gptmbr.bin
-else:
+if cr._ptable_format == 'msdos':
 mbrfile += mbr.bin
 
 if not os.path.exists(mbrfile):
@@ -110,9 +108,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
 if cr._ptable_format == 'msdos':
 rootstr = rootdev
 else:
-if not root_part_uuid:
-raise MountError(Cannot find the root GPT partition UUID)
-rootstr = PARTUUID=%s % root_part_uuid
+raise MountError(Unsupported partition table format found)
 
 syslinux_conf += APPEND label=boot root=%s %s\n % (rootstr, options)
 
diff --git a/scripts/lib/mic/utils/gpt_parser.py 
b/scripts/lib/mic/utils/gpt_parser.py
deleted file mode 100644
index 5d43b70..000
--- a/scripts/lib/mic/utils/gpt_parser.py
+++ /dev/null
@@ -1,331 +0,0 @@
-#!/usr/bin/python -tt
-#
-# Copyright (c) 2013 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- This module implements a simple GPT partitions parser which can read the
-GPT header and the GPT partition table. 
-
-import struct
-import uuid
-import binascii
-from mic.utils.errors import MountError
-
-_GPT_HEADER_FORMAT = 8s4sIII16sQIII
-_GPT_HEADER_SIZE = struct.calcsize(_GPT_HEADER_FORMAT)
-_GPT_ENTRY_FORMAT = 16s16sQQQ72s
-_GPT_ENTRY_SIZE = struct.calcsize(_GPT_ENTRY_FORMAT)
-_SUPPORTED_GPT_REVISION = '\x00\x00\x01\x00'
-
-def _stringify_uuid(binary_uuid):
- A small helper function to transform a binary UUID into a string
-format. 
-
-uuid_str = str(uuid.UUID(bytes_le = binary_uuid))
-
-return uuid_str.upper()
-
-def _calc_header_crc(raw_hdr):
- Calculate GPT header CRC32 checksum. The 'raw_hdr' parameter has to
-be a list or a tuple containing all the elements of the GPT header in a
-raw form, meaning that it should simply contain unpacked disk data.
-
-
-raw_hdr = list(raw_hdr)
-raw_hdr[3] = 0
-raw_hdr = struct.pack(_GPT_HEADER_FORMAT, *raw_hdr)
-
-return binascii.crc32(raw_hdr)  0x
-
-def _validate_header(raw_hdr):
- Validate the GPT header. The 'raw_hdr' parameter has to be a list or a
-tuple containing all the elements of the GPT header in a raw form,
-meaning that it should simply contain unpacked disk data. 
-
-# Validate the signature
-if raw_hdr[0] != 'EFI PART':
-raise MountError(GPT partition table not found)
-
-# Validate the revision
-if raw_hdr[1] != _SUPPORTED_GPT_REVISION:
-raise MountError(Unsupported GPT revision '%s', supported revision  \
- is '%s' % \
-  (binascii.hexlify(raw_hdr[1]),
-   binascii.hexlify(_SUPPORTED_GPT_REVISION

[OE-core] [PATCH 09/35] wic: Remove fiemap support

2014-08-08 Thread Tom Zanussi
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/Fiemap.py | 252 
 1 file changed, 252 deletions(-)
 delete mode 100644 scripts/lib/mic/utils/Fiemap.py

diff --git a/scripts/lib/mic/utils/Fiemap.py b/scripts/lib/mic/utils/Fiemap.py
deleted file mode 100644
index f2db6ff..000
--- a/scripts/lib/mic/utils/Fiemap.py
+++ /dev/null
@@ -1,252 +0,0 @@
- This module implements python API for the FIEMAP ioctl. The FIEMAP ioctl
-allows to find holes and mapped areas in a file. 
-
-# Note, a lot of code in this module is not very readable, because it deals
-# with the rather complex FIEMAP ioctl. To understand the code, you need to
-# know the FIEMAP interface, which is documented in the
-# Documentation/filesystems/fiemap.txt file in the Linux kernel sources.
-
-# Disable the following pylint recommendations:
-#   * Too many instance attributes (R0902)
-# pylint: disable=R0902
-
-import os
-import struct
-import array
-import fcntl
-from mic.utils.misc import get_block_size
-
-# Format string for 'struct fiemap'
-_FIEMAP_FORMAT = =QQ
-# sizeof(struct fiemap)
-_FIEMAP_SIZE = struct.calcsize(_FIEMAP_FORMAT)
-# Format string for 'struct fiemap_extent'
-_FIEMAP_EXTENT_FORMAT = =Q
-# sizeof(struct fiemap_extent)
-_FIEMAP_EXTENT_SIZE = struct.calcsize(_FIEMAP_EXTENT_FORMAT)
-# The FIEMAP ioctl number
-_FIEMAP_IOCTL = 0xC020660B
-
-# Minimum buffer which is required for 'class Fiemap' to operate
-MIN_BUFFER_SIZE = _FIEMAP_SIZE + _FIEMAP_EXTENT_SIZE
-# The default buffer size for 'class Fiemap'
-DEFAULT_BUFFER_SIZE = 256 * 1024
-
-class Error(Exception):
- A class for exceptions generated by this module. We currently support
-only one type of exceptions, and we basically throw human-readable problem
-description in case of errors. 
-pass
-
-class Fiemap:
- This class provides API to the FIEMAP ioctl. Namely, it allows to
-iterate over all mapped blocks and over all holes. 
-
-def _open_image_file(self):
- Open the image file. 
-
-try:
-self._f_image = open(self._image_path, 'rb')
-except IOError as err:
-raise Error(cannot open image file '%s': %s \
-% (self._image_path, err))
-
-self._f_image_needs_close = True
-
-def __init__(self, image, buf_size = DEFAULT_BUFFER_SIZE):
- Initialize a class instance. The 'image' argument is full path to
-the file to operate on, or a file object to operate on.
-
-The 'buf_size' argument is the size of the buffer for 'struct
-fiemap_extent' elements which will be used when invoking the FIEMAP
-ioctl. The larger is the buffer, the less times the FIEMAP ioctl will
-be invoked. 
-
-self._f_image_needs_close = False
-
-if hasattr(image, fileno):
-self._f_image = image
-self._image_path = image.name
-else:
-self._image_path = image
-self._open_image_file()
-
-# Validate 'buf_size'
-if buf_size  MIN_BUFFER_SIZE:
-raise Error(too small buffer (%d bytes), minimum is %d bytes \
-% (buf_size, MIN_BUFFER_SIZE))
-
-# How many 'struct fiemap_extent' elements fit the buffer
-buf_size -= _FIEMAP_SIZE
-self._fiemap_extent_cnt = buf_size / _FIEMAP_EXTENT_SIZE
-self._buf_size = self._fiemap_extent_cnt * _FIEMAP_EXTENT_SIZE
-self._buf_size += _FIEMAP_SIZE
-
-# Allocate a mutable buffer for the FIEMAP ioctl
-self._buf = array.array('B', [0] * self._buf_size)
-
-self.image_size = os.fstat(self._f_image.fileno()).st_size
-
-try:
-self.block_size = get_block_size(self._f_image)
-except IOError as err:
-raise Error(cannot get block size for '%s': %s \
-% (self._image_path, err))
-
-self.blocks_cnt = self.image_size + self.block_size - 1
-self.blocks_cnt /= self.block_size
-
-# Synchronize the image file to make sure FIEMAP returns correct values
-try:
-self._f_image.flush()
-except IOError as err:
-raise Error(cannot flush image file '%s': %s \
-% (self._image_path, err))
-try:
-os.fsync(self._f_image.fileno()),
-except OSError as err:
-raise Error(cannot synchronize image file '%s': %s  \
-% (self._image_path, err.strerror))
-
-# Check if the FIEMAP ioctl is supported
-self.block_is_mapped(0)
-
-def __del__(self):
- The class destructor which closes the opened files. 
-
-if self._f_image_needs_close:
-self._f_image.close()
-
-def _invoke_fiemap(self, block, count):
- Invoke the FIEMAP ioctl for 'count' blocks of the file starting 
from
-block number 'block

[OE-core] [PATCH 03/35] wic: Remove packaging, config commands

2014-08-08 Thread Tom Zanussi
Remove commands related to repos, packaging, configuration

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/kickstart/__init__.py | 763 --
 1 file changed, 763 deletions(-)

diff --git a/scripts/lib/mic/kickstart/__init__.py 
b/scripts/lib/mic/kickstart/__init__.py
index 11cdf63..590bf47 100644
--- a/scripts/lib/mic/kickstart/__init__.py
+++ b/scripts/lib/mic/kickstart/__init__.py
@@ -34,54 +34,6 @@ from mic import msger
 from mic.utils import errors, misc, runner, fs_related as fs
 from custom_commands import wicboot, partition
 
-
-AUTH_URL_PTN = 
r(?Pscheme.*)://(?Pusername.*)(:?Ppassword.*)?@(?Purl.*)
-
-
-class PrepackageSection(kssections.Section):
-sectionOpen = %prepackages
-
-def handleLine(self, line):
-if not self.handler:
-return
-
-(h, s, t) = line.partition('#')
-line = h.rstrip()
-
-self.handler.prepackages.add([line])
-
-def handleHeader(self, lineno, args):
-kssections.Section.handleHeader(self, lineno, args)
-
-class AttachmentSection(kssections.Section):
-sectionOpen = %attachment
-
-def handleLine(self, line):
-if not self.handler:
-return
-
-(h, s, t) = line.partition('#')
-line = h.rstrip()
-
-self.handler.attachment.add([line])
-
-def handleHeader(self, lineno, args):
-kssections.Section.handleHeader(self, lineno, args)
-
-def apply_wrapper(func):
-def wrapper(*kargs, **kwargs):
-try:
-func(*kargs, **kwargs)
-except (OSError, IOError, errors.KsError), err:
-cfgcls = kargs[0].__class__.__name__
-if msger.ask(Failed to apply %s, skip and continue? % cfgcls):
-msger.warning(%s % err)
-pass
-else:
-# just throw out the exception
-raise
-return wrapper
-
 def read_kickstart(path):
 Parse a kickstart file and return a KickstartParser instance.
 
@@ -105,12 +57,8 @@ def read_kickstart(path):
 class KSHandlers(superclass):
 def __init__(self):
 superclass.__init__(self, mapping=commandMap[using_version])
-self.prepackages = ksparser.Packages()
-self.attachment = ksparser.Packages()
 
 ks = ksparser.KickstartParser(KSHandlers(), errorsAreFatal=False)
-ks.registerSection(PrepackageSection(ks.handler))
-ks.registerSection(AttachmentSection(ks.handler))
 
 try:
 ks.readKickstart(path)
@@ -123,526 +71,6 @@ def read_kickstart(path):
 
 return ks
 
-class KickstartConfig(object):
-A base class for applying kickstart configurations to a system.
-def __init__(self, instroot):
-self.instroot = instroot
-
-def path(self, subpath):
-return self.instroot + subpath
-
-def _check_sysconfig(self):
-if not os.path.exists(self.path(/etc/sysconfig)):
-fs.makedirs(self.path(/etc/sysconfig))
-
-def chroot(self):
-os.chroot(self.instroot)
-os.chdir(/)
-
-def call(self, args):
-if not os.path.exists(%s/%s %(self.instroot, args[0])):
-raise errors.KsError(Can't find %s in chroot % args[0])
-subprocess.call(args, preexec_fn = self.chroot)
-
-def apply(self):
-pass
-
-class LanguageConfig(KickstartConfig):
-A class to apply a kickstart language configuration to a system.
-@apply_wrapper
-def apply(self, kslang):
-self._check_sysconfig()
-if kslang.lang:
-f = open(self.path(/etc/sysconfig/i18n), w+)
-f.write(LANG=\ + kslang.lang + \\n)
-f.close()
-
-class KeyboardConfig(KickstartConfig):
-A class to apply a kickstart keyboard configuration to a system.
-@apply_wrapper
-def apply(self, kskeyboard):
-#
-# FIXME:
-#   should this impact the X keyboard config too?
-#   or do we want to make X be able to do this mapping?
-#
-#k = rhpl.keyboard.Keyboard()
-#if kskeyboard.keyboard:
-#   k.set(kskeyboard.keyboard)
-#k.write(self.instroot)
-pass
-
-class TimezoneConfig(KickstartConfig):
-A class to apply a kickstart timezone configuration to a system.
-@apply_wrapper
-def apply(self, kstimezone):
-self._check_sysconfig()
-tz = kstimezone.timezone or America/New_York
-utc = str(kstimezone.isUtc)
-
-f = open(self.path(/etc/sysconfig/clock), w+)
-f.write(ZONE=\ + tz + \\n)
-f.write(UTC= + utc + \n)
-f.close()
-tz_source = /usr/share/zoneinfo/%s % (tz)
-tz_dest = /etc/localtime
-try:
-cpcmd = fs.find_binary_inchroot('cp', self.instroot)
-if cpcmd:
-self.call([cpcmd, -f, tz_source, tz_dest])
-else:
-cpcmd = fs.find_binary_path('cp')
-subprocess.call([cpcmd, -f

[OE-core] [PATCH 04/35] wic: Remove mic bootstrap

2014-08-08 Thread Tom Zanussi
packaging bootstrap, not needed

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/bootstrap.py | 279 ---
 1 file changed, 279 deletions(-)
 delete mode 100644 scripts/lib/mic/bootstrap.py

diff --git a/scripts/lib/mic/bootstrap.py b/scripts/lib/mic/bootstrap.py
deleted file mode 100644
index 66c291b..000
--- a/scripts/lib/mic/bootstrap.py
+++ /dev/null
@@ -1,279 +0,0 @@
-#!/usr/bin/python -tt
-#
-# Copyright (c) 2009, 2010, 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-from __future__ import with_statement
-import os
-import sys
-import tempfile
-import shutil
-import subprocess
-import rpm
-from mic import msger
-from mic.utils import errors, proxy, misc
-from mic.utils.rpmmisc import readRpmHeader, RPMInstallCallback
-from mic.chroot import cleanup_mounts, setup_chrootenv, cleanup_chrootenv
-
-PATH_BOOTSTRAP = /usr/sbin:/usr/bin:/sbin:/bin
-
-RPMTRANS_FLAGS = [
-   rpm.RPMTRANS_FLAG_ALLFILES,
-   rpm.RPMTRANS_FLAG_NOSCRIPTS,
-   rpm.RPMTRANS_FLAG_NOTRIGGERS,
- ]
-
-RPMVSF_FLAGS = [
- rpm._RPMVSF_NOSIGNATURES,
- rpm._RPMVSF_NODIGESTS
-   ]
-
-RPMPROB_FLAGS = [
-  rpm.RPMPROB_FILTER_OLDPACKAGE,
-  rpm.RPMPROB_FILTER_REPLACEPKG,
-  rpm.RPMPROB_FILTER_IGNOREARCH
-]
-
-class MiniBackend(object):
-def __init__(self, rootdir, arch=None, repomd=None):
-self._ts = None
-self.rootdir = os.path.abspath(rootdir)
-self.arch = arch
-self.repomd = repomd
-self.dlpkgs = []
-self.localpkgs = {}
-self.optionals = []
-self.preins = {}
-self.postins = {}
-self.scriptlets = False
-
-def __del__(self):
-try:
-del self.ts
-except:
-pass
-
-def get_ts(self):
-if not self._ts:
-self._ts = rpm.TransactionSet(self.rootdir)
-self._ts.setFlags(reduce(lambda x, y: x|y, RPMTRANS_FLAGS))
-self._ts.setVSFlags(reduce(lambda x, y: x|y, RPMVSF_FLAGS))
-self._ts.setProbFilter(reduce(lambda x, y: x|y, RPMPROB_FLAGS))
-
-return self._ts
-
-def del_ts(self):
-if self._ts:
-self._ts.closeDB()
-self._ts = None
-
-ts = property(fget = lambda self: self.get_ts(),
-  fdel = lambda self: self.del_ts(),
-  doc=TransactionSet object)
-
-def selectPackage(self, pkg):
-if not pkg in self.dlpkgs:
-self.dlpkgs.append(pkg)
-
-def runInstall(self):
-# FIXME: check space
-self.downloadPkgs()
-self.installPkgs()
-
-if not self.scriptlets:
-return
-
-for pkg in self.preins.keys():
-prog, script = self.preins[pkg]
-self.run_pkg_script(pkg, prog, script, '0')
-for pkg in self.postins.keys():
-prog, script = self.postins[pkg]
-self.run_pkg_script(pkg, prog, script, '1')
-
-def downloadPkgs(self):
-nonexist = []
-for pkg in self.dlpkgs:
-localpth = misc.get_package(pkg, self.repomd, self.arch)
-if localpth:
-self.localpkgs[pkg] = localpth
-elif pkg in self.optionals:
-# skip optional rpm
-continue
-else:
-# mark nonexist rpm
-nonexist.append(pkg)
-
-if nonexist:
-raise errors.BootstrapError(Can't get rpm binary: %s %
-','.join(nonexist))
-
-def installPkgs(self):
-for pkg in self.localpkgs.keys():
-rpmpath = self.localpkgs[pkg]
-
-hdr = readRpmHeader(self.ts, rpmpath)
-
-# save prein and postin scripts
-self.preins[pkg] = (hdr['PREINPROG'], hdr['PREIN'])
-self.postins[pkg] = (hdr['POSTINPROG'], hdr['POSTIN'])
-
-# mark pkg as install
-self.ts.addInstall(hdr, rpmpath, 'u')
-
-# run transaction
-self.ts.order()
-cb = RPMInstallCallback(self.ts)
-self.ts.run(cb.callback, '')
-
-def run_pkg_script(self, pkg, prog, script, arg):
-mychroot = lambda: os.chroot

[OE-core] [PATCH 24/35] wic: Update 'Background and Motivation' help section

2014-08-08 Thread Tom Zanussi
Remove help text regarding the source and future intentions of the wic
codebase, since the code prompting those comments has now been mostly
removed.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/help.py | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index 6e8e037..6503aaa 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -456,24 +456,12 @@ DESCRIPTION
 oe-core: directdisk.bbclass and mkefidisk.sh.  The difference
 between wic and those examples is that with wic the functionality
 of those scripts is implemented by a general-purpose partitioning
-'language' based on Redhat kickstart syntax (with the underlying
-code borrowed from Tizen mic, which in turn was borrowed from
-Meego mic, in turn borrowed from Fedora livecd, etc.).
+'language' based on Redhat kickstart syntax).
 
 The initial motivation and design considerations that lead to the
 current tool are described exhaustively in Yocto Bug #3847
 (https://bugzilla.yoctoproject.org/show_bug.cgi?id=3847).
 
-Though the current wic tool only uses the kickstart syntax related
-to partitioning and bootloaders and only for creating images,
-because the code is based on the mic/pykickstart code, future
-deployment efforts such as those partially described by Yocto Bug
-#4106 (https://bugzilla.yoctoproject.org/show_bug.cgi?id=4106),
-but also others including package selection (from e.g. binary
-feeds) and deployment configuration of users/network/services,
-etc, could be implemented under this framework, considering that
-all of those are implemented in some form by the base system.
-
   Implementation and Examples
 
 wic can be used in two different modes, depending on how much
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 22/35] wic: Clean up Creator

2014-08-08 Thread Tom Zanussi
wic doesn't use a lot of Creator, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/creator.py | 176 ++---
 1 file changed, 6 insertions(+), 170 deletions(-)

diff --git a/scripts/lib/mic/creator.py b/scripts/lib/mic/creator.py
index 267928f..7c9ca6f 100644
--- a/scripts/lib/mic/creator.py
+++ b/scripts/lib/mic/creator.py
@@ -44,7 +44,7 @@ class Creator(cmdln.Cmdln):
 # mix-in do_subcmd interface
 for subcmd, klass in pluginmgr.get_plugins('imager').iteritems():
 if not hasattr(klass, 'do_create'):
-msger.warning(Unsurpport subcmd: %s % subcmd)
+msger.warning(Unsupported subcmd: %s % subcmd)
 continue
 
 func = getattr(klass, 'do_create')
@@ -65,59 +65,12 @@ class Creator(cmdln.Cmdln):
 optparser.add_option('-c', '--config', type='string', dest='config',
  default=None,
  help='Specify config file for mic')
-optparser.add_option('-k', '--cachedir', type='string', action='store',
- dest='cachedir', default=None,
- help='Cache directory to store the downloaded')
 optparser.add_option('-o', '--outdir', type='string', action='store',
  dest='outdir', default=None,
  help='Output directory')
-optparser.add_option('-A', '--arch', type='string', dest='arch',
- default=None,
- help='Specify repo architecture')
-optparser.add_option('', '--release', type='string', dest='release',
- default=None, metavar='RID',
- help='Generate a release of RID with all 
necessary'
-  ' files, when @BUILD_ID@ is contained in '
-  'kickstart file, it will be replaced by RID')
-optparser.add_option(, --record-pkgs, type=string,
- dest=record_pkgs, default=None,
- help='Record the info of installed packages, '
-  'multiple values can be specified which '
-  'joined by ,, valid values: name, '
-  'content, license, vcs')
-optparser.add_option('', '--pkgmgr', type='string', dest='pkgmgr',
- default=None,
- help='Specify backend package manager')
-optparser.add_option('', '--local-pkgs-path', type='string',
- dest='local_pkgs_path', default=None,
- help='Path for local pkgs(rpms) to be installed')
-optparser.add_option('', '--runtime', type='string',
- dest='runtime', default=None,
- help='Specify  runtime mode, avaiable: bootstrap, 
native')
-# --taring-to is alias to --pack-to
-optparser.add_option('', '--taring-to', type='string',
- dest='pack_to', default=None,
- help=SUPPRESS_HELP)
-optparser.add_option('', '--pack-to', type='string',
- dest='pack_to', default=None,
- help='Pack the images together into the specified'
-  ' achive, extension supported: .zip, .tar, '
-  '.tar.gz, .tar.bz2, etc. by default, .tar '
-  'will be used')
-optparser.add_option('', '--copy-kernel', action='store_true',
- dest='copy_kernel',
- help='Copy kernel files from image /boot 
directory'
-  ' to the image output directory.')
-optparser.add_option('', '--install-pkgs', type='string', 
action='store',
- dest='install_pkgs', default=None,
- help='Specify what type of packages to be 
installed,'
-  ' valid: source, debuginfo, debugsource')
 optparser.add_option('', '--tmpfs', action='store_true', 
dest='enabletmpfs',
  help='Setup tmpdir as tmpfs to accelerate, 
experimental'
   ' feature, use it if you have more than 4G 
memory')
-optparser.add_option('', '--repourl', action='append',
- dest='repourl', default=[],
- help=SUPPRESS_HELP)
 return optparser
 
 def preoptparse(self, argv):
@@ -183,78 +136,16 @@ class Creator(cmdln.Cmdln):
 
 if self.options.outdir is not None:
 configmgr.create['outdir'] = abspath(self.options.outdir)
-if self.options.cachedir is not None

[OE-core] [PATCH 27/35] wic: Update/rename/delete mount-related code

2014-08-08 Thread Tom Zanussi
The wic code inherited a basic image-creation flow based on mounting
loop devices, but wic doesn't actually mount anything, so rename parts
of the code dealing with mounting to something more appropriate, and
remove related unused code.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/baseimager.py| 47 +
 scripts/lib/mic/imager/direct.py| 42 ++
 scripts/lib/mic/plugins/imager/direct_plugin.py |  2 +-
 scripts/lib/mic/utils/partitionedfs.py  | 37 ++-
 4 files changed, 22 insertions(+), 106 deletions(-)

diff --git a/scripts/lib/mic/imager/baseimager.py 
b/scripts/lib/mic/imager/baseimager.py
index 0d591ea..7f32dd5 100644
--- a/scripts/lib/mic/imager/baseimager.py
+++ b/scripts/lib/mic/imager/baseimager.py
@@ -97,41 +97,15 @@ class BaseImageCreator(object):
 
 
 #
-# Properties
-#
-def __get_instroot(self):
-if self.__builddir is None:
-raise CreatorError(_instroot is not valid before calling mount())
-return self.__builddir + /install_root
-_instroot = property(__get_instroot)
-The location of the install root directory.
-
-This is the directory into which the system is installed. Subclasses may
-mount a filesystem image here or copy files to/from here.
-
-Note, this directory does not exist before ImageCreator.mount() is called.
-
-Note also, this is a read-only attribute.
-
-
-
-
-#
 # Hooks for subclasses
 #
-def _mount_instroot(self, base_on = None):
-Mount or prepare the install root directory.
+def _create(self):
+Create partitions for the disk image(s)
 
-This is the hook where subclasses may prepare the install root by e.g.
-mounting creating and loopback mounting a filesystem image to
-_instroot.
+This is the hook where subclasses may create the partitions
+that will be assembled into disk image(s).
 
 There is no default implementation.
-
-base_on -- this is the value passed to mount() and can be interpreted
-   as the subclass wishes; it might e.g. be the location of
-   a previously created ISO containing a system image.
-
 
 pass
 
@@ -176,19 +150,16 @@ class BaseImageCreator(object):
 
 runner.show('umount -l %s' % self.workdir)
 
-def mount(self):
-Setup the target filesystem in preparation for an install.
+def create(self):
+Create partitions for the disk image(s)
 
-This function sets up the filesystem which the ImageCreator will
-install into and configure. The ImageCreator class merely creates an
-install root directory, bind mounts some system directories (e.g. /dev)
-and writes out /etc/fstab. Other subclasses may also e.g. create a
-sparse file, format it and loopback mount it to the install root.
+Create the partitions that will be assembled into disk
+image(s).
 
 self.__setup_tmpdir()
 self.__ensure_builddir()
 
-self._mount_instroot()
+self._create()
 
 def unmount(self):
 Unmounts the target filesystem.
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index 2e6914b..b96740d 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -79,9 +79,10 @@ class DirectImageCreator(BaseImageCreator):
 self.staging_data_dir = staging_data_dir
 
 def __write_fstab(self, image_rootfs):
-overriden to generate fstab (temporarily) in rootfs. This
-is called from mount_instroot, make sure it doesn't get called
-from BaseImage.mount()
+overriden to generate fstab (temporarily) in rootfs. This is called
+from _create, make sure it doesn't get called from
+BaseImage.create()
+
 if image_rootfs is None:
 return None
 
@@ -217,29 +218,15 @@ class DirectImageCreator(BaseImageCreator):
 #
 # Actual implemention
 #
-def _mount_instroot(self):
+def _create(self):
 
-For 'wic', we already have our build artifacts and don't want
-to loop mount anything to install into, we just create
+For 'wic', we already have our build artifacts - we just create
 filesystems from the artifacts directly and combine them into
 a partitioned image.
-
-We still want to reuse as much of the basic mic machinery
-though; despite the fact that we don't actually do loop or any
-other kind of mounting we still want to do many of the same
-things to prepare images, so we basically just adapt to the
-basic framework and reinterpret what 'mounting' means in our
-context.
-
-_instroot would normally be something like
-/var/tmp/wic/build/imgcreate-s_9AKQ/install_root

[OE-core] [PATCH 19/35] wic: Clean up BaseImageCreator

2014-08-08 Thread Tom Zanussi
wic doesn't use a lot of BaseImageCreator, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/baseimager.py | 1030 +-
 scripts/lib/mic/imager/direct.py |4 +-
 2 files changed, 9 insertions(+), 1025 deletions(-)

diff --git a/scripts/lib/mic/imager/baseimager.py 
b/scripts/lib/mic/imager/baseimager.py
index b721249..55f2dea 100644
--- a/scripts/lib/mic/imager/baseimager.py
+++ b/scripts/lib/mic/imager/baseimager.py
@@ -18,37 +18,31 @@
 
 from __future__ import with_statement
 import os, sys
-import stat
 import tempfile
 import shutil
-import subprocess
-import re
-import tarfile
-import glob
 
 from mic import kickstart
 from mic import msger
-from mic.utils.errors import CreatorError, Abort
+from mic.utils.errors import CreatorError
 from mic.utils import misc, runner, fs_related as fs
 
 class BaseImageCreator(object):
-Installs a system to a chroot directory.
+Base class for image creation.
 
-ImageCreator is the simplest creator class available; it will install and
-configure a system image according to the supplied kickstart file.
+BaseImageCreator is the simplest creator class available; it will
+create a system image according to the supplied kickstart file.
 
 e.g.
 
   import mic.imgcreate as imgcreate
   ks = imgcreate.read_kickstart(foo.ks)
   imgcreate.ImageCreator(ks, foo).create()
-
 
 
 def __del__(self):
 self.cleanup()
 
-def __init__(self, createopts = None, pkgmgr = None):
+def __init__(self, createopts = None):
 Initialize an ImageCreator instance.
 
 ks -- a pykickstart.KickstartParser instance; this instance will be
@@ -59,36 +53,19 @@ class BaseImageCreator(object):
 filesystem labels
 
 
-self.pkgmgr = pkgmgr
-
 self.__builddir = None
-self.__bindmounts = []
 
 self.ks = None
 self.name = target
 self.tmpdir = /var/tmp/wic
-self.cachedir = /var/tmp/wic/cache
 self.workdir = /var/tmp/wic/build
 
-self.destdir = .
-self.installerfw_prefix = INSTALLERFW_
-self.target_arch = noarch
-self._local_pkgs_path = None
-self.pack_to = None
-self.repourl = {}
-
-# If the kernel is save to the destdir when copy_kernel cmd is called.
-self._need_copy_kernel = False
 # setup tmpfs tmpdir when enabletmpfs is True
 self.enabletmpfs = False
 
 if createopts:
 # Mapping table for variables that have different names.
-optmap = {pkgmgr : pkgmgr_name,
-  outdir : destdir,
-  arch : target_arch,
-  local_pkgs_path : _local_pkgs_path,
-  copy_kernel : _need_copy_kernel,
+optmap = {outdir : destdir,
  }
 
 # update setting from createopts
@@ -101,41 +78,11 @@ class BaseImageCreator(object):
 
 self.destdir = os.path.abspath(os.path.expanduser(self.destdir))
 
-if 'release' in createopts and createopts['release']:
-self.name = createopts['release'] + '_' + self.name
-
-if self.pack_to:
-if '@NAME@' in self.pack_to:
-self.pack_to = self.pack_to.replace('@NAME@', self.name)
-(tar, ext) = os.path.splitext(self.pack_to)
-if ext in (.gz, .bz2) and tar.endswith(.tar):
-ext = .tar + ext
-if ext not in misc.pack_formats:
-self.pack_to += .tar
-
-self._dep_checks = [ls, bash, cp, echo, modprobe]
+self._dep_checks = [ls, bash, cp, echo]
 
 # Output image file names
 self.outimage = []
 
-# A flag to generate checksum
-self._genchecksum = False
-
-self._alt_initrd_name = None
-
-self._recording_pkgs = []
-
-# available size in root fs, init to 0
-self._root_fs_avail = 0
-
-# Name of the disk image file that is created.
-self._img_name = None
-
-self.image_format = None
-
-# Save qemu emulator file name in order to clean up it finally
-self.qemu_emulator = None
-
 # No ks provided when called by convertor, so skip the dependency check
 if self.ks:
 # If we have btrfs partition we need to check necessary tools
@@ -144,31 +91,9 @@ class BaseImageCreator(object):
 self._dep_checks.append(mkfs.btrfs)
 break
 
-if self.target_arch and self.target_arch.startswith(arm):
-for dep in self._dep_checks:
-if dep == extlinux:
-self._dep_checks.remove(dep)
-
-if not os.path.exists(/usr/bin/qemu-arm) or \
-   not misc.is_statically_linked(/usr/bin/qemu-arm):
-self._dep_checks.append(qemu-arm-static

[OE-core] [PATCH 23/35] wic: Remove unused command versioning support

2014-08-08 Thread Tom Zanussi
The default is F16 and there's no reason to change that, so remove
everything else.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 .../3rdparty/pykickstart/commands/bootloader.py|  49 --
 .../mic/3rdparty/pykickstart/commands/partition.py |  39 -
 .../mic/3rdparty/pykickstart/handlers/control.py   | 169 -
 .../lib/mic/3rdparty/pykickstart/handlers/f10.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f11.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f12.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f13.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f14.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f15.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f7.py|  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f8.py|  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/f9.py|  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/fc3.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/fc4.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/fc5.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/fc6.py   |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/rhel3.py |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/rhel4.py |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/rhel5.py |  24 ---
 .../lib/mic/3rdparty/pykickstart/handlers/rhel6.py |  24 ---
 20 files changed, 665 deletions(-)
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f10.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f11.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f12.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f13.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f14.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f15.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f7.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f8.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f9.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc3.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc4.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc5.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc6.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel3.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel4.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel5.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel6.py

diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/bootloader.py 
b/scripts/lib/mic/3rdparty/pykickstart/commands/bootloader.py
index b227fac..c2b552f 100644
--- a/scripts/lib/mic/3rdparty/pykickstart/commands/bootloader.py
+++ b/scripts/lib/mic/3rdparty/pykickstart/commands/bootloader.py
@@ -214,52 +214,3 @@ class F15_Bootloader(F14_Bootloader):
 op.add_option(--iscrypted, dest=isCrypted, action=store_true, 
default=False)
 op.add_option(--md5pass, action=callback, callback=password_cb, 
nargs=1, type=string)
 return op
-
-class RHEL5_Bootloader(FC4_Bootloader):
-removedKeywords = FC4_Bootloader.removedKeywords
-removedAttrs = FC4_Bootloader.removedAttrs
-
-def __init__(self, writePriority=10, *args, **kwargs):
-FC4_Bootloader.__init__(self, writePriority, *args, **kwargs)
-
-self.hvArgs = kwargs.get(hvArgs, )
-
-def _getArgsAsStr(self):
-ret = FC4_Bootloader._getArgsAsStr(self)
-
-if self.hvArgs:
-ret +=  --hvargs=\%s\ %(self.hvArgs,)
-
-return ret
-
-def _getParser(self):
-op = FC4_Bootloader._getParser(self)
-op.add_option(--hvargs, dest=hvArgs, type=string)
-return op
-
-class RHEL6_Bootloader(F12_Bootloader):
-removedKeywords = F12_Bootloader.removedKeywords
-removedAttrs = F12_Bootloader.removedAttrs
-
-def __init__(self, writePriority=10, *args, **kwargs):
-F12_Bootloader.__init__(self, writePriority, *args, **kwargs)
-
-self.isCrypted = kwargs.get(isCrypted, False)
-
-def _getArgsAsStr(self):
-ret = F12_Bootloader._getArgsAsStr(self)
-
-if self.isCrypted:
-ret +=  --iscrypted
-
-return ret
-
-def _getParser(self):
-def password_cb(option, opt_str, value, parser):
-parser.values.isCrypted = True
-parser.values.password = value
-
-op = F12_Bootloader._getParser(self)
-op.add_option(--iscrypted, dest=isCrypted, action=store_true, 
default=False)
-op.add_option(--md5pass, action=callback, callback=password_cb, 
nargs=1, type=string)
-return op
diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/partition.py 
b/scripts/lib/mic/3rdparty/pykickstart/commands/partition.py
index e65e012..56b91aa 100644

[OE-core] [PATCH 21/35] wic: Clean up PartitionedMount

2014-08-08 Thread Tom Zanussi
wic doesn't use a lot of ParitionedMount, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/partitionedfs.py | 355 +
 1 file changed, 2 insertions(+), 353 deletions(-)

diff --git a/scripts/lib/mic/utils/partitionedfs.py 
b/scripts/lib/mic/utils/partitionedfs.py
index 0c4c9ec..ef92125 100644
--- a/scripts/lib/mic/utils/partitionedfs.py
+++ b/scripts/lib/mic/utils/partitionedfs.py
@@ -33,18 +33,13 @@ MBR_OVERHEAD = 1
 SECTOR_SIZE = 512
 
 class PartitionedMount(Mount):
-def __init__(self, mountdir, skipformat = False):
+def __init__(self, mountdir):
 Mount.__init__(self, mountdir)
 self.disks = {}
 self.partitions = []
-self.subvolumes = []
-self.mapped = False
 self.mountOrder = []
 self.unmountOrder = []
 self.parted = find_binary_path(parted)
-self.btrfscmd=None
-self.skipformat = skipformat
-self.snapshot_created = self.skipformat
 # Size of a sector used in calculations
 self.sector_size = SECTOR_SIZE
 self._partitions_layed_out = False
@@ -62,7 +57,6 @@ class PartitionedMount(Mount):
 
 self.disks[disk_name] = \
 { 'disk': None, # Disk object
-  'mapped': False,  # True if kpartx mapping exists
   'numpart': 0, # Number of allocate partitions
   'partitions': [], # Indexes to self.partitions
   'offset': 0,  # Offset of next partition (in sectors)
@@ -98,40 +92,8 @@ class PartitionedMount(Mount):
 # Converting MB to sectors for parted
 size = size * 1024 * 1024 / self.sector_size
 
-# We need to handle subvolumes for btrfs
-if fstype == btrfs and fsopts and fsopts.find(subvol=) != -1:
-self.btrfscmd=find_binary_path(btrfs)
-subvol = None
-opts = fsopts.split(,)
-for opt in opts:
-if opt.find(subvol=) != -1:
-subvol = opt.replace(subvol=, ).strip()
-break
-if not subvol:
-raise MountError(No subvolume: %s % fsopts)
-self.subvolumes.append({'size': size, # In sectors
-'mountpoint': mountpoint, # Mount relative 
to chroot
-'fstype': fstype, # Filesystem type
-'fsopts': fsopts, # Filesystem mount 
options
-'disk_name': disk_name, # physical disk 
name holding partition
-'device': None, # kpartx device node for 
partition
-'mount': None, # Mount object
-'subvol': subvol, # Subvolume name
-'boot': boot, # Bootable flag
-'mounted': False # Mount flag
-   })
-
 # We still need partition for / or non-subvolume
-if mountpoint == / or not fsopts or fsopts.find(subvol=) == -1:
-# Don't need subvolume for / because it will be set as default 
subvolume
-if fsopts and fsopts.find(subvol=) != -1:
-opts = fsopts.split(,)
-for opt in opts:
-if opt.strip().startswith(subvol=):
-opts.remove(opt)
-break
-fsopts = ,.join(opts)
-
+if mountpoint == / or not fsopts:
 part = { 'ks_pnum' : ks_pnum, # Partition number in the KS file
  'size': size, # In sectors
  'mountpoint': mountpoint, # Mount relative to chroot
@@ -283,10 +245,6 @@ class PartitionedMount(Mount):
 def __format_disks(self):
 self.layout_partitions()
 
-if self.skipformat:
-msger.debug(Skipping disk format, because skipformat flag is 
set.)
-return
-
 for dev in self.disks.keys():
 d = self.disks[dev]
 msger.debug(Initializing partition table for %s % \
@@ -346,103 +304,6 @@ class PartitionedMount(Mount):
 self.__run_parted([-s, d['disk'].device, set,
%d % p['num'], lba, off])
 
-
-def __map_partitions(self):
-Load it if dm_snapshot isn't loaded. 
-load_module(dm_snapshot)
-
-for dev in self.disks.keys():
-d = self.disks[dev]
-if d['mapped']:
-continue
-
-msger.debug(Running kpartx on %s % d['disk'].device )
-rc, kpartxOutput = runner.runtool([self.kpartx, -l, -v, 
d['disk'].device])
-kpartxOutput = kpartxOutput.splitlines()
-
-if rc != 0:
-raise MountError(Failed to query partition mapping for '%s' %
- d['disk'].device

[OE-core] [PATCH 13/35] wic: Remove unused fs_related code

2014-08-08 Thread Tom Zanussi
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/fs_related.py | 930 
 1 file changed, 930 deletions(-)

diff --git a/scripts/lib/mic/utils/fs_related.py 
b/scripts/lib/mic/utils/fs_related.py
index 182171f..e6e362d 100644
--- a/scripts/lib/mic/utils/fs_related.py
+++ b/scripts/lib/mic/utils/fs_related.py
@@ -31,19 +31,6 @@ from mic.utils import runner
 from mic.utils.errors import *
 from mic.utils.oe.misc import *
 
-def find_binary_inchroot(binary, chroot):
-paths = [/usr/sbin,
- /usr/bin,
- /sbin,
- /bin
-]
-
-for path in paths:
-bin_path = %s/%s % (path, binary)
-if os.path.exists(%s/%s % (chroot, bin_path)):
-return bin_path
-return None
-
 def find_binary_path(binary):
 if os.environ.has_key(PATH):
 paths = os.environ[PATH].split(:)
@@ -72,176 +59,6 @@ def makedirs(dirname):
 if err.errno != errno.EEXIST:
 raise
 
-def mksquashfs(in_img, out_img):
-fullpathmksquashfs = find_binary_path(mksquashfs)
-args = [fullpathmksquashfs, in_img, out_img]
-
-if not sys.stdout.isatty():
-args.append(-no-progress)
-
-ret = runner.show(args)
-if ret != 0:
-raise SquashfsError('%s' exited with error (%d) % (' '.join(args), 
ret))
-
-def resize2fs(fs, size):
-resize2fs = find_binary_path(resize2fs)
-if size == 0:
-# it means to minimalize it
-return runner.show([resize2fs, '-M', fs])
-else:
-return runner.show([resize2fs, fs, %sK % (size / 1024,)])
-
-def my_fuser(fp):
-fuser = find_binary_path(fuser)
-if not os.path.exists(fp):
-return False
-
-rc = runner.quiet([fuser, -s, fp])
-if rc == 0:
-for pid in runner.outs([fuser, fp]).split():
-fd = open(/proc/%s/cmdline % pid, r)
-cmdline = fd.read()
-fd.close()
-if cmdline[:-1] == /bin/bash:
-return True
-
-# not found
-return False
-
-class BindChrootMount:
-Represents a bind mount of a directory into a chroot.
-def __init__(self, src, chroot, dest = None, option = None):
-self.root = os.path.abspath(os.path.expanduser(chroot))
-self.option = option
-
-self.orig_src = self.src = src
-if os.path.islink(src):
-self.src = os.readlink(src)
-if not self.src.startswith('/'):
-self.src = os.path.abspath(os.path.join(os.path.dirname(src),
-self.src))
-
-if not dest:
-dest = self.src
-self.dest = os.path.join(self.root, dest.lstrip('/'))
-
-self.mounted = False
-self.mountcmd = find_binary_path(mount)
-self.umountcmd = find_binary_path(umount)
-
-def ismounted(self):
-with open('/proc/mounts') as f:
-for line in f:
-if line.split()[1] == os.path.abspath(self.dest):
-return True
-
-return False
-
-def has_chroot_instance(self):
-lock = os.path.join(self.root, .chroot.lock)
-return my_fuser(lock)
-
-def mount(self):
-if self.mounted or self.ismounted():
-return
-
-makedirs(self.dest)
-rc = runner.show([self.mountcmd, --bind, self.src, self.dest])
-if rc != 0:
-raise MountError(Bind-mounting '%s' to '%s' failed %
- (self.src, self.dest))
-if self.option:
-rc = runner.show([self.mountcmd, --bind, -o, remount,%s % 
self.option, self.dest])
-if rc != 0:
-raise MountError(Bind-remounting '%s' failed % self.dest)
-
-self.mounted = True
-if os.path.islink(self.orig_src):
-dest = os.path.join(self.root, self.orig_src.lstrip('/'))
-if not os.path.exists(dest):
-os.symlink(self.src, dest)
-
-def unmount(self):
-if self.has_chroot_instance():
-return
-
-if self.ismounted():
-runner.show([self.umountcmd, -l, self.dest])
-self.mounted = False
-
-class LoopbackMount:
-LoopbackMount  compatibility layer for old API
-def __init__(self, lofile, mountdir, fstype = None):
-self.diskmount = DiskMount(LoopbackDisk(lofile,size = 
0),mountdir,fstype,rmmountdir = True)
-self.losetup = False
-self.losetupcmd = find_binary_path(losetup)
-
-def cleanup(self):
-self.diskmount.cleanup()
-
-def unmount(self):
-self.diskmount.unmount()
-
-def lounsetup(self):
-if self.losetup:
-runner.show([self.losetupcmd, -d, self.loopdev])
-self.losetup = False
-self.loopdev = None
-
-def loopsetup(self):
-if self.losetup:
-return
-
-self.loopdev = get_loop_device(self.losetupcmd

[OE-core] [PATCH 06/35] wic: Remove rt_util

2014-08-08 Thread Tom Zanussi
More package-related stuff we don't need.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/rt_util.py | 223 -
 1 file changed, 223 deletions(-)
 delete mode 100644 scripts/lib/mic/rt_util.py

diff --git a/scripts/lib/mic/rt_util.py b/scripts/lib/mic/rt_util.py
deleted file mode 100644
index 2a31f4a..000
--- a/scripts/lib/mic/rt_util.py
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/python -tt
-#
-# Copyright (c) 2009, 2010, 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-from __future__ import with_statement
-import os
-import sys
-import glob
-import re
-import shutil
-import subprocess
-
-from mic import bootstrap, msger
-from mic.conf import configmgr
-from mic.utils import errors, proxy
-from mic.utils.fs_related import find_binary_path, makedirs
-from mic.chroot import setup_chrootenv, cleanup_chrootenv
-
-expath = lambda p: os.path.abspath(os.path.expanduser(p))
-
-def bootstrap_mic(argv=None):
-
-
-def mychroot():
-os.chroot(rootdir)
-os.chdir(cwd)
-
-# by default, sys.argv is used to run mic in bootstrap
-if not argv:
-argv = sys.argv
-if argv[0] not in ('/usr/bin/mic', 'mic'):
-argv[0] = '/usr/bin/mic'
-
-cropts = configmgr.create
-bsopts = configmgr.bootstrap
-distro = bsopts['distro_name'].lower()
-
-rootdir = bsopts['rootdir']
-pkglist = bsopts['packages']
-cwd = os.getcwd()
-
-# create bootstrap and run mic in bootstrap
-bsenv = bootstrap.Bootstrap(rootdir, distro, cropts['arch'])
-bsenv.logfile = cropts['logfile']
-# rootdir is regenerated as a temp dir
-rootdir = bsenv.rootdir
-
-if 'optional' in bsopts:
-optlist = bsopts['optional']
-else:
-optlist = []
-
-try:
-msger.info(Creating %s bootstrap ... % distro)
-bsenv.create(cropts['repomd'], pkglist, optlist)
-
-# bootstrap is relocated under bootstrap
-if os.path.exists(os.path.join(rootdir, bootstrap)):
-rootdir = os.path.join(rootdir, bootstrap)
-
-bsenv.dirsetup(rootdir)
-sync_mic(rootdir)
-
-#FIXME: sync the ks file to bootstrap
-if / == os.path.dirname(os.path.abspath(configmgr._ksconf)):
-safecopy(configmgr._ksconf, rootdir)
-
-msger.info(Start mic in bootstrap: %s\n % rootdir)
-bindmounts = get_bindmounts(cropts)
-ret = bsenv.run(argv, cwd, rootdir, bindmounts)
-
-except errors.BootstrapError, err:
-msger.warning('\n%s' % err)
-if msger.ask(Switch to native mode and continue?):
-return
-raise
-except RuntimeError, err:
-#change exception type but keep the trace back
-value, tb = sys.exc_info()[1:]
-raise errors.BootstrapError, value, tb
-else:
-sys.exit(ret)
-finally:
-bsenv.cleanup()
-
-def get_bindmounts(cropts):
-binddirs =  [
-  os.getcwd(),
-  cropts['tmpdir'],
-  cropts['cachedir'],
-  cropts['outdir'],
-  cropts['local_pkgs_path'],
-]
-bindfiles = [
-  cropts['logfile'],
-  configmgr._ksconf,
-]
-
-for lrepo in cropts['localrepos']:
-binddirs.append(lrepo)
-
-bindlist = map(expath, filter(None, binddirs))
-bindlist += map(os.path.dirname, map(expath, filter(None, bindfiles)))
-bindlist = sorted(set(bindlist))
-bindmounts = ';'.join(bindlist)
-return bindmounts
-
-
-def get_mic_binpath():
-fp = None
-try:
-import pkg_resources # depends on 'setuptools'
-except ImportError:
-pass
-else:
-dist = pkg_resources.get_distribution('mic')
-# the real script is under EGG_INFO/scripts
-if dist.has_metadata('scripts/mic'):
-fp = os.path.join(dist.egg_info, scripts/mic)
-
-if fp:
-return fp
-
-# not found script if 'flat' egg installed
-try:
-return find_binary_path('mic')
-except errors.CreatorError:
-raise errors.BootstrapError(Can't find mic binary in host OS)
-
-
-def get_mic_modpath():
-try:
-import mic
-except ImportError:
-raise errors.BootstrapError(Can't find mic module in host OS)
-path

[OE-core] [PATCH 33/35] wic: Update Disk description

2014-08-08 Thread Tom Zanussi
Remove obsolete comment.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/fs_related.py | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/scripts/lib/mic/utils/fs_related.py 
b/scripts/lib/mic/utils/fs_related.py
index 07a5ff9..cf2a759 100644
--- a/scripts/lib/mic/utils/fs_related.py
+++ b/scripts/lib/mic/utils/fs_related.py
@@ -60,11 +60,8 @@ def makedirs(dirname):
 raise
 
 class Disk:
-Generic base object for a disk
-
-The 'create' method must make the disk visible as a block device - eg
-by calling losetup. For RawDisk, this is obviously a no-op. The 'cleanup'
-method must undo the 'create' operation.
+
+Generic base object for a disk.
 
 def __init__(self, size, device = None):
 self._device = device
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 15/35] wic: Remove 3rdparty/urlgrabber

2014-08-08 Thread Tom Zanussi
wic doesn't use it, so remove it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 .../3rdparty/pykickstart/urlgrabber/__init__.py|   53 -
 .../3rdparty/pykickstart/urlgrabber/byterange.py   |  463 --
 .../mic/3rdparty/pykickstart/urlgrabber/grabber.py | 1477 
 .../3rdparty/pykickstart/urlgrabber/keepalive.py   |  617 
 .../mic/3rdparty/pykickstart/urlgrabber/mirror.py  |  458 --
 .../3rdparty/pykickstart/urlgrabber/progress.py|  530 ---
 .../3rdparty/pykickstart/urlgrabber/sslfactory.py  |   90 --
 7 files changed, 3688 deletions(-)
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/__init__.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/byterange.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/grabber.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/keepalive.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/mirror.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/progress.py
 delete mode 100644 
scripts/lib/mic/3rdparty/pykickstart/urlgrabber/sslfactory.py

Patch too large to post - see git repository.

-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 25/35] wic: Remove unused conf support

2014-08-08 Thread Tom Zanussi
Also fix up users such as imager functions.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/config/wic.conf   |  1 -
 scripts/lib/mic/conf.py | 39 
 scripts/lib/mic/imager/baseimager.py| 13 ++-
 scripts/lib/mic/imager/direct.py|  6 ++--
 scripts/lib/mic/plugins/imager/direct_plugin.py |  4 +--
 scripts/lib/mic/utils/misc.py   | 48 +
 6 files changed, 8 insertions(+), 103 deletions(-)

diff --git a/scripts/lib/image/config/wic.conf 
b/scripts/lib/image/config/wic.conf
index e96d6ae..a51bcb5 100644
--- a/scripts/lib/image/config/wic.conf
+++ b/scripts/lib/image/config/wic.conf
@@ -4,4 +4,3 @@ distro_name = OpenEmbedded
 
 [create]
 ; settings for create subcommand
-runtime=native
diff --git a/scripts/lib/mic/conf.py b/scripts/lib/mic/conf.py
index 1fe6edd..a686e9c 100644
--- a/scripts/lib/mic/conf.py
+++ b/scripts/lib/mic/conf.py
@@ -31,45 +31,18 @@ def get_siteconf():
 return scripts_path + /lib/image/config/wic.conf
 
 class ConfigMgr(object):
-prefer_backends = [zypp, yum]
-
 DEFAULTS = {'common': {
 distro_name: Default Distribution,
 plugin_dir: /usr/lib/wic/plugins, # TODO use prefix 
also?
 },
 'create': {
 tmpdir: '/var/tmp/wic',
-cachedir: '/var/tmp/wic/cache',
 outdir: './wic-output',
 
-arch: None, # None means auto-detect
-pkgmgr: auto,
-name: output,
-ksfile: None,
-ks: None,
-repomd: None,
-local_pkgs_path: None,
 release: None,
 logfile: None,
-record_pkgs: [],
-pack_to: None,
 name_prefix: None,
 name_suffix: None,
-copy_kernel: False,
-install_pkgs: None,
-repourl: {},
-localrepos: [],  # save localrepos
-runtime: bootstrap,
-},
-'chroot': {
-saveto: None,
-},
-'convert': {
-shell: False,
-},
-'bootstrap': {
-rootdir: '/var/tmp/wic-bootstrap',
-packages: [],
 },
}
 
@@ -116,10 +89,6 @@ class ConfigMgr(object):
 if not ksconf:
 return
 
-ksconf = misc.normalize_ksfile(ksconf,
-   self.create['release'],
-   self.create['arch'])
-
 ks = kickstart.read_kickstart(ksconf)
 
 self.create['ks'] = ks
@@ -130,12 +99,4 @@ class ConfigMgr(object):
   self.create['name_prefix'],
   self.create['name_suffix'])
 
-def set_runtime(self, runtime):
-if runtime not in (bootstrap, native):
-msger.error(Invalid runtime mode: %s % runtime)
-
-if misc.get_distro()[0] in (tizen, Tizen):
-runtime = native
-self.create['runtime'] = runtime
-
 configmgr = ConfigMgr()
diff --git a/scripts/lib/mic/imager/baseimager.py 
b/scripts/lib/mic/imager/baseimager.py
index 55f2dea..0d591ea 100644
--- a/scripts/lib/mic/imager/baseimager.py
+++ b/scripts/lib/mic/imager/baseimager.py
@@ -176,7 +176,7 @@ class BaseImageCreator(object):
 
 runner.show('umount -l %s' % self.workdir)
 
-def mount(self, base_on = None, cachedir = None):
+def mount(self):
 Setup the target filesystem in preparation for an install.
 
 This function sets up the filesystem which the ImageCreator will
@@ -184,20 +184,11 @@ class BaseImageCreator(object):
 install root directory, bind mounts some system directories (e.g. /dev)
 and writes out /etc/fstab. Other subclasses may also e.g. create a
 sparse file, format it and loopback mount it to the install root.
-
-base_on -- a previous install on which to base this install; defaults
-   to None, causing a new image to be created
-
-cachedir -- a directory in which to store the Yum cache; defaults to
-None, causing a new cache to be created; by setting this
-to another directory, the same cache can be reused across
-multiple installs.
-
 
 self.__setup_tmpdir()
 self.__ensure_builddir()
 
-self._mount_instroot(base_on)
+self._mount_instroot()
 
 def unmount(self):
 Unmounts the target filesystem.
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index 92473b5..2e6914b 100644

[OE-core] [PATCH 30/35] wic: Update/rename configure-related code

2014-08-08 Thread Tom Zanussi
The wic code inherited a basic image-creation flow based on
image-configuration, but wic doesn't actually configure anything, so
rename parts of the code dealing with configuration to something more
appropriate.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/direct.py| 7 ---
 scripts/lib/mic/plugins/imager/direct_plugin.py | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index 8d7b6ee..17bfd01 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -284,12 +284,13 @@ class DirectImageCreator(BaseImageCreator):
 % (disk_name, full_path, disk['min_size']))
 self.__image.assemble(full_path)
 
-def configure(self):
+def finalize(self):
 
-Configure the system image according to kickstart.
+Finalize the disk image.
 
-For now, it just prepares the image to be bootable by e.g.
+For example, prepare the image to be bootable by e.g.
 creating and installing a bootloader configuration.
+
 
 source_plugin = self.get_default_source_plugin()
 if source_plugin:
diff --git a/scripts/lib/mic/plugins/imager/direct_plugin.py 
b/scripts/lib/mic/plugins/imager/direct_plugin.py
index 2cbd5d1..ff30f09 100644
--- a/scripts/lib/mic/plugins/imager/direct_plugin.py
+++ b/scripts/lib/mic/plugins/imager/direct_plugin.py
@@ -93,7 +93,7 @@ class DirectPlugin(ImagerPlugin):
 try:
 creator.create()
 creator.assemble()
-creator.configure()
+creator.finalize()
 creator.print_outimage_info()
 
 except errors.CreatorError:
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 11/35] wic: Remove proxy support

2014-08-08 Thread Tom Zanussi
wic doesn't use proxy support, so remove it.

Also remove anything related to proxies in misc and conf, and while
we're at it, remove all the obviously unneeded code from those files -
it's easier to just remove it than to figure out the callchain to the
proxy code usages.

Basically the extra stuff relates to packaging, images, and config
files we don't use.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/conf.py|  58 +--
 scripts/lib/mic/utils/misc.py  | 782 -
 scripts/lib/mic/utils/proxy.py | 183 --
 3 files changed, 1 insertion(+), 1022 deletions(-)
 delete mode 100644 scripts/lib/mic/utils/proxy.py

diff --git a/scripts/lib/mic/conf.py b/scripts/lib/mic/conf.py
index b850d80..1fe6edd 100644
--- a/scripts/lib/mic/conf.py
+++ b/scripts/lib/mic/conf.py
@@ -20,7 +20,7 @@ import ConfigParser
 
 from mic import msger
 from mic import kickstart
-from mic.utils import misc, runner, proxy, errors
+from mic.utils import misc, runner, errors
 
 
 def get_siteconf():
@@ -55,8 +55,6 @@ class ConfigMgr(object):
 pack_to: None,
 name_prefix: None,
 name_suffix: None,
-proxy: None,
-no_proxy: None,
 copy_kernel: False,
 install_pkgs: None,
 repourl: {},
@@ -104,16 +102,6 @@ class ConfigMgr(object):
 for sec, vals in self.DEFAULTS.iteritems():
 setattr(self, sec, vals)
 
-def __set_siteconf(self, siteconf):
-try:
-self.__siteconf = siteconf
-self._parse_siteconf(siteconf)
-except ConfigParser.Error, error:
-raise errors.ConfigError(%s % error)
-def __get_siteconf(self):
-return self.__siteconf
-_siteconf = property(__get_siteconf, __set_siteconf)
-
 def __set_ksconf(self, ksconf):
 if not os.path.isfile(ksconf):
 msger.error('Cannot find ks file: %s' % ksconf)
@@ -124,50 +112,6 @@ class ConfigMgr(object):
 return self.__ksconf
 _ksconf = property(__get_ksconf, __set_ksconf)
 
-def _parse_siteconf(self, siteconf):
-if not siteconf:
-return
-
-if not os.path.exists(siteconf):
-msger.warning(cannot read config file: %s % siteconf)
-return
-
-parser = ConfigParser.SafeConfigParser()
-parser.read(siteconf)
-
-for section in parser.sections():
-if section in self.DEFAULTS:
-getattr(self, section).update(dict(parser.items(section)))
-
-# append common section items to other sections
-for section in self.DEFAULTS.keys():
-if section != common:
-getattr(self, section).update(self.common)
-
-# check and normalize the scheme of proxy url
-if self.create['proxy']:
-m = re.match('^(\w+)://.*', self.create['proxy'])
-if m:
-scheme = m.group(1)
-if scheme not in ('http', 'https', 'ftp', 'socks'):
-msger.error(%s: proxy scheme is incorrect % siteconf)
-else:
-msger.warning(%s: proxy url w/o scheme, use http as default
-  % siteconf)
-self.create['proxy'] = http://; + self.create['proxy']
-
-proxy.set_proxies(self.create['proxy'], self.create['no_proxy'])
-
-# bootstrap option handling
-self.set_runtime(self.create['runtime'])
-if isinstance(self.bootstrap['packages'], basestring):
-packages = self.bootstrap['packages'].replace('\n', ' ')
-if packages.find(',') != -1:
-packages = packages.split(',')
-else:
-packages = packages.split()
-self.bootstrap['packages'] = packages
-
 def _parse_kickstart(self, ksconf=None):
 if not ksconf:
 return
diff --git a/scripts/lib/mic/utils/misc.py b/scripts/lib/mic/utils/misc.py
index 95241d7..8c1f016 100644
--- a/scripts/lib/mic/utils/misc.py
+++ b/scripts/lib/mic/utils/misc.py
@@ -42,15 +42,8 @@ xmlparse = cElementTree.parse
 from mic import msger
 from mic.utils.errors import CreatorError, SquashfsError
 from mic.utils.fs_related import find_binary_path, makedirs
-from mic.utils.proxy import get_proxy_for
 from mic.utils import runner
 
-
-RPM_RE  = re.compile((.*)\.(.*) (.*)-(.*))
-RPM_FMT = %(name)s.%(arch)s %(version)s-%(release)s
-SRPM_RE = re.compile((.*)-(\d+.*)-(\d+\.\d+).src.rpm)
-
-
 def build_name(kscfg, release=None, prefix = None, suffix = None):
 Construct and return an image name string.
 
@@ -123,136 +116,6 @@ def get_distro_str():
 
 _LOOP_RULE_PTH = None
 
-def hide_loopdev_presentation():
-udev_rules = 80-prevent-loop-present.rules
-udev_rules_dir = [
-   '/usr/lib/udev/rules.d/',
-   '/lib/udev/rules.d

[OE-core] [PATCH 32/35] wic: Rename MountError

2014-08-08 Thread Tom Zanussi
wic doesn't mount anything, so can't have a mount error; rename it to
something more appropriate.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/direct.py | 4 ++--
 scripts/lib/mic/plugins/source/bootimg-efi.py| 2 +-
 scripts/lib/mic/plugins/source/bootimg-pcbios.py | 4 ++--
 scripts/lib/mic/utils/errors.py  | 5 +
 scripts/lib/mic/utils/partitionedfs.py   | 8 
 5 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index a4f5691..2f2bd4e 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -32,7 +32,7 @@ import shutil
 from mic import kickstart, msger
 from mic.utils import fs_related, runner, misc
 from mic.utils.partitionedfs import Image
-from mic.utils.errors import CreatorError, MountError
+from mic.utils.errors import CreatorError, ImageError
 from mic.imager.baseimager import BaseImageCreator
 from mic.utils.oe.misc import *
 from mic.plugin import pluginmgr
@@ -358,6 +358,6 @@ class DirectImageCreator(BaseImageCreator):
 if not self.__image is None:
 try:
 self.__image.cleanup()
-except MountError, err:
+except ImageError, err:
 msger.warning(%s % err)
 
diff --git a/scripts/lib/mic/plugins/source/bootimg-efi.py 
b/scripts/lib/mic/plugins/source/bootimg-efi.py
index e880358..5b1a533 100644
--- a/scripts/lib/mic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/mic/plugins/source/bootimg-efi.py
@@ -77,7 +77,7 @@ class BootimgEFIPlugin(SourcePlugin):
 if cr._ptable_format == 'msdos':
 rootstr = rootdev
 else:
-raise MountError(Unsupported partition table format found)
+raise ImageError(Unsupported partition table format found)
 
 grubefi_conf += linux %s root=%s rootwait %s\n \
 % (kernel, rootstr, options)
diff --git a/scripts/lib/mic/plugins/source/bootimg-pcbios.py 
b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
index 53ed7c3..959cf41 100644
--- a/scripts/lib/mic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
@@ -62,7 +62,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
 rc = runner.show(['dd', 'if=%s' % mbrfile,
   'of=%s' % full_path, 'conv=notrunc'])
 if rc != 0:
-raise MountError(Unable to set MBR to %s % full_path)
+raise ImageError(Unable to set MBR to %s % full_path)
 
 @classmethod
 def do_configure_partition(self, part, cr, cr_workdir, oe_builddir,
@@ -107,7 +107,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
 if cr._ptable_format == 'msdos':
 rootstr = rootdev
 else:
-raise MountError(Unsupported partition table format found)
+raise ImageError(Unsupported partition table format found)
 
 syslinux_conf += APPEND label=boot root=%s %s\n % (rootstr, options)
 
diff --git a/scripts/lib/mic/utils/errors.py b/scripts/lib/mic/utils/errors.py
index 38fda30..86e230a 100644
--- a/scripts/lib/mic/utils/errors.py
+++ b/scripts/lib/mic/utils/errors.py
@@ -40,11 +40,8 @@ class Usage(CreatorError):
 self.msg = str(self.msg)
 return self.keyword + self.msg + ', please use --help for more info'
 
-class Abort(CreatorError):
-keyword = ''
-
 class KsError(CreatorError):
 keyword = 'kickstart'
 
-class MountError(CreatorError):
+class ImageError(CreatorError):
 keyword = 'mount'
diff --git a/scripts/lib/mic/utils/partitionedfs.py 
b/scripts/lib/mic/utils/partitionedfs.py
index f4ce4a9..68e4cab 100644
--- a/scripts/lib/mic/utils/partitionedfs.py
+++ b/scripts/lib/mic/utils/partitionedfs.py
@@ -22,7 +22,7 @@ import os
 
 from mic import msger
 from mic.utils import runner
-from mic.utils.errors import MountError
+from mic.utils.errors import ImageError
 from mic.utils.fs_related import *
 from mic.utils.oe.misc import *
 
@@ -121,7 +121,7 @@ class Image:
 msger.debug(Assigning %s partitions to disks % ptable_format)
 
 if ptable_format not in ('msdos'):
-raise MountError(Unknown partition table format '%s', supported  
\
+raise ImageError(Unknown partition table format '%s', supported  
\
  formats are: 'msdos' % ptable_format)
 
 if self._partitions_layed_out:
@@ -134,14 +134,14 @@ class Image:
 p = self.partitions[n]
 
 if not self.disks.has_key(p['disk_name']):
-raise MountError(No disk %s for partition %s \
+raise ImageError(No disk %s for partition %s \
  % (p['disk_name'], p['mountpoint']))
 
 if p['part_type']:
 # The --part-type can also be implemented for MBR partitions,
 # in which case it would map to the 1-byte partition type

[OE-core] [PATCH 31/35] wic: Rename PartitionedMount

2014-08-08 Thread Tom Zanussi
It's actually a container for disks and partitions, and wic doesn't
mount anything, so rename it to match what it really is.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/direct.py | 15 +++
 scripts/lib/mic/plugins/imager/direct_plugin.py  |  1 -
 scripts/lib/mic/plugins/source/bootimg-efi.py|  1 -
 scripts/lib/mic/plugins/source/bootimg-pcbios.py |  1 -
 scripts/lib/mic/plugins/source/rootfs.py |  1 -
 scripts/lib/mic/utils/partitionedfs.py   |  8 +++-
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index 17bfd01..a4f5691 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -31,7 +31,7 @@ import shutil
 
 from mic import kickstart, msger
 from mic.utils import fs_related, runner, misc
-from mic.utils.partitionedfs import PartitionedMount
+from mic.utils.partitionedfs import Image
 from mic.utils.errors import CreatorError, MountError
 from mic.imager.baseimager import BaseImageCreator
 from mic.utils.oe.misc import *
@@ -226,7 +226,7 @@ class DirectImageCreator(BaseImageCreator):
 
 parts = self._get_parts()
 
-self.__image = PartitionedMount()
+self.__image = Image()
 
 for p in parts:
 # as a convenience, set source to the boot partition source
@@ -237,12 +237,11 @@ class DirectImageCreator(BaseImageCreator):
 for p in parts:
 # need to create the filesystems in order to get their
 # sizes before we can add them and do the layout.
-# PartitionedMount.create() actually calls __format_disks()
-# to create the disk images and carve out the partitions,
-# then self.install() calls PartitionedMount.install()
-# which calls __install_partitition() for each partition
-# to dd the fs into the partitions.
-
+# Image.create() actually calls __format_disks() to create
+# the disk images and carve out the partitions, then
+# self.assemble() calls Image.assemble() which calls
+# __write_partitition() for each partition to dd the fs
+# into the partitions.
 fstab = self.__write_fstab(self.rootfs_dir.get(ROOTFS_DIR))
 
 p.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir,
diff --git a/scripts/lib/mic/plugins/imager/direct_plugin.py 
b/scripts/lib/mic/plugins/imager/direct_plugin.py
index ff30f09..c05a400 100644
--- a/scripts/lib/mic/plugins/imager/direct_plugin.py
+++ b/scripts/lib/mic/plugins/imager/direct_plugin.py
@@ -34,7 +34,6 @@ from mic import msger
 from mic.utils import misc, fs_related, errors, runner, cmdln
 from mic.conf import configmgr
 from mic.plugin import pluginmgr
-from mic.utils.partitionedfs import PartitionedMount
 
 import mic.imager.direct as direct
 from mic.pluginbase import ImagerPlugin
diff --git a/scripts/lib/mic/plugins/source/bootimg-efi.py 
b/scripts/lib/mic/plugins/source/bootimg-efi.py
index d4a7771..e880358 100644
--- a/scripts/lib/mic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/mic/plugins/source/bootimg-efi.py
@@ -33,7 +33,6 @@ from mic import kickstart, msger
 from mic.utils import misc, fs_related, errors, runner, cmdln
 from mic.conf import configmgr
 from mic.plugin import pluginmgr
-from mic.utils.partitionedfs import PartitionedMount
 import mic.imager.direct as direct
 from mic.pluginbase import SourcePlugin
 from mic.utils.oe.misc import *
diff --git a/scripts/lib/mic/plugins/source/bootimg-pcbios.py 
b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
index 3434320..53ed7c3 100644
--- a/scripts/lib/mic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
@@ -33,7 +33,6 @@ from mic import kickstart, msger
 from mic.utils import misc, fs_related, errors, runner, cmdln
 from mic.conf import configmgr
 from mic.plugin import pluginmgr
-from mic.utils.partitionedfs import PartitionedMount
 import mic.imager.direct as direct
 from mic.pluginbase import SourcePlugin
 from mic.utils.oe.misc import *
diff --git a/scripts/lib/mic/plugins/source/rootfs.py 
b/scripts/lib/mic/plugins/source/rootfs.py
index 8cb576d..8ebf62c 100644
--- a/scripts/lib/mic/plugins/source/rootfs.py
+++ b/scripts/lib/mic/plugins/source/rootfs.py
@@ -34,7 +34,6 @@ from mic import kickstart, msger
 from mic.utils import misc, fs_related, errors, runner, cmdln
 from mic.conf import configmgr
 from mic.plugin import pluginmgr
-from mic.utils.partitionedfs import PartitionedMount
 import mic.imager.direct as direct
 from mic.pluginbase import SourcePlugin
 from mic.utils.oe.misc import *
diff --git a/scripts/lib/mic/utils/partitionedfs.py 
b/scripts/lib/mic/utils/partitionedfs.py
index 2f950a6..f4ce4a9 100644
--- a/scripts/lib/mic/utils/partitionedfs.py
+++ b/scripts/lib/mic/utils/partitionedfs.py
@@ -32,7 +32,13 @@ MBR_OVERHEAD = 1

[OE-core] [PATCH 20/35] wic: Clean up DirectImageCreator

2014-08-08 Thread Tom Zanussi
Remove what wic doesn't use from DirectImageCreator.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/direct.py| 8 +---
 scripts/lib/mic/plugins/imager/direct_plugin.py | 5 +
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index 93f0cd9..92473b5 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -54,8 +54,7 @@ class DirectImageCreator(BaseImageCreator):
 
 def __init__(self, oe_builddir, image_output_dir, rootfs_dir, bootimg_dir,
  kernel_dir, native_sysroot, hdddir, staging_data_dir,
- creatoropts=None, compress_image=None,
- generate_bmap=None, fstab_entry=uuid):
+ creatoropts=None):
 
 Initialize a DirectImageCreator instance.
 
@@ -64,19 +63,14 @@ class DirectImageCreator(BaseImageCreator):
 BaseImageCreator.__init__(self, creatoropts)
 
 self.__instimage = None
-self.__imgdir = None
 self.__disks = {}
 self.__disk_format = direct
 self._disk_names = []
 self._ptable_format = self.ks.handler.bootloader.ptable
-self.use_uuid = fstab_entry == uuid
-self.compress_image = compress_image
-self.bmap_needed = generate_bmap
 
 self.oe_builddir = oe_builddir
 if image_output_dir:
 self.tmpdir = image_output_dir
-self.cachedir = %s/cache % image_output_dir
 self.rootfs_dir = rootfs_dir
 self.bootimg_dir = bootimg_dir
 self.kernel_dir = kernel_dir
diff --git a/scripts/lib/mic/plugins/imager/direct_plugin.py 
b/scripts/lib/mic/plugins/imager/direct_plugin.py
index d3a0ba7..877aaf6 100644
--- a/scripts/lib/mic/plugins/imager/direct_plugin.py
+++ b/scripts/lib/mic/plugins/imager/direct_plugin.py
@@ -88,10 +88,7 @@ class DirectPlugin(ImagerPlugin):
 native_sysroot,
 hdddir,
 staging_data_dir,
-creatoropts,
-None,
-None,
-None)
+creatoropts)
 
 try:
 creator.mount(None, creatoropts[cachedir])
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 16/35] wic: Remove unused 3rdparty/commands

2014-08-08 Thread Tom Zanussi
wic doesn't use anything but partition and bootloader, so remove the
rest.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 .../mic/3rdparty/pykickstart/commands/__init__.py  |8 +-
 .../3rdparty/pykickstart/commands/authconfig.py|   40 -
 .../mic/3rdparty/pykickstart/commands/autopart.py  |  119 ---
 .../mic/3rdparty/pykickstart/commands/autostep.py  |   55 -
 .../mic/3rdparty/pykickstart/commands/clearpart.py |   86 --
 .../mic/3rdparty/pykickstart/commands/device.py|  125 ---
 .../3rdparty/pykickstart/commands/deviceprobe.py   |   40 -
 .../3rdparty/pykickstart/commands/displaymode.py   |   68 --
 .../mic/3rdparty/pykickstart/commands/dmraid.py|   91 --
 .../3rdparty/pykickstart/commands/driverdisk.py|  184 
 .../lib/mic/3rdparty/pykickstart/commands/fcoe.py  |  114 --
 .../mic/3rdparty/pykickstart/commands/firewall.py  |  193 
 .../mic/3rdparty/pykickstart/commands/firstboot.py |   62 --
 .../lib/mic/3rdparty/pykickstart/commands/group.py |   88 --
 .../3rdparty/pykickstart/commands/ignoredisk.py|  139 ---
 .../3rdparty/pykickstart/commands/interactive.py   |   58 --
 .../lib/mic/3rdparty/pykickstart/commands/iscsi.py |  133 ---
 .../mic/3rdparty/pykickstart/commands/iscsiname.py |   54 -
 .../lib/mic/3rdparty/pykickstart/commands/key.py   |   64 --
 .../mic/3rdparty/pykickstart/commands/keyboard.py  |   55 -
 .../lib/mic/3rdparty/pykickstart/commands/lang.py  |   60 --
 .../3rdparty/pykickstart/commands/langsupport.py   |   58 --
 .../mic/3rdparty/pykickstart/commands/lilocheck.py |   54 -
 .../mic/3rdparty/pykickstart/commands/logging.py   |   66 --
 .../mic/3rdparty/pykickstart/commands/logvol.py|  304 --
 .../3rdparty/pykickstart/commands/mediacheck.py|   53 -
 .../mic/3rdparty/pykickstart/commands/method.py|  186 
 .../mic/3rdparty/pykickstart/commands/monitor.py   |  106 --
 .../lib/mic/3rdparty/pykickstart/commands/mouse.py |   70 --
 .../mic/3rdparty/pykickstart/commands/multipath.py |  111 --
 .../mic/3rdparty/pykickstart/commands/network.py   |  363 ---
 .../lib/mic/3rdparty/pykickstart/commands/raid.py  |  365 ---
 .../mic/3rdparty/pykickstart/commands/reboot.py|   79 --
 .../lib/mic/3rdparty/pykickstart/commands/repo.py  |  249 -
 .../mic/3rdparty/pykickstart/commands/rescue.py|   68 --
 .../mic/3rdparty/pykickstart/commands/rootpw.py|   93 --
 .../mic/3rdparty/pykickstart/commands/selinux.py   |   64 --
 .../mic/3rdparty/pykickstart/commands/services.py  |   71 --
 .../lib/mic/3rdparty/pykickstart/commands/skipx.py |   54 -
 .../lib/mic/3rdparty/pykickstart/commands/sshpw.py |  105 --
 .../mic/3rdparty/pykickstart/commands/timezone.py  |   86 --
 .../mic/3rdparty/pykickstart/commands/updates.py   |   60 --
 .../mic/3rdparty/pykickstart/commands/upgrade.py   |  106 --
 .../lib/mic/3rdparty/pykickstart/commands/user.py  |  173 
 .../lib/mic/3rdparty/pykickstart/commands/vnc.py   |  114 --
 .../mic/3rdparty/pykickstart/commands/volgroup.py  |  102 --
 .../mic/3rdparty/pykickstart/commands/xconfig.py   |  184 
 .../mic/3rdparty/pykickstart/commands/zerombr.py   |   69 --
 .../lib/mic/3rdparty/pykickstart/commands/zfcp.py  |  134 ---
 .../mic/3rdparty/pykickstart/handlers/control.py   | 1092 
 50 files changed, 1 insertion(+), 6474 deletions(-)
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/device.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/group.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsi.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsiname.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/key.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/keyboard.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/lang.py
 delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/langsupport.py
 delete mode 100644 scripts/lib

[OE-core] [PATCH 29/35] wic: Update/rename install-related code

2014-08-08 Thread Tom Zanussi
The wic code inherited a basic image-creation flow based on installing
packages, but wic doesn't actually install anything, so rename parts
of the code dealing with installing to something more appropriate.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/direct.py| 50 -
 scripts/lib/mic/plugins/imager/direct_plugin.py |  2 +-
 scripts/lib/mic/utils/partitionedfs.py  | 16 
 3 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index 91f64d5..8d7b6ee 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -62,7 +62,7 @@ class DirectImageCreator(BaseImageCreator):
 
 BaseImageCreator.__init__(self, creatoropts)
 
-self.__instimage = None
+self.__image = None
 self.__disks = {}
 self.__disk_format = direct
 self._disk_names = []
@@ -226,7 +226,7 @@ class DirectImageCreator(BaseImageCreator):
 
 parts = self._get_parts()
 
-self.__instimage = PartitionedMount()
+self.__image = PartitionedMount()
 
 for p in parts:
 # as a convenience, set source to the boot partition source
@@ -250,39 +250,39 @@ class DirectImageCreator(BaseImageCreator):
 
 self._restore_fstab(fstab)
 
-self.__instimage.add_partition(int(p.size),
-   p.disk,
-   p.mountpoint,
-   p.source_file,
-   p.fstype,
-   p.label,
-   fsopts = p.fsopts,
-   boot = p.active,
-   align = p.align,
-   part_type = p.part_type)
+self.__image.add_partition(int(p.size),
+   p.disk,
+   p.mountpoint,
+   p.source_file,
+   p.fstype,
+   p.label,
+   fsopts = p.fsopts,
+   boot = p.active,
+   align = p.align,
+   part_type = p.part_type)
 
-self.__instimage.layout_partitions(self._ptable_format)
+self.__image.layout_partitions(self._ptable_format)
 
 self.__imgdir = self.workdir
-for disk_name, disk in self.__instimage.disks.items():
+for disk_name, disk in self.__image.disks.items():
 full_path = self._full_path(self.__imgdir, disk_name, direct)
 msger.debug(Adding disk %s as %s with size %s bytes \
 % (disk_name, full_path, disk['min_size']))
 disk_obj = fs_related.DiskImage(full_path, disk['min_size'])
 self.__disks[disk_name] = disk_obj
-self.__instimage.add_disk(disk_name, disk_obj)
+self.__image.add_disk(disk_name, disk_obj)
 
-self.__instimage.create()
+self.__image.create()
 
-def install(self):
+def assemble(self):
 
-Install fs images into partitions
+Assemble partitions into disk image(s)
 
-for disk_name, disk in self.__instimage.disks.items():
+for disk_name, disk in self.__image.disks.items():
 full_path = self._full_path(self.__imgdir, disk_name, direct)
-msger.debug(Installing disk %s as %s with size %s bytes \
+msger.debug(Assembling disk %s as %s with size %s bytes \
 % (disk_name, full_path, disk['min_size']))
-self.__instimage.install(full_path)
+self.__image.assemble(full_path)
 
 def configure(self):
 
@@ -294,7 +294,7 @@ class DirectImageCreator(BaseImageCreator):
 source_plugin = self.get_default_source_plugin()
 if source_plugin:
 self._source_methods = 
pluginmgr.get_source_plugin_methods(source_plugin, disk_methods)
-for disk_name, disk in self.__instimage.disks.items():
+for disk_name, disk in self.__image.disks.items():
 self._source_methods[do_install_disk](disk, disk_name, self,
 self.workdir,
 self.oe_builddir,
@@ -310,7 +310,7 @@ class DirectImageCreator(BaseImageCreator):
 
 parts = self._get_parts()
 
-for disk_name, disk in self.__instimage.disks.items():
+for disk_name, disk in self.__image.disks.items():
 full_path = self._full_path(self.__imgdir, disk_name, direct)
 msg += '  %s\n\n

[OE-core] [PATCH 28/35] wic: Update cleanup/unmount-related code

2014-08-08 Thread Tom Zanussi
The wic code inherited a basic image-creation flow based on mounting
loop devices, but wic doesn't actually mount or unmount anything, so
get rid of unmount() and consolidate whatever it did do with
cleanup().

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/imager/baseimager.py | 28 ++--
 scripts/lib/mic/imager/direct.py |  2 +-
 2 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/scripts/lib/mic/imager/baseimager.py 
b/scripts/lib/mic/imager/baseimager.py
index 7f32dd5..23919d4 100644
--- a/scripts/lib/mic/imager/baseimager.py
+++ b/scripts/lib/mic/imager/baseimager.py
@@ -109,12 +109,11 @@ class BaseImageCreator(object):
 
 pass
 
-def _unmount_instroot(self):
-Undo anything performed in _mount_instroot().
+def _cleanup(self):
+Undo anything performed in _create().
 
-This is the hook where subclasses must undo anything which was done
-in _mount_instroot(). For example, if a filesystem image was mounted
-onto _instroot, it should be unmounted here.
+This is the hook where subclasses must undo anything which was
+done in _create().
 
 There is no default implementation.
 
@@ -161,23 +160,8 @@ class BaseImageCreator(object):
 
 self._create()
 
-def unmount(self):
-Unmounts the target filesystem.
-
-The ImageCreator class detaches the system from the install root, but
-other subclasses may also detach the loopback mounted filesystem image
-from the install root.
-
-
-self._unmount_instroot()
-
-
 def cleanup(self):
-Unmounts the target filesystem and deletes temporary files.
-
-This method calls unmount() and then deletes any temporary files and
-directories that were created on the host system while building the
-image.
+Undo anything performed in create().
 
 Note, make sure to call this method once finished with the creator
 instance in order to ensure no stale files are left on the host e.g.:
@@ -192,7 +176,7 @@ class BaseImageCreator(object):
 if not self.__builddir:
 return
 
-self.unmount()
+self._cleanup()
 
 shutil.rmtree(self.__builddir, ignore_errors = True)
 self.__builddir = None
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index b96740d..91f64d5 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -354,7 +354,7 @@ class DirectImageCreator(BaseImageCreator):
 
 return (rootdev, root_part_uuid)
 
-def _unmount_instroot(self):
+def _cleanup(self):
 if not self.__instimage is None:
 try:
 self.__instimage.cleanup()
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 26/35] wic: Remove Mount object

2014-08-08 Thread Tom Zanussi
It doesn't do anything we need, so remove it and fix up callers/base
classes.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/mic/utils/fs_related.py| 16 
 scripts/lib/mic/utils/partitionedfs.py |  4 +---
 2 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/scripts/lib/mic/utils/fs_related.py 
b/scripts/lib/mic/utils/fs_related.py
index e6e362d..07a5ff9 100644
--- a/scripts/lib/mic/utils/fs_related.py
+++ b/scripts/lib/mic/utils/fs_related.py
@@ -112,19 +112,3 @@ class DiskImage(Disk):
 exec_cmd(dd_cmd)
 
 self.device = self.image_file
-
-
-class Mount:
-A generic base class to deal with mounting things.
-def __init__(self, mountdir):
-self.mountdir = mountdir
-
-def cleanup(self):
-self.unmount()
-
-def mount(self, options = None):
-pass
-
-def unmount(self):
-pass
-
diff --git a/scripts/lib/mic/utils/partitionedfs.py 
b/scripts/lib/mic/utils/partitionedfs.py
index ef92125..50536b4 100644
--- a/scripts/lib/mic/utils/partitionedfs.py
+++ b/scripts/lib/mic/utils/partitionedfs.py
@@ -32,9 +32,8 @@ MBR_OVERHEAD = 1
 # Size of a sector in bytes
 SECTOR_SIZE = 512
 
-class PartitionedMount(Mount):
+class PartitionedMount:
 def __init__(self, mountdir):
-Mount.__init__(self, mountdir)
 self.disks = {}
 self.partitions = []
 self.mountOrder = []
@@ -316,7 +315,6 @@ class PartitionedMount(Mount):
 self.unmountOrder.reverse()
 
 def cleanup(self):
-Mount.cleanup(self)
 if self.disks:
 for dev in self.disks.keys():
 d = self.disks[dev]
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 34/35] wic: Rename /mic to /wic

2014-08-08 Thread Tom Zanussi
As well as any other stray instances of mic in the codebase that can
be removed.

We don't really need to carry around legacy naming, and the history is
in git.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/engine.py  | 12 ++--
 scripts/lib/image/help.py|  8 
 .../{mic = wic}/3rdparty/pykickstart/__init__.py|  0
 .../lib/{mic = wic}/3rdparty/pykickstart/base.py|  0
 .../3rdparty/pykickstart/commands/__init__.py|  0
 .../3rdparty/pykickstart/commands/bootloader.py  |  0
 .../3rdparty/pykickstart/commands/partition.py   |  0
 .../{mic = wic}/3rdparty/pykickstart/constants.py   |  0
 .../lib/{mic = wic}/3rdparty/pykickstart/errors.py  |  0
 .../3rdparty/pykickstart/handlers/__init__.py|  0
 .../3rdparty/pykickstart/handlers/control.py |  0
 .../3rdparty/pykickstart/handlers/f16.py |  0
 scripts/lib/{mic = wic}/3rdparty/pykickstart/ko.py  |  0
 .../lib/{mic = wic}/3rdparty/pykickstart/options.py |  0
 .../lib/{mic = wic}/3rdparty/pykickstart/parser.py  |  0
 .../{mic = wic}/3rdparty/pykickstart/sections.py|  0
 .../lib/{mic = wic}/3rdparty/pykickstart/version.py |  0
 scripts/lib/{mic = wic}/__init__.py |  0
 scripts/lib/{mic = wic}/__version__.py  |  0
 scripts/lib/{mic = wic}/conf.py | 12 ++--
 scripts/lib/{mic = wic}/creator.py  | 12 ++--
 scripts/lib/{mic = wic}/imager/__init__.py  |  0
 scripts/lib/{mic = wic}/imager/baseimager.py| 10 +-
 scripts/lib/{mic = wic}/imager/direct.py| 17 -
 scripts/lib/{mic = wic}/kickstart/__init__.py   |  4 ++--
 .../kickstart/custom_commands/__init__.py|  0
 .../kickstart/custom_commands/micboot.py |  0
 .../kickstart/custom_commands/micpartition.py|  0
 .../kickstart/custom_commands/partition.py   |  6 +++---
 .../kickstart/custom_commands/wicboot.py |  2 +-
 scripts/lib/{mic = wic}/msger.py|  0
 scripts/lib/{mic = wic}/plugin.py   | 16 
 scripts/lib/{mic = wic}/pluginbase.py   | 20 ++--
 .../lib/{mic = wic}/plugins/imager/direct_plugin.py | 15 +++
 .../lib/{mic = wic}/plugins/source/bootimg-efi.py   | 16 
 .../{mic = wic}/plugins/source/bootimg-pcbios.py| 16 
 scripts/lib/{mic = wic}/plugins/source/rootfs.py| 16 
 scripts/lib/{mic = wic}/test|  0
 scripts/lib/{mic = wic}/utils/__init__.py   |  0
 scripts/lib/{mic = wic}/utils/cmdln.py  |  0
 scripts/lib/{mic = wic}/utils/errors.py |  0
 scripts/lib/{mic = wic}/utils/fs_related.py |  8 
 scripts/lib/{mic = wic}/utils/misc.py   |  0
 scripts/lib/{mic = wic}/utils/oe/__init__.py|  2 +-
 scripts/lib/{mic = wic}/utils/oe/misc.py|  6 +++---
 scripts/lib/{mic = wic}/utils/partitionedfs.py  | 10 +-
 scripts/lib/{mic = wic}/utils/runner.py |  2 +-
 47 files changed, 104 insertions(+), 106 deletions(-)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/__init__.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/base.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/commands/__init__.py 
(100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/commands/bootloader.py 
(100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/commands/partition.py 
(100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/constants.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/errors.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/handlers/__init__.py 
(100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/handlers/control.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/handlers/f16.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/ko.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/options.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/parser.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/sections.py (100%)
 rename scripts/lib/{mic = wic}/3rdparty/pykickstart/version.py (100%)
 rename scripts/lib/{mic = wic}/__init__.py (100%)
 rename scripts/lib/{mic = wic}/__version__.py (100%)
 rename scripts/lib/{mic = wic}/conf.py (93%)
 rename scripts/lib/{mic = wic}/creator.py (96%)
 rename scripts/lib/{mic = wic}/imager/__init__.py (100%)
 rename scripts/lib/{mic = wic}/imager/baseimager.py (96%)
 rename scripts/lib/{mic = wic}/imager/direct.py (96%)
 rename scripts/lib/{mic = wic}/kickstart/__init__.py (98%)
 rename scripts/lib/{mic = wic}/kickstart/custom_commands/__init__.py (100%)
 rename scripts/lib/{mic = wic}/kickstart/custom_commands/micboot.py (100%)
 rename scripts/lib/{mic = wic}/kickstart

[OE-core] [PATCH 35/35] wic: Bump the version to 2.0

2014-08-08 Thread Tom Zanussi
This represents a complete rework, and if we assume the previous
version should have been 1.0 (instead of a silly .1x version), then
this should be 2.0.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/wic/__version__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/wic/__version__.py b/scripts/lib/wic/__version__.py
index 60d7626..5452a46 100644
--- a/scripts/lib/wic/__version__.py
+++ b/scripts/lib/wic/__version__.py
@@ -1 +1 @@
-VERSION = 0.14
+VERSION = 2.00
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 00/24] wic: Remove unused code

2014-08-05 Thread Tom Zanussi
This patchset removes most of code inherited from mic but sitting
essentially unused.

There's no reason to be carrying it around other than some vague
intention of reusing it, but that can still be done - anything needed
can alwayse be added back.

As it stands, it's only taking up space and obscuring a clear view of
what's actually used.

Removing the bsp subdir from scripts/lib, and taking a size
measurement using 'du -bh lib', we get:

before:
  1.2M  lib

after:
  393K  lib

More than half the code remaining after this exercise belongs to the parser
and related code, which could presumably be simplified by future patches.

[NOTE: the patches in this patchset are too large to post, see URLs
below for the actual patches]

The following changes since commit 4a226369b7bb37a971c77d4abc88df81033f56c5:

  dev-manual: Updates for checksums and wic (2014-08-02 10:00:26 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-diet-phase1-v0
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-diet-phase1-v0

Tom Zanussi (24):
  wic: Make exec_cmd() error out instead of warn
  wic: Remove unused custom commands
  wic: Remove packaging, config commands
  wic: Remove mic bootstrap
  wic: Remove mic chroot
  wic: Remove rt_util
  wic: Remove mic package managers
  wic: Remove bmap support
  wic: Remove fiemap support
  wic: Remove grabber implementation
  wic: Remove proxy support
  wic: Remove rpmmisc
  wic: Remove unused fs_related code
  wic: Remove unused misc code
  wic: Remove 3rdparty/urlgrabber
  wic: Remove unused 3rdparty/commands
  wic: Remove gpt_parser
  wic: Remove unused plugin and error code
  wic: Clean up BaseImageCreator
  wic: Clean up DirectImageCreator
  wic: Clean up PartitionedMount
  wic: Clean up Creator
  wic: Remove unused command versioning support
  wic: Update 'Background and Motivation' help section

 scripts/lib/image/help.py  |   14 +-
 .../mic/3rdparty/pykickstart/commands/__init__.py  |8 +-
 .../3rdparty/pykickstart/commands/authconfig.py|   40 -
 .../mic/3rdparty/pykickstart/commands/autopart.py  |  119 --
 .../mic/3rdparty/pykickstart/commands/autostep.py  |   55 -
 .../3rdparty/pykickstart/commands/bootloader.py|   49 -
 .../mic/3rdparty/pykickstart/commands/clearpart.py |   86 --
 .../mic/3rdparty/pykickstart/commands/device.py|  125 --
 .../3rdparty/pykickstart/commands/deviceprobe.py   |   40 -
 .../3rdparty/pykickstart/commands/displaymode.py   |   68 -
 .../mic/3rdparty/pykickstart/commands/dmraid.py|   91 --
 .../3rdparty/pykickstart/commands/driverdisk.py|  184 ---
 .../lib/mic/3rdparty/pykickstart/commands/fcoe.py  |  114 --
 .../mic/3rdparty/pykickstart/commands/firewall.py  |  193 ---
 .../mic/3rdparty/pykickstart/commands/firstboot.py |   62 -
 .../lib/mic/3rdparty/pykickstart/commands/group.py |   88 --
 .../3rdparty/pykickstart/commands/ignoredisk.py|  139 --
 .../3rdparty/pykickstart/commands/interactive.py   |   58 -
 .../lib/mic/3rdparty/pykickstart/commands/iscsi.py |  133 --
 .../mic/3rdparty/pykickstart/commands/iscsiname.py |   54 -
 .../lib/mic/3rdparty/pykickstart/commands/key.py   |   64 -
 .../mic/3rdparty/pykickstart/commands/keyboard.py  |   55 -
 .../lib/mic/3rdparty/pykickstart/commands/lang.py  |   60 -
 .../3rdparty/pykickstart/commands/langsupport.py   |   58 -
 .../mic/3rdparty/pykickstart/commands/lilocheck.py |   54 -
 .../mic/3rdparty/pykickstart/commands/logging.py   |   66 -
 .../mic/3rdparty/pykickstart/commands/logvol.py|  304 
 .../3rdparty/pykickstart/commands/mediacheck.py|   53 -
 .../mic/3rdparty/pykickstart/commands/method.py|  186 ---
 .../mic/3rdparty/pykickstart/commands/monitor.py   |  106 --
 .../lib/mic/3rdparty/pykickstart/commands/mouse.py |   70 -
 .../mic/3rdparty/pykickstart/commands/multipath.py |  111 --
 .../mic/3rdparty/pykickstart/commands/network.py   |  363 -
 .../mic/3rdparty/pykickstart/commands/partition.py |   39 -
 .../lib/mic/3rdparty/pykickstart/commands/raid.py  |  365 -
 .../mic/3rdparty/pykickstart/commands/reboot.py|   79 --
 .../lib/mic/3rdparty/pykickstart/commands/repo.py  |  249 
 .../mic/3rdparty/pykickstart/commands/rescue.py|   68 -
 .../mic/3rdparty/pykickstart/commands/rootpw.py|   93 --
 .../mic/3rdparty/pykickstart/commands/selinux.py   |   64 -
 .../mic/3rdparty/pykickstart/commands/services.py  |   71 -
 .../lib/mic/3rdparty/pykickstart/commands/skipx.py |   54 -
 .../lib/mic/3rdparty/pykickstart/commands/sshpw.py |  105 --
 .../mic/3rdparty/pykickstart/commands/timezone.py  |   86 --
 .../mic/3rdparty/pykickstart/commands/updates.py   |   60 -
 .../mic/3rdparty/pykickstart/commands/upgrade.py   |  106 --
 .../lib/mic/3rdparty/pykickstart/commands/user.py  |  173 ---
 .../lib/mic/3rdparty/pykickstart/commands/vnc.py   |  114 --
 .../mic/3rdparty/pykickstart/commands/volgroup.py  |  102 --
 .../mic/3rdparty/pykickstart

[OE-core] [PATCH 3/4] wic: Add squashfs to --fstypes documentation

2014-07-29 Thread Tom Zanussi
squashfs support was recently added to wic, so document it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/help.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index 6d613e2..b833459 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -719,6 +719,7 @@ DESCRIPTION
  ext3
  ext4
  btrfs
+ squashfs
  swap
 
  --fsoptions: Specifies a free-form string of options to be
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 4/4] wic: Various typo/grammar fixes to wic help text

2014-07-29 Thread Tom Zanussi
This is a set of miscellaneous help text updates noticed while
transcribing wic help for the dev manual.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/help.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index b833459..6e8e037 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -443,8 +443,8 @@ DESCRIPTION
 artifacts, the result is an image or set of images that can be
 directly written onto media and used on a particular system.
 
-The 'wic' command and the infrastructure it's based is by
-definition incomplete - it's designed to allow the generation of
+The 'wic' command and the infrastructure it's based on is by
+definition incomplete - its purpose is to allow the generation of
 customized images, and as such was designed to be completely
 extensible via a plugin interface (see 'wic help plugins').
 
@@ -705,7 +705,7 @@ DESCRIPTION
wic command-line option (or the equivalent rootfs
derived from the '-e' command-line option).
Exactly what those contents and filesystem type end
-   up being are depend on the given plugin
+   up being are dependent on the given plugin
implementation.
 
  --ondisk or --ondrive: Forces the partition to be created on
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/4] wic: Fix plugin help text

2014-07-29 Thread Tom Zanussi
Fix various typoes and grammar problems noticed while transcribing for
the dev manual.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/help.py | 29 -
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index 848aa9a..913947c 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -389,9 +389,9 @@ DESCRIPTION
 class (see the SourcePlugin source for details):
 
   do_prepare_partition()
-  Called to do the actual content population for a partition
-  i.e. it 'prepares' the final partition image which will be
-  incorporated into the disk image.
+  Called to do the actual content population for a
+  partition. In other words, it 'prepares' the final partition
+  image which will be incorporated into the disk image.
 
   do_configure_partition()
   Called before do_prepare_partition(), typically used to
@@ -401,23 +401,26 @@ DESCRIPTION
   do_install_disk()
   Called after all partitions have been prepared and assembled
   into a disk image.  This provides a hook to allow
-  finalization of a disk image e.g. to write an MBR to it.
+  finalization of a disk image, for example to write an MBR to
+  it.
 
   do_stage_partition()
-  Special content staging hook called before
+  Special content-staging hook called before
   do_prepare_partition(), normally empty.
 
-  Typically, a partition will just use the passed-in parame
-  e.g straight bootimg_dir, etc, but in some cases, things
-  need to be more tailored e.g. to use a deploy dir + /boot,
-  etc.  This hook allows those files to be staged in a
-  customized fashion.  Not that get_bitbake_var() allows you
-  to acces non-standard variables that you might want to use
-  for this.
+  Typically, a partition will just use the passed-in
+  parameters, for example the unmodified value of bootimg_dir.
+  In some cases however, things may need to be more tailored.
+  As an example, certain files may additionally need to be
+  take from bootimg_dir + /boot.  This hook allows those files
+  to be staged in a customized fashion.  Note that
+  get_bitbake_var() allows you to access non-standard
+  variables that you might want to use for these types of
+  situations.
 
 This scheme is extensible - adding more hooks is a simple matter
 of adding more plugin methods to SourcePlugin and derived classes.
-The code that then needs to call the plugin methods the uses
+The code that then needs to call the plugin methods uses
 plugin.get_source_plugin_methods() to find the method(s) needed by
 the call; this is done by filling up a dict with keys containing
 the method names of interest - on success, these will be filled in
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/4] wic help updates

2014-07-29 Thread Tom Zanussi
This patchset fixes a few things noticed while updating the dev
manual.

The following changes since commit 2d1660112e54653f7bb763939d0416472c49fe01:

  populate_sdk_base: Fix grep command usage on old hosts (2014-07-29 09:58:27 
+0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib.git tzanussi/wic-help-updates
  
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/wic-help-updates

Tom Zanussi (4):
  wic: Fix plugin help text
  wic: Add documentation for --fsoptions
  wic: Add squashfs to --fstypes documentation
  wic: Various typo/grammar fixes to wic help text

 scripts/lib/image/help.py | 43 +++
 1 file changed, 27 insertions(+), 16 deletions(-)

-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/4] wic: Add documentation for --fsoptions

2014-07-29 Thread Tom Zanussi
--fsoptions support was recently added to wic, so document it.

Signed-off-by: Tom Zanussi tom.zanu...@linux.intel.com
---
 scripts/lib/image/help.py | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index 913947c..6d613e2 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -721,6 +721,13 @@ DESCRIPTION
  btrfs
  swap
 
+ --fsoptions: Specifies a free-form string of options to be
+  used when mounting the filesystem. This string
+  will be copied into the /etc/fstab file of the
+  installed system and should be enclosed in
+  quotes.  If not specified, the default string is
+  defaults.
+
  --label label: Specifies the label to give to the filesystem
 to be made on the partition. If the given
 label is already in use by another filesystem,
-- 
1.8.3.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] wic: do not overwrite autogenerated /etc/fstab with original too early

2014-07-25 Thread Tom Zanussi
On Thu, 2014-07-24 at 19:49 -0500, Tom Zanussi wrote:
 On Thu, 2014-07-24 at 14:27 +0200, Maciej Borzecki wrote:
  DirectImageCreator.__write_fstab() generates new /etc/fstab in sysroot
  with rootfs contents. The fstab entries are generated base on the
  initialn contents of /etc/fstab, plus any extra (other than / or
  /boot) partitions listed in *.wks. A backup of original /etc/fstab is
  done in a temp location. Subsequent call to __restore_fstab() restores
  the backup copy, replacing the autogenerated one.
  
  Calling __restore_fstab() before Wic_PartData.prepare() brings back the
  original fstab before the partition image file actually is created. As
  such, the autogenerated /etc/fstab will not make it to the partition.
  
 
 OK, I knew there was something funny about this, and it wasn't really
 fixing the problem.  I also knew that it had previously worked, and
 digging around realized that the problem was that the recent patch 'wic:
 Extend --rootfs-dir to connect rootfs-dirs' is what actually broke
 things.
 
 So this patch shouldn't be applied - I need to look at it a bit more and
 come up with a proper fix..
 

OK, I take that back - this patch is fine to apply.

Acked-by: Tom Zanussi tom.zanu...@intel.com

What confused me was that your first patch was clearly wrong, but you
moved the __write_fstab() to before .prepare in your second patch, which
is correct.

In the future, for v2 and beyond patches, please note what changed from
the previous version.

Thanks,

Tom


 Tom
 
  Signed-off-by: Maciej Borzecki maciej.borze...@open-rnd.pl
  Signed-off-by: Maciek Borzecki maciek.borze...@gmail.com
  ---
  
  Notes:
  Previous version got messed up during merges and faulty code was sent
  out. This one works as expected.
  
   scripts/lib/mic/imager/direct.py | 5 -
   1 file changed, 4 insertions(+), 1 deletion(-)
  
  diff --git a/scripts/lib/mic/imager/direct.py 
  b/scripts/lib/mic/imager/direct.py
  index 2cf4c8d..77a118a 100644
  --- a/scripts/lib/mic/imager/direct.py
  +++ b/scripts/lib/mic/imager/direct.py
  @@ -262,10 +262,12 @@ class DirectImageCreator(BaseImageCreator):
   # when/if we need to actually do package selection we
   # should modify things to use those objects, but for now
   # we can avoid that.
  +
  +fstab = self.__write_fstab(self.rootfs_dir.get(ROOTFS_DIR))
  +
   p.prepare(self, self.workdir, self.oe_builddir, 
  self.rootfs_dir,
 self.bootimg_dir, self.kernel_dir, 
  self.native_sysroot)
   
  -fstab = self.__write_fstab(p.get_rootfs())
   self._restore_fstab(fstab)
   
   self.__instimage.add_partition(int(p.size),
  @@ -278,6 +280,7 @@ class DirectImageCreator(BaseImageCreator):
  boot = p.active,
  align = p.align,
  part_type = p.part_type)
  +
   self.__instimage.layout_partitions(self._ptable_format)
   
   self.__imgdir = self.workdir
 


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] wic: do not overwrite autogenerated /etc/fstab with original too early

2014-07-25 Thread Tom Zanussi
On Fri, 2014-07-25 at 17:48 +0200, Maciek Borzecki wrote:
 25 lip 2014 17:00 Tom Zanussi tom.zanu...@intel.com napisał(a):
 
  On Thu, 2014-07-24 at 19:49 -0500, Tom Zanussi wrote: 
   On Thu, 2014-07-24 at 14:27 +0200, Maciej Borzecki wrote: 
DirectImageCreator.__write_fstab() generates new /etc/fstab in sysroot 
with rootfs contents. The fstab entries are generated base on the 
initialn contents of /etc/fstab, plus any extra (other than / or 
/boot) partitions listed in *.wks. A backup of original /etc/fstab is 
done in a temp location. Subsequent call to __restore_fstab() restores 
the backup copy, replacing the autogenerated one. 

Calling __restore_fstab() before Wic_PartData.prepare() brings back the 
original fstab before the partition image file actually is created. As 
such, the autogenerated /etc/fstab will not make it to the partition. 

   
   OK, I knew there was something funny about this, and it wasn't really 
   fixing the problem.  I also knew that it had previously worked, and 
   digging around realized that the problem was that the recent patch 'wic: 
   Extend --rootfs-dir to connect rootfs-dirs' is what actually broke 
   things. 
   
   So this patch shouldn't be applied - I need to look at it a bit more and 
   come up with a proper fix.. 
   
 
  OK, I take that back - this patch is fine to apply. 
 
  Acked-by: Tom Zanussi tom.zanu...@intel.com 
 
  What confused me was that your first patch was clearly wrong, but you 
  moved the __write_fstab() to before .prepare in your second patch, which 
  is correct. 
 
  In the future, for v2 and beyond patches, please note what changed from 
  the previous version.
 
 Sure.
 
 One question though. How do I get the patches into master? I'm not
 @intel.com perhaps that's why I was a bit confused by the wiki
 instructions. Would you be able to push all of these changes into your
 tree, so that they would get to master with later merge?
 

They get pulled into master by Richard and Saul, no need to do anything
else on your side (except ping them if you don't see them get merged in
a reasonable timeframe ;-)

Tom


 Thanks,
 Maciek


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] wic: squashfs partition support

2014-07-24 Thread Tom Zanussi
On Thu, 2014-07-24 at 14:11 +0200, Maciej Borzecki wrote:
 It is possible to instruct wic to create a squashfs partition by setting
 --fstype=squashfs in *.wks. For now this is only useable for rootfs
 partitions (note that you must have squashfs support in the kernel). An
 attempt to create an empty partition will produce a warning.
 
 Signed-off-by: Maciej Borzecki maciej.borze...@open-rnd.pl

Acked-by: Tom Zanussi tom.zanu...@intel.com

 ---
  .../lib/mic/kickstart/custom_commands/partition.py | 61 
 ++
  1 file changed, 61 insertions(+)
 
 diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py 
 b/scripts/lib/mic/kickstart/custom_commands/partition.py
 index d0f1b78..ce90aa1 100644
 --- a/scripts/lib/mic/kickstart/custom_commands/partition.py
 +++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
 @@ -25,6 +25,8 @@
  #
  
  import shutil
 +import os
 +import tempfile
  
  from pykickstart.commands.partition import *
  from mic.utils.oe.misc import *
 @@ -192,6 +194,10 @@ class Wic_PartData(Mic_PartData):
  return self.prepare_rootfs_vfat(cr_workdir, oe_builddir,
  rootfs_dir, native_sysroot,
  pseudo)
 +elif self.fstype.startswith(squashfs):
 +return self.prepare_rootfs_squashfs(cr_workdir, oe_builddir,
 +rootfs_dir, native_sysroot,
 +pseudo)
  
  def prepare_rootfs_ext(self, cr_workdir, oe_builddir, rootfs_dir,
 native_sysroot, pseudo):
 @@ -324,6 +330,28 @@ class Wic_PartData(Mic_PartData):
  self.set_size(rootfs_size)
  self.set_source_file(rootfs)
  
 +def prepare_rootfs_squashfs(self, cr_workdir, oe_builddir, rootfs_dir,
 +native_sysroot, pseudo):
 +
 +Prepare content for a squashfs rootfs partition.
 +
 +image_rootfs = rootfs_dir
 +rootfs = %s/rootfs_%s.%s % (cr_workdir, self.label ,self.fstype)
 +
 +squashfs_cmd = mksquashfs %s %s -noappend % \
 +   (image_rootfs, rootfs)
 +rc, out = exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
 +
 +# get the rootfs size in the right units for kickstart (Mb)
 +du_cmd = du -Lbms %s % rootfs
 +rc, out = exec_cmd(du_cmd)
 +rootfs_size = out.split()[0]
 +
 +self.size = rootfs_size
 +self.source_file = rootfs
 +
 +return 0
 +
  def prepare_empty_partition(self, cr_workdir, oe_builddir, 
 native_sysroot):
  
  Prepare an empty partition.
 @@ -337,6 +365,9 @@ class Wic_PartData(Mic_PartData):
  elif self.fstype.startswith(vfat):
  return self.prepare_empty_partition_vfat(cr_workdir, oe_builddir,
   native_sysroot)
 +elif self.fstype.startswith(squashfs):
 +return self.prepare_empty_partition_squashfs(cr_workdir, 
 oe_builddir,
 + native_sysroot)
  
  def prepare_empty_partition_ext(self, cr_workdir, oe_builddir,
  native_sysroot):
 @@ -398,6 +429,36 @@ class Wic_PartData(Mic_PartData):
  
  return 0
  
 +def prepare_empty_partition_squashfs(self, cr_workdir, oe_builddir,
 + native_sysroot):
 +
 +Prepare an empty squashfs partition.
 +
 +msger.warning(Creating of an empty squashfs %s partition was 
 attempted.  \
 +  Proceeding as requested. % self.mountpoint)
 +
 +fs = %s/fs_%s.%s % (cr_workdir, self.label, self.fstype)
 +
 +# it is not possible to create a squashfs without source data,
 +# thus prepare an empty temp dir that is used as source
 +tmpdir = tempfile.mkdtemp()
 +
 +squashfs_cmd = mksquashfs %s %s -noappend % \
 +   (tmpdir, fs)
 +rc, out = exec_native_cmd(squashfs_cmd, native_sysroot)
 +
 +os.rmdir(tmpdir)
 +
 +# get the rootfs size in the right units for kickstart (Mb)
 +du_cmd = du -Lbms %s % fs
 +rc, out = exec_cmd(du_cmd)
 +fs_size = out.split()[0]
 +
 +self.size = fs_size
 +self.source_file = fs
 +
 +return 0
 +
  def prepare_swap_partition(self, cr_workdir, oe_builddir, 
 native_sysroot):
  
  Prepare a swap partition.


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] wic: --fsoptions handling

2014-07-24 Thread Tom Zanussi
On Thu, 2014-07-24 at 14:17 +0200, Maciej Borzecki wrote:
 Add handling of --fsoptions in parition definition. If no options are
 specified, 'defaults' is used.
 
 Signed-off-by: Maciej Borzecki maciej.borze...@open-rnd.pl
 Signed-off-by: Maciek Borzecki maciek.borze...@gmail.com

Acked-by: Tom Zanussi tom.zanu...@intel.com

 ---
  scripts/lib/mic/imager/direct.py | 10 +-
  1 file changed, 9 insertions(+), 1 deletion(-)
 
 diff --git a/scripts/lib/mic/imager/direct.py 
 b/scripts/lib/mic/imager/direct.py
 index 77a118a..7e2b63a 100644
 --- a/scripts/lib/mic/imager/direct.py
 +++ b/scripts/lib/mic/imager/direct.py
 @@ -113,7 +113,15 @@ class DirectImageCreator(BaseImageCreator):
  device_name = /dev/ + p.disk + str(num + 1)
  else:
  device_name = /dev/ + p.disk + str(num)
 -fstab_entry = device_name + \t + p.mountpoint + \t + 
 p.fstype + \tdefaults\t0\t0\n
 +
 +opts = defaults
 +if p.fsopts:
 +opts = p.fsopts
 +
 +fstab_entry = device_name + \t + \
 +  p.mountpoint + \t + \
 +  p.fstype + \t + \
 +  opts + \t0\t0\n
  fstab_lines.append(fstab_entry)
  
  def _write_fstab(self, fstab, fstab_lines):


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


  1   2   3   4   5   >