All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] poky-tiny improvements
@ 2017-01-03 22:30 Alejandro Hernandez
  2017-01-03 22:30 ` [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only Alejandro Hernandez
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-03 22:30 UTC (permalink / raw)
  To: openembedded-core

This is the first set of patches meant to improve some of the characteristics
of poky-tiny, these patches are from or based on Tom Zanussi's work; includes
a new image recipe to be able to boot poky-tiny from initrd, along with 
changes to be able to create it using bootimg-efi, make it compatible with 
systemd-boot, and scripts to measure size of the image, kernel and modules.

The following changes since commit ce6e0c09723b4894beef32bba02785afdaff868b:

  bitbake: fetch2/wget: fixup case with no useful netrc data (2016-12-21 23:05:25 +0000)

are available in the git repository at:

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

Alejandro Hernandez (1):
  core-image-tiny-initramfs: Fix error message shown after a successful
    initrd boot

Tom Zanussi (5):
  image-live-artifacts: Add support for creating image artifacts only
  core-image-tiny-initramfs: Add and image creating image artifacts only
  ksize.py: Python 3 fixes
  scripts/tiny/ksum.py: New tool
  bootimg-efi: Look for image artifacts in a common location

 meta/classes/image-live-artifacts.bbclass          |  64 ++++++++
 meta/classes/image.bbclass                         |   4 +
 .../images/core-image-tiny-initramfs.bb            |  43 ++++++
 scripts/lib/wic/plugins/source/bootimg-efi.py      |  28 +++-
 scripts/tiny/ksize.py                              |  17 ++-
 scripts/tiny/ksum.py                               | 168 +++++++++++++++++++++
 6 files changed, 313 insertions(+), 11 deletions(-)
 create mode 100644 meta/classes/image-live-artifacts.bbclass
 create mode 100644 meta/recipes-core/images/core-image-tiny-initramfs.bb
 create mode 100755 scripts/tiny/ksum.py

-- 
2.6.6



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only
  2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
@ 2017-01-03 22:30 ` Alejandro Hernandez
  2017-01-03 22:41   ` Richard Purdie
  2017-01-03 22:30 ` [PATCH 2/6] core-image-tiny-initramfs: Add and image " Alejandro Hernandez
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-03 22:30 UTC (permalink / raw)
  To: openembedded-core

From: Tom Zanussi <tom.zanussi@linux.intel.com>

Rather than create an actual image, just put the image artifacts in an
'artifacts' directory that can then be picked up by wic.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 meta/classes/image-live-artifacts.bbclass | 64 +++++++++++++++++++++++++++++++
 meta/classes/image.bbclass                |  4 ++
 2 files changed, 68 insertions(+)
 create mode 100644 meta/classes/image-live-artifacts.bbclass

diff --git a/meta/classes/image-live-artifacts.bbclass b/meta/classes/image-live-artifacts.bbclass
new file mode 100644
index 0000000..e056336
--- /dev/null
+++ b/meta/classes/image-live-artifacts.bbclass
@@ -0,0 +1,64 @@
+# Copyright (C) 2004, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+# Creates a bootable image using syslinux, your kernel and an optional
+# initrd
+
+#
+# End result is two things:
+#
+# 1. A .hddimg file which is an msdos filesystem containing syslinux, a kernel,
+# an initrd and a rootfs image. These can be written to harddisks directly and
+# also booted on USB flash disks (write them there with dd).
+#
+# 2. A CD .iso image
+
+# Boot process is that the initrd will boot and process which label was selected
+# in syslinux. Actions based on the label are then performed (e.g. installing to
+# an hdd)
+
+# External variables (also used by syslinux.bbclass)
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
+# ${NOISO}  - skip building the ISO image if set to 1
+# ${NOHDD}  - skip building the HDD image if set to 1
+# ${HDDIMG_ID} - FAT image volume-id
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+
+inherit live-vm-common
+
+do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
+                        mtools-native:do_populate_sysroot \
+                        cdrtools-native:do_populate_sysroot \
+                        virtual/kernel:do_deploy \
+                        ${MLPREFIX}syslinux:do_populate_sysroot \
+                        syslinux-native:do_populate_sysroot \
+                        ${@oe.utils.ifelse(d.getVar('COMPRESSISO', False),'zisofs-tools-native:do_populate_sysroot','')} \
+                        "
+
+
+LABELS_LIVE ?= "boot install"
+
+ARTIFACTS_DIR = "${DEPLOY_DIR_IMAGE}/artifacts"
+
+populate_bootloader() {
+	populate_kernel ${ARTIFACTS_DIR}
+
+	if [ "${PCBIOS}" = "1" ]; then
+		syslinux_hddimg_populate ${ARTIFACTS_DIR}
+	fi
+	if [ "${EFI}" = "1" ]; then
+		efi_hddimg_populate ${ARTIFACTS_DIR}
+	fi
+}
+
+python do_bootimg() {
+    set_live_vm_vars(d, 'LIVE')
+    if d.getVar("PCBIOS", True) == "1":
+        bb.build.exec_func('build_syslinux_cfg', d)
+    if d.getVar("EFI", True) == "1":
+        bb.build.exec_func('build_efi_cfg', d)
+    bb.build.exec_func('populate_bootloader', d)
+}
+
+addtask bootimg before do_image_complete
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 04fd5f9..c3f5f2e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -130,6 +130,10 @@ do_rootfs[vardeps] += "${@rootfs_variables(d)}"
 do_build[depends] += "virtual/kernel:do_deploy"
 
 def build_live(d):
+    artifacts_only = d.getVar("ARTIFACTS_ONLY", True)
+    if artifacts_only:
+         return "image-live-artifacts"
+
     if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
         d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d))
         d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/6] core-image-tiny-initramfs: Add and image creating image artifacts only
  2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
  2017-01-03 22:30 ` [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only Alejandro Hernandez
@ 2017-01-03 22:30 ` Alejandro Hernandez
  2017-01-04 18:29   ` Leonardo Sandoval
  2017-01-03 22:30 ` [PATCH 3/6] ksize.py: Python 3 fixes Alejandro Hernandez
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-03 22:30 UTC (permalink / raw)
  To: openembedded-core

From: Tom Zanussi <tom.zanussi@linux.intel.com>

Add an image that simply creates image artifacts using
image-live-artifacts support instead of creating an actual image.

The image artifacts can then be subsequently assembled by an external
tool such as wic to create an actual image.

This eliminates redundant image creation when using such tools.
---
 .../images/core-image-tiny-initramfs.bb            | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 meta/recipes-core/images/core-image-tiny-initramfs.bb

diff --git a/meta/recipes-core/images/core-image-tiny-initramfs.bb b/meta/recipes-core/images/core-image-tiny-initramfs.bb
new file mode 100644
index 0000000..216f3e0
--- /dev/null
+++ b/meta/recipes-core/images/core-image-tiny-initramfs.bb
@@ -0,0 +1,31 @@
+# Simple initramfs image artifact generation for tiny images.
+DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently.  core-image-tiny-initramfs doesn't \
+actually generate an image but rather generates boot and rootfs artifacts \
+into a common location that can subsequently be picked up by external image \
+generation tools such as wic."
+
+PACKAGE_INSTALL = "initramfs-live-boot packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-tiny-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+# don't actually generate an image, just the artifacts needed for one
+ARTIFACTS_ONLY ?= "1"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
+
+# Use the same restriction as initramfs-live-install
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/6] ksize.py: Python 3 fixes
  2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
  2017-01-03 22:30 ` [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only Alejandro Hernandez
  2017-01-03 22:30 ` [PATCH 2/6] core-image-tiny-initramfs: Add and image " Alejandro Hernandez
@ 2017-01-03 22:30 ` Alejandro Hernandez
  2017-01-04  6:39   ` Khem Raj
  2017-01-03 22:30 ` [PATCH 4/6] scripts/tiny/ksum.py: New tool Alejandro Hernandez
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-03 22:30 UTC (permalink / raw)
  To: openembedded-core

From: Tom Zanussi <tom.zanussi@linux.intel.com>

String errors and partial __cmp__ fix.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/tiny/ksize.py | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/scripts/tiny/ksize.py b/scripts/tiny/ksize.py
index b9d2b19..ea1ca7f 100755
--- a/scripts/tiny/ksize.py
+++ b/scripts/tiny/ksize.py
@@ -41,7 +41,7 @@ def usage():
 class Sizes:
     def __init__(self, glob):
         self.title = glob
-        p = Popen("size -t " + glob, shell=True, stdout=PIPE, stderr=PIPE)
+        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, stderr=PIPE)
         output = p.communicate()[0].splitlines()
         if len(output) > 2:
             sizes = output[-1].split()[0:4]
@@ -62,18 +62,18 @@ class Report:
         r = Report(filename, title)
         path = os.path.dirname(filename)
 
-        p = Popen("ls " + path + "/*.o | grep -v built-in.o",
+        p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
                   shell=True, stdout=PIPE, stderr=PIPE)
         glob = ' '.join(p.communicate()[0].splitlines())
-        oreport = Report(glob, path + "/*.o")
-        oreport.sizes.title = path + "/*.o"
+        oreport = Report(glob, str(path) + "/*.o")
+        oreport.sizes.title = str(path) + "/*.o"
         r.parts.append(oreport)
 
         if subglob:
             p = Popen("ls " + subglob, shell=True, stdout=PIPE, stderr=PIPE)
             for f in p.communicate()[0].splitlines():
                 path = os.path.dirname(f)
-                r.parts.append(Report.create(f, path, path + "/*/built-in.o"))
+                r.parts.append(Report.create(f, path, str(path) + "/*/built-in.o"))
             r.parts.sort(reverse=True)
 
         for b in r.parts:
@@ -116,6 +116,13 @@ class Report:
                self.deltas["data"], self.deltas["bss"]))
         print("\n")
 
+    def __lt__(this, that):
+        if that is None:
+            return 1
+        if not isinstance(that, Report):
+            raise TypeError
+        return this.sizes.total < that.sizes.total
+
     def __cmp__(this, that):
         if that is None:
             return 1
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/6] scripts/tiny/ksum.py: New tool
  2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
                   ` (2 preceding siblings ...)
  2017-01-03 22:30 ` [PATCH 3/6] ksize.py: Python 3 fixes Alejandro Hernandez
@ 2017-01-03 22:30 ` Alejandro Hernandez
  2017-01-04  6:38   ` Khem Raj
  2017-01-03 22:30 ` [PATCH 5/6] bootimg-efi: Look for image artifacts in a common location Alejandro Hernandez
  2017-01-03 22:30 ` [PATCH 6/6] core-image-tiny-initramfs: Fix error message shown after a successful initrd boot Alejandro Hernandez
  5 siblings, 1 reply; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-03 22:30 UTC (permalink / raw)
  To: openembedded-core

From: Tom Zanussi <tom.zanussi@linux.intel.com>

'ksum.py' generates a combined summary of vmlinux and module sizes for
a built kernel, as a quick tool for comparing the overall effects of
systemic tinification changes.  Execute from the base directory of the
kernel build you want to summarize.  Setting the 'verbose' flag will
display the sizes for each file included in the summary.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/tiny/ksum.py | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 168 insertions(+)
 create mode 100755 scripts/tiny/ksum.py

diff --git a/scripts/tiny/ksum.py b/scripts/tiny/ksum.py
new file mode 100755
index 0000000..d4f3892
--- /dev/null
+++ b/scripts/tiny/ksum.py
@@ -0,0 +1,168 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2016, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION 'ksum.py' generates a combined summary of vmlinux and
+# module sizes for a built kernel, as a quick tool for comparing the
+# overall effects of systemic tinification changes.  Execute from the
+# base directory of the kernel build you want to summarize.  Setting
+# the 'verbose' flag will display the sizes for each file included in
+# the summary.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+__version__ = "0.1.0"
+
+# Python Standard Library modules
+import os
+import sys
+import getopt
+from subprocess import *
+
+def usage():
+    prog = os.path.basename(sys.argv[0])
+    print('Usage: %s [OPTION]...' % prog)
+    print('  -v,                 display sizes for each file')
+    print('  -h, --help          display this help and exit')
+    print('')
+    print('Run %s from the top-level Linux kernel build directory.' % prog)
+
+verbose = False
+
+n_ko_files = 0
+ko_file_list = []
+
+ko_text = 0
+ko_data = 0
+ko_bss = 0
+ko_total = 0
+
+vmlinux_file = ""
+vmlinux_level = 0
+
+vmlinux_text = 0
+vmlinux_data = 0
+vmlinux_bss = 0
+vmlinux_total = 0
+
+def is_vmlinux_file(filename):
+    global vmlinux_level
+    if filename == ("vmlinux") and vmlinux_level == 0:
+        vmlinux_level += 1
+        return True
+    return False
+
+def is_ko_file(filename):
+    if filename.endswith(".ko"):
+        return True
+    return False
+
+def collect_object_files():
+    print "Collecting object files recursively from %s..." % os.getcwd()
+    for dirpath, dirs, files in os.walk(os.getcwd()):
+        for filename in files:
+            if is_ko_file(filename):
+                ko_file_list.append(os.path.join(dirpath, filename))
+            elif is_vmlinux_file(filename):
+                global vmlinux_file
+                vmlinux_file = os.path.join(dirpath, filename)
+    print "Collecting object files [DONE]"
+
+def add_ko_file(filename):
+        p = Popen("size -t " + filename, shell=True, stdout=PIPE, stderr=PIPE)
+        output = p.communicate()[0].splitlines()
+        if len(output) > 2:
+            sizes = output[-1].split()[0:4]
+            if verbose:
+                print "     %10d %10d %10d %10d\t" % \
+                    (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
+                print "%s" % filename[len(os.getcwd()) + 1:]
+            global n_ko_files, ko_text, ko_data, ko_bss, ko_total
+            ko_text += int(sizes[0])
+            ko_data += int(sizes[1])
+            ko_bss += int(sizes[2])
+            ko_total += int(sizes[3])
+            n_ko_files += 1
+
+def get_vmlinux_totals():
+        p = Popen("size -t " + vmlinux_file, shell=True, stdout=PIPE, stderr=PIPE)
+        output = p.communicate()[0].splitlines()
+        if len(output) > 2:
+            sizes = output[-1].split()[0:4]
+            if verbose:
+                print "     %10d %10d %10d %10d\t" % \
+                    (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
+                print "%s" % vmlinux_file[len(os.getcwd()) + 1:]
+            global vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total
+            vmlinux_text += int(sizes[0])
+            vmlinux_data += int(sizes[1])
+            vmlinux_bss += int(sizes[2])
+            vmlinux_total += int(sizes[3])
+
+def sum_ko_files():
+    for ko_file in ko_file_list:
+        add_ko_file(ko_file)
+
+def main():
+    try:
+        opts, args = getopt.getopt(sys.argv[1:], "vh", ["help"])
+    except getopt.GetoptError as err:
+        print('%s' % str(err))
+        usage()
+        sys.exit(2)
+
+    for o, a in opts:
+        if o == '-v':
+            global verbose
+            verbose = True
+        elif o in ('-h', '--help'):
+            usage()
+            sys.exit(0)
+        else:
+            assert False, "unhandled option"
+
+    collect_object_files()
+    sum_ko_files()
+    get_vmlinux_totals()
+
+    print "\nTotals:"
+    print "\nvmlinux:"
+    print "    text\tdata\t\tbss\t\ttotal"
+    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
+        (vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total)
+    print "\nmodules (%d):" % n_ko_files
+    print "    text\tdata\t\tbss\t\ttotal"
+    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
+        (ko_text, ko_data, ko_bss, ko_total)
+    print "\nvmlinux + modules:"
+    print "    text\tdata\t\tbss\t\ttotal"
+    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
+        (vmlinux_text + ko_text, vmlinux_data + ko_data, \
+         vmlinux_bss + ko_bss, vmlinux_total + ko_total)
+
+if __name__ == "__main__":
+    try:
+        ret = main()
+    except Exception:
+        ret = 1
+        import traceback
+        traceback.print_exc(5)
+    sys.exit(ret)
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/6] bootimg-efi: Look for image artifacts in a common location
  2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
                   ` (3 preceding siblings ...)
  2017-01-03 22:30 ` [PATCH 4/6] scripts/tiny/ksum.py: New tool Alejandro Hernandez
@ 2017-01-03 22:30 ` Alejandro Hernandez
  2017-01-03 22:30 ` [PATCH 6/6] core-image-tiny-initramfs: Fix error message shown after a successful initrd boot Alejandro Hernandez
  5 siblings, 0 replies; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-03 22:30 UTC (permalink / raw)
  To: openembedded-core

From: Tom Zanussi <tom.zanussi@linux.intel.com>

Rather than have each image type look for artifacts in image-specific
locations, move towards having them look for artifacts in a common
location, in this case DEPLOY_DIR_IMAGE/artifacts.

This currently only applies to bootimg-efi images, and only if the
oe-core image classes have been modified to generate artifacts there
(e.g. using image-live-artifacts).

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 28 +++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 305e910..2c16a0f 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -42,7 +42,7 @@ class BootimgEFIPlugin(SourcePlugin):
     name = 'bootimg-efi'
 
     @classmethod
-    def do_configure_grubefi(cls, hdddir, creator, cr_workdir):
+    def do_configure_grubefi(cls, hdddir, creator, cr_workdir, source_params):
         """
         Create loader-specific (grub-efi) config
         """
@@ -82,7 +82,7 @@ class BootimgEFIPlugin(SourcePlugin):
         cfg.close()
 
     @classmethod
-    def do_configure_systemdboot(cls, hdddir, creator, cr_workdir):
+    def do_configure_systemdboot(cls, hdddir, creator, cr_workdir, source_params):
         """
         Create loader-specific systemd-boot/gummiboot config
         """
@@ -98,6 +98,18 @@ class BootimgEFIPlugin(SourcePlugin):
         loader_conf += "default boot\n"
         loader_conf += "timeout %d\n" % bootloader.timeout
 
+        initrd = ""
+
+        if source_params['initrd']:
+	    initrd = source_params['initrd']
+            # obviously we need to have a common common deploy var
+            bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+            if not bootimg_dir:
+                msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
+
+            cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
+            exec_cmd(cp_cmd, True)
+
         msger.debug("Writing systemd-boot config %s/hdd/boot/loader/loader.conf" \
                         % cr_workdir)
         cfg = open("%s/hdd/boot/loader/loader.conf" % cr_workdir, "w")
@@ -127,6 +139,9 @@ class BootimgEFIPlugin(SourcePlugin):
             boot_conf += "options LABEL=Boot root=%s %s\n" % \
                              (creator.rootdev, bootloader.append)
 
+           if initrd:
+                boot_conf += "initrd /%s\n" % initrd
+
         msger.debug("Writing systemd-boot config %s/hdd/boot/loader/entries/boot.conf" \
                         % cr_workdir)
         cfg = open("%s/hdd/boot/loader/entries/boot.conf" % cr_workdir, "w")
@@ -148,9 +163,9 @@ class BootimgEFIPlugin(SourcePlugin):
 
         try:
             if source_params['loader'] == 'grub-efi':
-                cls.do_configure_grubefi(hdddir, creator, cr_workdir)
+                cls.do_configure_grubefi(hdddir, creator, cr_workdir, source_params)
             elif source_params['loader'] == 'systemd-boot':
-                cls.do_configure_systemdboot(hdddir, creator, cr_workdir)
+                cls.do_configure_systemdboot(hdddir, creator, cr_workdir, source_params)
             else:
                 msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader'])
         except KeyError:
@@ -167,9 +182,10 @@ class BootimgEFIPlugin(SourcePlugin):
         In this case, prepare content for an EFI (grub) boot partition.
         """
         if not bootimg_dir:
-            bootimg_dir = get_bitbake_var("HDDDIR")
+	    bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
             if not bootimg_dir:
-                msger.error("Couldn't find HDDDIR, exiting\n")
+                 msger.error("Couldn't find DEPLOY_DIR_IMAGE, exiting\n")
+            bootimg_dir += "/artifacts"
             # just so the result notes display it
             creator.set_bootimg_dir(bootimg_dir)
 
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/6] core-image-tiny-initramfs: Fix error message shown after a successful initrd boot
  2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
                   ` (4 preceding siblings ...)
  2017-01-03 22:30 ` [PATCH 5/6] bootimg-efi: Look for image artifacts in a common location Alejandro Hernandez
@ 2017-01-03 22:30 ` Alejandro Hernandez
  5 siblings, 0 replies; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-03 22:30 UTC (permalink / raw)
  To: openembedded-core

When booting core-image-tiny-initramfs, since we want to live on initrd,
on purpose, we never find a rootfs image to switch root to,
this causes init to show an error as it would with other images,
this patch replaces the message shown to the user, avoiding confusion
when it was indeed a successful boot.

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
---
 meta/recipes-core/images/core-image-tiny-initramfs.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/recipes-core/images/core-image-tiny-initramfs.bb b/meta/recipes-core/images/core-image-tiny-initramfs.bb
index 216f3e0..a1a4f66 100644
--- a/meta/recipes-core/images/core-image-tiny-initramfs.bb
+++ b/meta/recipes-core/images/core-image-tiny-initramfs.bb
@@ -29,3 +29,15 @@ BAD_RECOMMENDATIONS += "busybox-syslog"
 
 # Use the same restriction as initramfs-live-install
 COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+
+python tinyinitrd () {
+  # Modify our init file so the user knows we drop to shell prompt on purpose
+  newinit = None
+  with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
+    newinit = init.read()
+    newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
+  with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
+    init.write(newinit)
+}
+
+IMAGE_PREPROCESS_COMMAND += "tinyinitrd;"
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only
  2017-01-03 22:30 ` [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only Alejandro Hernandez
@ 2017-01-03 22:41   ` Richard Purdie
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Purdie @ 2017-01-03 22:41 UTC (permalink / raw)
  To: Alejandro Hernandez, openembedded-core

On Tue, 2017-01-03 at 22:30 +0000, Alejandro Hernandez wrote:
> From: Tom Zanussi <tom.zanussi@linux.intel.com>
> 
> Rather than create an actual image, just put the image artifacts in
> an 'artifacts' directory that can then be picked up by wic.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>

I think the idea here is good, the implementation is suboptimal though.
The reason being it introduces more variables which do things outside a
clear namespace (ARTIFACTS_ONLY).

I'd really like to see this code trigger off an entry in IMAGE_FSTYPES
like IMAGE_FSTYPES = "live-artifacts-only" or some other such keyword.
The ultimate idea is we'd get rid of all these class specific variables
and you'd just set IMAGE_FSTYPES according to what you want.

The depends on COMPRESSISO also looks like a cut and paste which I'm
not sure could trigger in this codepath?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/6] scripts/tiny/ksum.py: New tool
  2017-01-03 22:30 ` [PATCH 4/6] scripts/tiny/ksum.py: New tool Alejandro Hernandez
@ 2017-01-04  6:38   ` Khem Raj
  0 siblings, 0 replies; 14+ messages in thread
From: Khem Raj @ 2017-01-04  6:38 UTC (permalink / raw)
  To: Alejandro Hernandez; +Cc: Patches and discussions about the oe-core layer

On Tue, Jan 3, 2017 at 2:30 PM, Alejandro Hernandez
<alejandro.hernandez@linux.intel.com> wrote:
> From: Tom Zanussi <tom.zanussi@linux.intel.com>
>
> 'ksum.py' generates a combined summary of vmlinux and module sizes for
> a built kernel, as a quick tool for comparing the overall effects of
> systemic tinification changes.  Execute from the base directory of the
> kernel build you want to summarize.  Setting the 'verbose' flag will
> display the sizes for each file included in the summary.
>

Does this work with python3 as well?

> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> ---
>  scripts/tiny/ksum.py | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 168 insertions(+)
>  create mode 100755 scripts/tiny/ksum.py
>
> diff --git a/scripts/tiny/ksum.py b/scripts/tiny/ksum.py
> new file mode 100755
> index 0000000..d4f3892
> --- /dev/null
> +++ b/scripts/tiny/ksum.py
> @@ -0,0 +1,168 @@
> +#!/usr/bin/env python
> +# ex:ts=4:sw=4:sts=4:et
> +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
> +#
> +# Copyright (c) 2016, Intel Corporation.
> +# All rights reserved.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License version 2 as
> +# published by the Free Software Foundation.
> +#
> +# 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.,
> +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> +#
> +# DESCRIPTION 'ksum.py' generates a combined summary of vmlinux and
> +# module sizes for a built kernel, as a quick tool for comparing the
> +# overall effects of systemic tinification changes.  Execute from the
> +# base directory of the kernel build you want to summarize.  Setting
> +# the 'verbose' flag will display the sizes for each file included in
> +# the summary.
> +#
> +# AUTHORS
> +# Tom Zanussi <tom.zanussi (at] linux.intel.com>
> +#
> +
> +__version__ = "0.1.0"
> +
> +# Python Standard Library modules
> +import os
> +import sys
> +import getopt
> +from subprocess import *
> +
> +def usage():
> +    prog = os.path.basename(sys.argv[0])
> +    print('Usage: %s [OPTION]...' % prog)
> +    print('  -v,                 display sizes for each file')
> +    print('  -h, --help          display this help and exit')
> +    print('')
> +    print('Run %s from the top-level Linux kernel build directory.' % prog)
> +
> +verbose = False
> +
> +n_ko_files = 0
> +ko_file_list = []
> +
> +ko_text = 0
> +ko_data = 0
> +ko_bss = 0
> +ko_total = 0
> +
> +vmlinux_file = ""
> +vmlinux_level = 0
> +
> +vmlinux_text = 0
> +vmlinux_data = 0
> +vmlinux_bss = 0
> +vmlinux_total = 0
> +
> +def is_vmlinux_file(filename):
> +    global vmlinux_level
> +    if filename == ("vmlinux") and vmlinux_level == 0:
> +        vmlinux_level += 1
> +        return True
> +    return False
> +
> +def is_ko_file(filename):
> +    if filename.endswith(".ko"):
> +        return True
> +    return False
> +
> +def collect_object_files():
> +    print "Collecting object files recursively from %s..." % os.getcwd()
> +    for dirpath, dirs, files in os.walk(os.getcwd()):
> +        for filename in files:
> +            if is_ko_file(filename):
> +                ko_file_list.append(os.path.join(dirpath, filename))
> +            elif is_vmlinux_file(filename):
> +                global vmlinux_file
> +                vmlinux_file = os.path.join(dirpath, filename)
> +    print "Collecting object files [DONE]"
> +
> +def add_ko_file(filename):
> +        p = Popen("size -t " + filename, shell=True, stdout=PIPE, stderr=PIPE)
> +        output = p.communicate()[0].splitlines()
> +        if len(output) > 2:
> +            sizes = output[-1].split()[0:4]
> +            if verbose:
> +                print "     %10d %10d %10d %10d\t" % \
> +                    (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
> +                print "%s" % filename[len(os.getcwd()) + 1:]
> +            global n_ko_files, ko_text, ko_data, ko_bss, ko_total
> +            ko_text += int(sizes[0])
> +            ko_data += int(sizes[1])
> +            ko_bss += int(sizes[2])
> +            ko_total += int(sizes[3])
> +            n_ko_files += 1
> +
> +def get_vmlinux_totals():
> +        p = Popen("size -t " + vmlinux_file, shell=True, stdout=PIPE, stderr=PIPE)
> +        output = p.communicate()[0].splitlines()
> +        if len(output) > 2:
> +            sizes = output[-1].split()[0:4]
> +            if verbose:
> +                print "     %10d %10d %10d %10d\t" % \
> +                    (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
> +                print "%s" % vmlinux_file[len(os.getcwd()) + 1:]
> +            global vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total
> +            vmlinux_text += int(sizes[0])
> +            vmlinux_data += int(sizes[1])
> +            vmlinux_bss += int(sizes[2])
> +            vmlinux_total += int(sizes[3])
> +
> +def sum_ko_files():
> +    for ko_file in ko_file_list:
> +        add_ko_file(ko_file)
> +
> +def main():
> +    try:
> +        opts, args = getopt.getopt(sys.argv[1:], "vh", ["help"])
> +    except getopt.GetoptError as err:
> +        print('%s' % str(err))
> +        usage()
> +        sys.exit(2)
> +
> +    for o, a in opts:
> +        if o == '-v':
> +            global verbose
> +            verbose = True
> +        elif o in ('-h', '--help'):
> +            usage()
> +            sys.exit(0)
> +        else:
> +            assert False, "unhandled option"
> +
> +    collect_object_files()
> +    sum_ko_files()
> +    get_vmlinux_totals()
> +
> +    print "\nTotals:"
> +    print "\nvmlinux:"
> +    print "    text\tdata\t\tbss\t\ttotal"
> +    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
> +        (vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total)
> +    print "\nmodules (%d):" % n_ko_files
> +    print "    text\tdata\t\tbss\t\ttotal"
> +    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
> +        (ko_text, ko_data, ko_bss, ko_total)
> +    print "\nvmlinux + modules:"
> +    print "    text\tdata\t\tbss\t\ttotal"
> +    print "    %-10d\t%-10d\t%-10d\t%-10d" % \
> +        (vmlinux_text + ko_text, vmlinux_data + ko_data, \
> +         vmlinux_bss + ko_bss, vmlinux_total + ko_total)
> +
> +if __name__ == "__main__":
> +    try:
> +        ret = main()
> +    except Exception:
> +        ret = 1
> +        import traceback
> +        traceback.print_exc(5)
> +    sys.exit(ret)
> --
> 2.6.6
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ksize.py: Python 3 fixes
  2017-01-03 22:30 ` [PATCH 3/6] ksize.py: Python 3 fixes Alejandro Hernandez
@ 2017-01-04  6:39   ` Khem Raj
  2017-01-04 18:21     ` Alejandro Hernandez
  0 siblings, 1 reply; 14+ messages in thread
From: Khem Raj @ 2017-01-04  6:39 UTC (permalink / raw)
  To: Alejandro Hernandez; +Cc: Patches and discussions about the oe-core layer

On Tue, Jan 3, 2017 at 2:30 PM, Alejandro Hernandez
<alejandro.hernandez@linux.intel.com> wrote:
> From: Tom Zanussi <tom.zanussi@linux.intel.com>
>
> String errors and partial __cmp__ fix.

may be fold it into previous patch.

>
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> ---
>  scripts/tiny/ksize.py | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/tiny/ksize.py b/scripts/tiny/ksize.py
> index b9d2b19..ea1ca7f 100755
> --- a/scripts/tiny/ksize.py
> +++ b/scripts/tiny/ksize.py
> @@ -41,7 +41,7 @@ def usage():
>  class Sizes:
>      def __init__(self, glob):
>          self.title = glob
> -        p = Popen("size -t " + glob, shell=True, stdout=PIPE, stderr=PIPE)
> +        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, stderr=PIPE)
>          output = p.communicate()[0].splitlines()
>          if len(output) > 2:
>              sizes = output[-1].split()[0:4]
> @@ -62,18 +62,18 @@ class Report:
>          r = Report(filename, title)
>          path = os.path.dirname(filename)
>
> -        p = Popen("ls " + path + "/*.o | grep -v built-in.o",
> +        p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
>                    shell=True, stdout=PIPE, stderr=PIPE)
>          glob = ' '.join(p.communicate()[0].splitlines())
> -        oreport = Report(glob, path + "/*.o")
> -        oreport.sizes.title = path + "/*.o"
> +        oreport = Report(glob, str(path) + "/*.o")
> +        oreport.sizes.title = str(path) + "/*.o"
>          r.parts.append(oreport)
>
>          if subglob:
>              p = Popen("ls " + subglob, shell=True, stdout=PIPE, stderr=PIPE)
>              for f in p.communicate()[0].splitlines():
>                  path = os.path.dirname(f)
> -                r.parts.append(Report.create(f, path, path + "/*/built-in.o"))
> +                r.parts.append(Report.create(f, path, str(path) + "/*/built-in.o"))
>              r.parts.sort(reverse=True)
>
>          for b in r.parts:
> @@ -116,6 +116,13 @@ class Report:
>                 self.deltas["data"], self.deltas["bss"]))
>          print("\n")
>
> +    def __lt__(this, that):
> +        if that is None:
> +            return 1
> +        if not isinstance(that, Report):
> +            raise TypeError
> +        return this.sizes.total < that.sizes.total
> +
>      def __cmp__(this, that):
>          if that is None:
>              return 1
> --
> 2.6.6
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ksize.py: Python 3 fixes
  2017-01-04  6:39   ` Khem Raj
@ 2017-01-04 18:21     ` Alejandro Hernandez
  2017-01-04 22:18       ` Alejandro Hernandez
  0 siblings, 1 reply; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-04 18:21 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

Hey Khem,


Its an old script fro Tom, but as far as I remember it worked fine on 
python3, although thanks for checking and sending the patch!

Cheers

Alejandro


On 01/04/2017 12:39 AM, Khem Raj wrote:
> On Tue, Jan 3, 2017 at 2:30 PM, Alejandro Hernandez
> <alejandro.hernandez@linux.intel.com> wrote:
>> From: Tom Zanussi <tom.zanussi@linux.intel.com>
>>
>> String errors and partial __cmp__ fix.
> may be fold it into previous patch.
>
>> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
>> ---
>>   scripts/tiny/ksize.py | 17 ++++++++++++-----
>>   1 file changed, 12 insertions(+), 5 deletions(-)
>>
>> diff --git a/scripts/tiny/ksize.py b/scripts/tiny/ksize.py
>> index b9d2b19..ea1ca7f 100755
>> --- a/scripts/tiny/ksize.py
>> +++ b/scripts/tiny/ksize.py
>> @@ -41,7 +41,7 @@ def usage():
>>   class Sizes:
>>       def __init__(self, glob):
>>           self.title = glob
>> -        p = Popen("size -t " + glob, shell=True, stdout=PIPE, stderr=PIPE)
>> +        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, stderr=PIPE)
>>           output = p.communicate()[0].splitlines()
>>           if len(output) > 2:
>>               sizes = output[-1].split()[0:4]
>> @@ -62,18 +62,18 @@ class Report:
>>           r = Report(filename, title)
>>           path = os.path.dirname(filename)
>>
>> -        p = Popen("ls " + path + "/*.o | grep -v built-in.o",
>> +        p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
>>                     shell=True, stdout=PIPE, stderr=PIPE)
>>           glob = ' '.join(p.communicate()[0].splitlines())
>> -        oreport = Report(glob, path + "/*.o")
>> -        oreport.sizes.title = path + "/*.o"
>> +        oreport = Report(glob, str(path) + "/*.o")
>> +        oreport.sizes.title = str(path) + "/*.o"
>>           r.parts.append(oreport)
>>
>>           if subglob:
>>               p = Popen("ls " + subglob, shell=True, stdout=PIPE, stderr=PIPE)
>>               for f in p.communicate()[0].splitlines():
>>                   path = os.path.dirname(f)
>> -                r.parts.append(Report.create(f, path, path + "/*/built-in.o"))
>> +                r.parts.append(Report.create(f, path, str(path) + "/*/built-in.o"))
>>               r.parts.sort(reverse=True)
>>
>>           for b in r.parts:
>> @@ -116,6 +116,13 @@ class Report:
>>                  self.deltas["data"], self.deltas["bss"]))
>>           print("\n")
>>
>> +    def __lt__(this, that):
>> +        if that is None:
>> +            return 1
>> +        if not isinstance(that, Report):
>> +            raise TypeError
>> +        return this.sizes.total < that.sizes.total
>> +
>>       def __cmp__(this, that):
>>           if that is None:
>>               return 1
>> --
>> 2.6.6
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/6] core-image-tiny-initramfs: Add and image creating image artifacts only
  2017-01-03 22:30 ` [PATCH 2/6] core-image-tiny-initramfs: Add and image " Alejandro Hernandez
@ 2017-01-04 18:29   ` Leonardo Sandoval
  0 siblings, 0 replies; 14+ messages in thread
From: Leonardo Sandoval @ 2017-01-04 18:29 UTC (permalink / raw)
  To: Alejandro Hernandez, openembedded-core

Alex, the patch requires to be signed off.


On 01/03/2017 04:30 PM, Alejandro Hernandez wrote:
> From: Tom Zanussi <tom.zanussi@linux.intel.com>
>
> Add an image that simply creates image artifacts using
> image-live-artifacts support instead of creating an actual image.
>
> The image artifacts can then be subsequently assembled by an external
> tool such as wic to create an actual image.
>
> This eliminates redundant image creation when using such tools.
> ---
>   .../images/core-image-tiny-initramfs.bb            | 31 ++++++++++++++++++++++
>   1 file changed, 31 insertions(+)
>   create mode 100644 meta/recipes-core/images/core-image-tiny-initramfs.bb
>
> diff --git a/meta/recipes-core/images/core-image-tiny-initramfs.bb b/meta/recipes-core/images/core-image-tiny-initramfs.bb
> new file mode 100644
> index 0000000..216f3e0
> --- /dev/null
> +++ b/meta/recipes-core/images/core-image-tiny-initramfs.bb
> @@ -0,0 +1,31 @@
> +# Simple initramfs image artifact generation for tiny images.
> +DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
> +the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
> +first 'init' program more efficiently.  core-image-tiny-initramfs doesn't \
> +actually generate an image but rather generates boot and rootfs artifacts \
> +into a common location that can subsequently be picked up by external image \
> +generation tools such as wic."
> +
> +PACKAGE_INSTALL = "initramfs-live-boot packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
> +
> +# Do not pollute the initrd image with rootfs features
> +IMAGE_FEATURES = ""
> +
> +export IMAGE_BASENAME = "core-image-tiny-initramfs"
> +IMAGE_LINGUAS = ""
> +
> +LICENSE = "MIT"
> +
> +# don't actually generate an image, just the artifacts needed for one
> +ARTIFACTS_ONLY ?= "1"
> +
> +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
> +inherit core-image
> +
> +IMAGE_ROOTFS_SIZE = "8192"
> +IMAGE_ROOTFS_EXTRA_SPACE = "0"
> +
> +BAD_RECOMMENDATIONS += "busybox-syslog"
> +
> +# Use the same restriction as initramfs-live-install
> +COMPATIBLE_HOST = "(i.86|x86_64).*-linux"



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ksize.py: Python 3 fixes
  2017-01-04 18:21     ` Alejandro Hernandez
@ 2017-01-04 22:18       ` Alejandro Hernandez
  2017-01-04 23:52         ` Khem Raj
  0 siblings, 1 reply; 14+ messages in thread
From: Alejandro Hernandez @ 2017-01-04 22:18 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

Hey Khem,

Ok, now I'm actually awake when reading this, are you saying these 
changes should go in the same patch as the one for ksum.py?


On 01/04/2017 12:21 PM, Alejandro Hernandez wrote:
> Hey Khem,
>
>
> Its an old script fro Tom, but as far as I remember it worked fine on 
> python3, although thanks for checking and sending the patch!
>
> Cheers
>
> Alejandro
>
>
> On 01/04/2017 12:39 AM, Khem Raj wrote:
>> On Tue, Jan 3, 2017 at 2:30 PM, Alejandro Hernandez
>> <alejandro.hernandez@linux.intel.com> wrote:
>>> From: Tom Zanussi <tom.zanussi@linux.intel.com>
>>>
>>> String errors and partial __cmp__ fix.
>> may be fold it into previous patch.
>>
>>> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
>>> ---
>>>   scripts/tiny/ksize.py | 17 ++++++++++++-----
>>>   1 file changed, 12 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/scripts/tiny/ksize.py b/scripts/tiny/ksize.py
>>> index b9d2b19..ea1ca7f 100755
>>> --- a/scripts/tiny/ksize.py
>>> +++ b/scripts/tiny/ksize.py
>>> @@ -41,7 +41,7 @@ def usage():
>>>   class Sizes:
>>>       def __init__(self, glob):
>>>           self.title = glob
>>> -        p = Popen("size -t " + glob, shell=True, stdout=PIPE, 
>>> stderr=PIPE)
>>> +        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, 
>>> stderr=PIPE)
>>>           output = p.communicate()[0].splitlines()
>>>           if len(output) > 2:
>>>               sizes = output[-1].split()[0:4]
>>> @@ -62,18 +62,18 @@ class Report:
>>>           r = Report(filename, title)
>>>           path = os.path.dirname(filename)
>>>
>>> -        p = Popen("ls " + path + "/*.o | grep -v built-in.o",
>>> +        p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
>>>                     shell=True, stdout=PIPE, stderr=PIPE)
>>>           glob = ' '.join(p.communicate()[0].splitlines())
>>> -        oreport = Report(glob, path + "/*.o")
>>> -        oreport.sizes.title = path + "/*.o"
>>> +        oreport = Report(glob, str(path) + "/*.o")
>>> +        oreport.sizes.title = str(path) + "/*.o"
>>>           r.parts.append(oreport)
>>>
>>>           if subglob:
>>>               p = Popen("ls " + subglob, shell=True, stdout=PIPE, 
>>> stderr=PIPE)
>>>               for f in p.communicate()[0].splitlines():
>>>                   path = os.path.dirname(f)
>>> -                r.parts.append(Report.create(f, path, path + 
>>> "/*/built-in.o"))
>>> +                r.parts.append(Report.create(f, path, str(path) + 
>>> "/*/built-in.o"))
>>>               r.parts.sort(reverse=True)
>>>
>>>           for b in r.parts:
>>> @@ -116,6 +116,13 @@ class Report:
>>>                  self.deltas["data"], self.deltas["bss"]))
>>>           print("\n")
>>>
>>> +    def __lt__(this, that):
>>> +        if that is None:
>>> +            return 1
>>> +        if not isinstance(that, Report):
>>> +            raise TypeError
>>> +        return this.sizes.total < that.sizes.total
>>> +
>>>       def __cmp__(this, that):
>>>           if that is None:
>>>               return 1
>>> -- 
>>> 2.6.6
>>>
>>> -- 
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] ksize.py: Python 3 fixes
  2017-01-04 22:18       ` Alejandro Hernandez
@ 2017-01-04 23:52         ` Khem Raj
  0 siblings, 0 replies; 14+ messages in thread
From: Khem Raj @ 2017-01-04 23:52 UTC (permalink / raw)
  To: Alejandro Hernandez; +Cc: Patches and discussions about the oe-core layer

On Wed, Jan 4, 2017 at 2:18 PM, Alejandro Hernandez
<alejandro.hernandez@linux.intel.com> wrote:
> Hey Khem,
>
> Ok, now I'm actually awake when reading this, are you saying these changes
> should go in the same patch as the one for ksum.py?
>

yes thats right.

>
>
> On 01/04/2017 12:21 PM, Alejandro Hernandez wrote:
>>
>> Hey Khem,
>>
>>
>> Its an old script fro Tom, but as far as I remember it worked fine on
>> python3, although thanks for checking and sending the patch!
>>
>> Cheers
>>
>> Alejandro
>>
>>
>> On 01/04/2017 12:39 AM, Khem Raj wrote:
>>>
>>> On Tue, Jan 3, 2017 at 2:30 PM, Alejandro Hernandez
>>> <alejandro.hernandez@linux.intel.com> wrote:
>>>>
>>>> From: Tom Zanussi <tom.zanussi@linux.intel.com>
>>>>
>>>> String errors and partial __cmp__ fix.
>>>
>>> may be fold it into previous patch.
>>>
>>>> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
>>>> ---
>>>>   scripts/tiny/ksize.py | 17 ++++++++++++-----
>>>>   1 file changed, 12 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/scripts/tiny/ksize.py b/scripts/tiny/ksize.py
>>>> index b9d2b19..ea1ca7f 100755
>>>> --- a/scripts/tiny/ksize.py
>>>> +++ b/scripts/tiny/ksize.py
>>>> @@ -41,7 +41,7 @@ def usage():
>>>>   class Sizes:
>>>>       def __init__(self, glob):
>>>>           self.title = glob
>>>> -        p = Popen("size -t " + glob, shell=True, stdout=PIPE,
>>>> stderr=PIPE)
>>>> +        p = Popen("size -t " + str(glob), shell=True, stdout=PIPE,
>>>> stderr=PIPE)
>>>>           output = p.communicate()[0].splitlines()
>>>>           if len(output) > 2:
>>>>               sizes = output[-1].split()[0:4]
>>>> @@ -62,18 +62,18 @@ class Report:
>>>>           r = Report(filename, title)
>>>>           path = os.path.dirname(filename)
>>>>
>>>> -        p = Popen("ls " + path + "/*.o | grep -v built-in.o",
>>>> +        p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
>>>>                     shell=True, stdout=PIPE, stderr=PIPE)
>>>>           glob = ' '.join(p.communicate()[0].splitlines())
>>>> -        oreport = Report(glob, path + "/*.o")
>>>> -        oreport.sizes.title = path + "/*.o"
>>>> +        oreport = Report(glob, str(path) + "/*.o")
>>>> +        oreport.sizes.title = str(path) + "/*.o"
>>>>           r.parts.append(oreport)
>>>>
>>>>           if subglob:
>>>>               p = Popen("ls " + subglob, shell=True, stdout=PIPE,
>>>> stderr=PIPE)
>>>>               for f in p.communicate()[0].splitlines():
>>>>                   path = os.path.dirname(f)
>>>> -                r.parts.append(Report.create(f, path, path +
>>>> "/*/built-in.o"))
>>>> +                r.parts.append(Report.create(f, path, str(path) +
>>>> "/*/built-in.o"))
>>>>               r.parts.sort(reverse=True)
>>>>
>>>>           for b in r.parts:
>>>> @@ -116,6 +116,13 @@ class Report:
>>>>                  self.deltas["data"], self.deltas["bss"]))
>>>>           print("\n")
>>>>
>>>> +    def __lt__(this, that):
>>>> +        if that is None:
>>>> +            return 1
>>>> +        if not isinstance(that, Report):
>>>> +            raise TypeError
>>>> +        return this.sizes.total < that.sizes.total
>>>> +
>>>>       def __cmp__(this, that):
>>>>           if that is None:
>>>>               return 1
>>>> --
>>>> 2.6.6
>>>>
>>>> --
>>>> _______________________________________________
>>>> Openembedded-core mailing list
>>>> Openembedded-core@lists.openembedded.org
>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
>>
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-01-04 23:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 22:30 [PATCH 0/6] poky-tiny improvements Alejandro Hernandez
2017-01-03 22:30 ` [PATCH 1/6] image-live-artifacts: Add support for creating image artifacts only Alejandro Hernandez
2017-01-03 22:41   ` Richard Purdie
2017-01-03 22:30 ` [PATCH 2/6] core-image-tiny-initramfs: Add and image " Alejandro Hernandez
2017-01-04 18:29   ` Leonardo Sandoval
2017-01-03 22:30 ` [PATCH 3/6] ksize.py: Python 3 fixes Alejandro Hernandez
2017-01-04  6:39   ` Khem Raj
2017-01-04 18:21     ` Alejandro Hernandez
2017-01-04 22:18       ` Alejandro Hernandez
2017-01-04 23:52         ` Khem Raj
2017-01-03 22:30 ` [PATCH 4/6] scripts/tiny/ksum.py: New tool Alejandro Hernandez
2017-01-04  6:38   ` Khem Raj
2017-01-03 22:30 ` [PATCH 5/6] bootimg-efi: Look for image artifacts in a common location Alejandro Hernandez
2017-01-03 22:30 ` [PATCH 6/6] core-image-tiny-initramfs: Fix error message shown after a successful initrd boot Alejandro Hernandez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.