[OE-core] [PATCH] libsndfile: Security Advisory - libsndfile - CVE-2014-9496
From: Yue Tao yue@windriver.com Backport two commits from libsndfile upstream to fix a segfault and two potential buffer overflows. Signed-off-by: Yue Tao yue@windriver.com --- ...src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch | 211 + ...c-Fix-two-potential-buffer-read-overflows.patch | 49 + .../libsndfile/libsndfile1_1.0.25.bb | 5 +- 3 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch create mode 100644 meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch diff --git a/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch new file mode 100644 index 000..cd48710 --- /dev/null +++ b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch @@ -0,0 +1,211 @@ +From 9341e9c6e70cd3ad76c901c3cf052d4cb52fd827 Mon Sep 17 00:00:00 2001 +From: Erik de Castro Lopo er...@mega-nerd.com +Date: Thu, 27 Jun 2013 18:04:03 +1000 +Subject: [PATCH] src/sd2.c : Fix segfault in SD2 RSRC parser. + +(Upstream commit 9341e9c6e70cd3ad76c901c3cf052d4cb52fd827) + +A specially crafted resource fork for an SD2 file can cause +the SD2 RSRC parser to read data from outside a dynamically +defined buffer. The data that is read is converted into a +short or int and used during further processing. + +Since no write occurs, this is unlikely to be exploitable. + +Bug reported by The Mayhem Team from Cylab, Carnegie Mellon +Univeristy. Paper is: +http://users.ece.cmu.edu/~arebert/papers/mayhem-oakland-12.pdf + +Upstream-Status: Backport + +Signed-off-by: Yue Tao yue@windriver.com +--- + src/sd2.c | 93 - + 1 file changed, 55 insertions(+), 38 deletions(-) + +diff --git a/src/sd2.c b/src/sd2.c +index 35ce36b..6be150c 100644 +--- a/src/sd2.c b/src/sd2.c +@@ -1,5 +1,5 @@ + /* +-** Copyright (C) 2001-2011 Erik de Castro Lopo er...@mega-nerd.com ++** Copyright (C) 2001-2013 Erik de Castro Lopo er...@mega-nerd.com + ** Copyright (C) 2004 Paavo Jumppanen + ** + ** This program is free software; you can redistribute it and/or modify +@@ -371,44 +371,61 @@ sd2_write_rsrc_fork (SF_PRIVATE *psf, int UNUSED (calc_length)) + */ + + static inline int +-read_char (const unsigned char * data, int offset) +-{ return data [offset] ; +-} /* read_char */ ++read_rsrc_char (const SD2_RSRC *prsrc, int offset) ++{ const unsigned char * data = prsrc-rsrc_data ; ++ if (offset 0 || offset = prsrc-rsrc_len) ++ return 0 ; ++ return data [offset] ; ++} /* read_rsrc_char */ + + static inline int +-read_short (const unsigned char * data, int offset) +-{ return (data [offset] 8) + data [offset + 1] ; +-} /* read_short */ ++read_rsrc_short (const SD2_RSRC *prsrc, int offset) ++{ const unsigned char * data = prsrc-rsrc_data ; ++ if (offset 0 || offset + 1 = prsrc-rsrc_len) ++ return 0 ; ++ return (data [offset] 8) + data [offset + 1] ; ++} /* read_rsrc_short */ + + static inline int +-read_int (const unsigned char * data, int offset) +-{ return (data [offset] 24) + (data [offset + 1] 16) + (data [offset + 2] 8) + data [offset + 3] ; +-} /* read_int */ ++read_rsrc_int (const SD2_RSRC *prsrc, int offset) ++{ const unsigned char * data = prsrc-rsrc_data ; ++ if (offset 0 || offset + 3 = prsrc-rsrc_len) ++ return 0 ; ++ return (data [offset] 24) + (data [offset + 1] 16) + (data [offset + 2] 8) + data [offset + 3] ; ++} /* read_rsrc_int */ + + static inline int +-read_marker (const unsigned char * data, int offset) +-{ ++read_rsrc_marker (const SD2_RSRC *prsrc, int offset) ++{ const unsigned char * data = prsrc-rsrc_data ; ++ ++ if (offset 0 || offset + 3 = prsrc-rsrc_len) ++ return 0 ; ++ + if (CPU_IS_BIG_ENDIAN) + return (data [offset] 24) + (data [offset + 1] 16) + (data [offset + 2] 8) + data [offset + 3] ; +- else if (CPU_IS_LITTLE_ENDIAN) ++ if (CPU_IS_LITTLE_ENDIAN) + return data [offset] + (data [offset + 1] 8) + (data [offset + 2] 16) + (data [offset + 3] 24) ; +- else +- return 0x666 ; +-} /* read_marker */ ++ ++ return 0 ; ++} /* read_rsrc_marker */ + + static void +-read_str (const unsigned char * data, int offset, char * buffer, int buffer_len) +-{ int k ; ++read_rsrc_str (const SD2_RSRC *prsrc, int offset, char * buffer, int buffer_len) ++{ const unsigned char * data = prsrc-rsrc_data ; ++ int k ; + + memset (buffer, 0, buffer_len) ; + ++ if (offset 0 || offset + buffer_len = prsrc-rsrc_len) ++ return ; ++ + for (k = 0 ; k buffer_len - 1 ; k++) + {
[OE-core] [wic][PATCH 4/4] wic: pylinted partitionedfs.py
Fixed some pylint findings in partitionedfs.py Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index dcb63e5..902548f 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -31,7 +31,7 @@ GPT_OVERHEAD = 34 # Size of a sector in bytes SECTOR_SIZE = 512 -class Image: +class Image(object): Generic base object for an image. @@ -58,14 +58,14 @@ class Image: assert not self._partitions_layed_out self.disks[disk_name] = \ -{ 'disk': None, # Disk object - 'numpart': 0, # Number of allocate partitions - 'realpart': 0,# Number of partitions in the partition table - 'partitions': [], # Indexes to self.partitions - 'offset': 0, # Offset of next partition (in sectors) - # Minimum required disk size to fit all partitions (in bytes) - 'min_size': 0, - 'ptable_format': msdos } # Partition table format +{'disk': None, # Disk object + 'numpart': 0, # Number of allocate partitions + 'realpart': 0,# Number of partitions in the partition table + 'partitions': [], # Indexes to self.partitions + 'offset': 0, # Offset of next partition (in sectors) + # Minimum required disk size to fit all partitions (in bytes) + 'min_size': 0, + 'ptable_format': msdos} # Partition table format def add_disk(self, disk_name, disk_obj): Add a disk object which have to be partitioned. More than one disk @@ -97,20 +97,20 @@ class Image: # We still need partition for / or non-subvolume 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 - 'source_file': source_file, # partition contents - 'fstype': fstype, # Filesystem type - 'fsopts': fsopts, # Filesystem mount options - 'label': label, # Partition label - 'disk_name': disk_name, # physical disk name holding partition - 'device': None, # kpartx device node for partition - 'num': None, # Partition number - 'boot': boot, # Bootable flag - 'align': align, # Partition alignment - 'no_table' : no_table, # Partition does not appear in partition table - 'part_type' : part_type } # Partition type +part = {'ks_pnum': ks_pnum, # Partition number in the KS file +'size': size, # In sectors +'mountpoint': mountpoint, # Mount relative to chroot +'source_file': source_file, # partition contents +'fstype': fstype, # Filesystem type +'fsopts': fsopts, # Filesystem mount options +'label': label, # Partition label +'disk_name': disk_name, # physical disk name holding partition +'device': None, # kpartx device node for partition +'num': None, # Partition number +'boot': boot, # Bootable flag +'align': align, # Partition alignment +'no_table' : no_table, # Partition does not appear in partition table +'part_type' : part_type} # Partition type self.__add_partition(part) @@ -213,7 +213,7 @@ class Image: # Once all the partitions have been layed out, we can calculate the # minumim disk sizes. -for disk_name, d in self.disks.items(): +for d in self.disks.values(): d['min_size'] = d['offset'] if d['ptable_format'] == gpt: d['min_size'] += GPT_OVERHEAD @@ -314,14 +314,14 @@ class Image: def cleanup(self): if self.disks: -for dev in self.disks.keys(): +for dev in self.disks: d = self.disks[dev] try: d['disk'].cleanup() except: pass -def __write_partition(self, num, source_file, start, size): +def __write_partition(self, num, source_file, start, size, image_file): Install source_file contents into a partition. @@ -330,23 +330,20 @@ class Image: # Start is included in the size so need to substract one from the end. end = start + size - 1 -msger.debug(Installed %s in partition %d, sectors %d-%d, size %d sectors % (source_file, num, start, end, size)) +
[OE-core] [wic][PATCH 0/4] Code cleanup and refactoring
Hi, This patchset includes cleanup and refactoring patches made during implementation of partition UUID support. Without this work I'd end up in duplicating a lot of code, so I decided to clean it up a bit. Please, review. Ed Bartosh (4): wic: removed exec_cmd_quiet and exec_native_cmd_quiet wic: move checks to exec_native_cmd wic: replaced __run_parted with exec_native_cmd wic: pylinted partitionedfs.py .../lib/wic/kickstart/custom_commands/partition.py | 21 + scripts/lib/wic/utils/oe/misc.py | 27 ++ scripts/lib/wic/utils/partitionedfs.py | 105 + 3 files changed, 54 insertions(+), 99 deletions(-) -- EPlease, review.d -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 2/4] wic: move checks to exec_native_cmd
Checked for return code and output of native commands inside exec_native_cmd. Removed similar code from a lot of places where exec_native_cmd is called. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index d9f77d9..5d033bb 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -257,10 +257,7 @@ class Wic_PartData(Mic_PartData): mkfs_cmd = mkfs.%s -F %s %s %s -d %s % \ (self.fstype, extra_imagecmd, rootfs, label_str, image_rootfs) -(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)) +exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) # get the rootfs size in the right units for kickstart (kB) du_cmd = du -Lbks %s % rootfs @@ -307,9 +304,7 @@ class Wic_PartData(Mic_PartData): mkfs_cmd = mkfs.%s -b %d -r %s %s %s % \ (self.fstype, rootfs_size * 1024, image_rootfs, label_str, rootfs) -(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)) +exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) # get the rootfs size in the right units for kickstart (kB) du_cmd = du -Lbks %s % rootfs @@ -357,9 +352,7 @@ class Wic_PartData(Mic_PartData): exec_native_cmd(dosfs_cmd, native_sysroot) mcopy_cmd = mcopy -i %s -s %s/* ::/ % (rootfs, image_rootfs) -rc, out = exec_native_cmd(mcopy_cmd, native_sysroot) -if rc: -msger.error(ERROR: mcopy returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details) % rc) +exec_native_cmd(mcopy_cmd, native_sysroot) chmod_cmd = chmod 644 %s % rootfs exec_cmd(chmod_cmd) @@ -432,9 +425,7 @@ class Wic_PartData(Mic_PartData): mkfs_cmd = mkfs.%s -F %s %s %s % \ (self.fstype, extra_imagecmd, label_str, fs) -(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)) +exec_native_cmd(mkfs_cmd, native_sysroot) self.source_file = fs @@ -458,9 +449,7 @@ class Wic_PartData(Mic_PartData): mkfs_cmd = mkfs.%s -b %d %s %s % \ (self.fstype, self.size * 1024, label_str, fs) -(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)) +exec_native_cmd(mkfs_cmd, native_sysroot) self.source_file = fs diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py index 9eaf039..f08ff15 100644 --- a/scripts/lib/wic/utils/oe/misc.py +++ b/scripts/lib/wic/utils/oe/misc.py @@ -86,6 +86,12 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): msger.error(A native program %s required to build the image was not found (see details above). Please make sure it's installed and try again. % args[0]) +if out: +msger.debug('%s output: %s' % (args[0], out)) + +if rc != 0: +msger.error(exec_cmd: '%s' returned '%s' instead of 0 % \ +(cmd_and_args, rc)) return (rc, out) diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index eacf267..8fd44a6 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -227,17 +227,7 @@ class Image: args = ' '.join(args) msger.debug(args) -rc, out = exec_native_cmd(args, self.native_sysroot) - -if out: -msger.debug('parted output: %s' % out) - -if rc != 0: -# We don't throw exception when return code is not 0, because -# parted always fails to reload part table with loop devices. This -# prevents us from distinguishing real errors based on return -# code. -msger.error(WARNING: parted returned '%s' instead of 0 (use --debug for details) % rc) +exec_native_cmd(args, self.native_sysroot) def __create_partition(self, device, parttype, fstype, start, size): Create a
[OE-core] [wic][PATCH 3/4] wic: replaced __run_parted with exec_native_cmd
There is no need for yet another wrapper around exec_native_cmd. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 8fd44a6..dcb63e5 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -220,15 +220,6 @@ class Image: d['min_size'] *= self.sector_size -def __run_parted(self, args): - Run parted with arguments specified in the 'args' list. - -args.insert(0, parted) -args = ' '.join(args) -msger.debug(args) - -exec_native_cmd(args, self.native_sysroot) - def __create_partition(self, device, parttype, fstype, start, size): Create a partition on an image described by the 'device' object. @@ -237,12 +228,12 @@ class Image: msger.debug(Added '%s' partition, sectors %d-%d, size %d sectors % (parttype, start, end, size)) -args = [-s, device, unit, s, mkpart, parttype] +cmd = parted -s %s unit s mkpart %s % (device, parttype) if fstype: -args.extend([fstype]) -args.extend([%d % start, %d % end]) +cmd += %s % fstype +cmd += %d %d % (start, end) -return self.__run_parted(args) +return exec_native_cmd(cmd, self.native_sysroot) def __format_disks(self): self.layout_partitions() @@ -251,8 +242,9 @@ class Image: d = self.disks[dev] msger.debug(Initializing partition table for %s % \ (d['disk'].device)) -self.__run_parted([-s, d['disk'].device, mklabel, - d['ptable_format']]) +exec_native_cmd(parted -s %s mklabel %s % \ +(d['disk'].device, d['ptable_format']), +self.native_sysroot) msger.debug(Creating partitions) @@ -305,8 +297,9 @@ class Image: flag_name = legacy_boot if d['ptable_format'] == 'gpt' else boot msger.debug(Set '%s' flag for partition '%s' on disk '%s' % \ (flag_name, p['num'], d['disk'].device)) -self.__run_parted([-s, d['disk'].device, set, - %d % p['num'], flag_name, on]) +exec_native_cmd(parted -s %s set %d %s on % \ +(d['disk'].device, p['num'], flag_name), +self.native_sysroot) # Parted defaults to enabling the lba flag for fat16 partitions, # which causes compatibility issues with some firmware (and really @@ -315,8 +308,9 @@ class Image: if d['ptable_format'] == 'msdos': msger.debug(Disable 'lba' flag for partition '%s' on disk '%s' % \ (p['num'], d['disk'].device)) -self.__run_parted([-s, d['disk'].device, set, - %d % p['num'], lba, off]) +exec_native_cmd(parted -s %s set %d lba off % \ +(d['disk'].device, p['num']), +self.native_sysroot) def cleanup(self): if self.disks: -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 1/4] wic: removed exec_cmd_quiet and exec_native_cmd_quiet
These functions are not used anywhere. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py index 2f5299d..9eaf039 100644 --- a/scripts/lib/wic/utils/oe/misc.py +++ b/scripts/lib/wic/utils/oe/misc.py @@ -63,15 +63,6 @@ def exec_cmd(cmd_and_args, as_shell=False, catch=3): return out -def exec_cmd_quiet(cmd_and_args, as_shell=False): - -Execute command, catching nothing in the output - -Exits if rc non-zero - -return exec_cmd(cmd_and_args, as_shell, 0) - - def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): Execute native command, catching stderr, stdout @@ -98,18 +89,6 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): return (rc, out) - -def exec_native_cmd_quiet(cmd_and_args, native_sysroot): - -Execute native command, catching nothing in the output - -Need to execute as_shell if the command uses wildcards - -Always need to execute native commands as_shell - -return exec_native_cmd(cmd_and_args, native_sysroot, 0) - - # kickstart doesn't support variable substution in commands, so this # is our current simplistic scheme for supporting that -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 6/9] wic: Set type GUID and UUID for partition
Set type GUID and UUID for partition using sgdisk utility. Type GUID can be specified for partition in .wks with --part-type option. UUID is generated when --use-uuid option is specified for partition. [YOCTO #7716] Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index a6e2e4f..1eb1f01 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -294,6 +294,21 @@ class Image(object): self.__create_partition(d['disk'].device, p['type'], parted_fs_type, p['start'], p['size']) +if p['part_type']: +msger.debug(partition %d: set type UID to %s % \ +(p['num'], p['part_type'])) +exec_native_cmd(sgdisk --typecode=%d:%s %s % \ + (p['num'], p['part_type'], + d['disk'].device), self.native_sysroot) + +if p['uuid']: +msger.debug(partition %d: set UUID to %s % \ +(p['num'], p['uuid'])) +exec_native_cmd(sgdisk --partition-guid=%d:%s %s % \ + (p['num'], p['uuid'], + d['disk'].device), +self.native_sysroot) + if p['boot']: flag_name = legacy_boot if d['ptable_format'] == 'gpt' else boot msger.debug(Set '%s' flag for partition '%s' on disk '%s' % \ -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 5/9] wic: add parameter 'uuid' to Image.add_partition method
With this parameter it's possible to pass generated UUID into Image class to set it for partition when it's created. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 36150c9..2290ecd 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -272,7 +272,8 @@ class DirectImageCreator(BaseImageCreator): boot=p.active, align=p.align, no_table=p.no_table, - part_type=p.part_type) + part_type=p.part_type, + uuid=p.uuid) self._restore_fstab(fstab) diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 902548f..a6e2e4f 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -86,7 +86,7 @@ class Image(object): def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None, label=None, fsopts=None, boot=False, align=None, no_table=False, - part_type=None): + part_type=None, uuid=None): Add the next partition. Prtitions have to be added in the first-to-last order. @@ -110,7 +110,8 @@ class Image(object): 'boot': boot, # Bootable flag 'align': align, # Partition alignment 'no_table' : no_table, # Partition does not appear in partition table -'part_type' : part_type} # Partition type +'part_type' : part_type, # Partition type +'uuid': uuid} # Partition UUID self.__add_partition(part) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 4/9] wic: refactored getting root device name
Replaced DirectImageCreator._get_boot_config private method with a 'rootdev' property. Simplified the code and API. Used 'uuid' property instead of incorrectly used 'part_type'. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 83f9688..36150c9 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -346,27 +346,23 @@ class DirectImageCreator(BaseImageCreator): msger.info(msg) -def _get_boot_config(self): +@property +def rootdev(self): -Return the rootdev/root_part_uuid (if specified by ---part-type) +Get root device name to use as a 'root' parameter +in kernel command line. Assume partition order same as in wks -rootdev = None -root_part_uuid = None parts = self._get_parts() -for num, p in enumerate(parts, 1): -if p.mountpoint == /: -part = '' -if p.disk.startswith('mmcblk'): -part = 'p' - -pnum = self.__get_part_num(num, parts) -rootdev = /dev/%s%s%-d % (p.disk, part, pnum) -root_part_uuid = p.part_type - -return (rootdev, root_part_uuid) +for num, part in enumerate(parts, 1): +if part.mountpoint == /: +if part.uuid: +return PARTUUID=%s % part.uuid +else: +suffix = 'p' if part.disk.startswith('mmcblk') else '' +pnum = self.__get_part_num(num, parts) +return /dev/%s%s%-d % (part.disk, suffix, pnum) def _cleanup(self): if not self.__image is None: diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 400e3a2..39ce9f3 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -47,7 +47,6 @@ class BootimgEFIPlugin(SourcePlugin): else: splashline = -(rootdev, root_part_uuid) = cr._get_boot_config() options = cr.ks.handler.bootloader.appendLine grubefi_conf = @@ -62,7 +61,7 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) @@ -87,7 +86,6 @@ class BootimgEFIPlugin(SourcePlugin): 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) @@ -107,7 +105,7 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index 1c3c6e6..dd49480 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py @@ -83,7 +83,6 @@ class BootimgPcbiosPlugin(SourcePlugin): else: splashline = -(rootdev, root_part_uuid) = cr._get_boot_config() options = cr.ks.handler.bootloader.appendLine syslinux_conf = @@ -105,7 +104,7 @@ class BootimgPcbiosPlugin(SourcePlugin): syslinux_conf += KERNEL + kernel + \n if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py index 50b2213..90dac05 100644 --- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py +++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py @@ -82,7 +82,6 @@ class RootfsPlugin(SourcePlugin): Called before do_prepare_partition() -rootdev = image_creator._get_boot_config()[0] options = image_creator.ks.handler.bootloader.appendLine syslinux_conf = @@ -102,7 +101,7 @@ class RootfsPlugin(SourcePlugin): syslinux_conf += KERNEL /boot/bzImage\n if image_creator.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = image_creator.rootdev else: raise ImageError(Unsupported partition table format found) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org
[OE-core] [wic][PATCH 9/9] wic: Add help for --part-type and --use-uuid options
Added help for two wks partition options specific to GUID partition table and globally unique identificators (GUID). Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py index e365a07..14f0ff1 100644 --- a/scripts/lib/image/help.py +++ b/scripts/lib/image/help.py @@ -757,6 +757,15 @@ DESCRIPTION equal to 1. The default value is 1.3. + --part-type: This option is specific to wic. It specifies partition + type GUID for GPT partitions. + List of partition type GUIDS can be found here: + http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs + + --use-uuid: This option is specific to wic. It makes wic to generate + random globally unique identifier (GUID) for the partition + and use it in bootloader configuration to specify root partition. + * bootloader This command allows the user to specify various bootloader -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 4/9] wic: Refactored getting root device name
Replaced DirectImageCreator._get_boot_config private method with a 'rootdev' property. Simplified the code and API. Used 'uuid' property instead of incorrectly used 'part_type'. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 83f9688..36150c9 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -346,27 +346,23 @@ class DirectImageCreator(BaseImageCreator): msger.info(msg) -def _get_boot_config(self): +@property +def rootdev(self): -Return the rootdev/root_part_uuid (if specified by ---part-type) +Get root device name to use as a 'root' parameter +in kernel command line. Assume partition order same as in wks -rootdev = None -root_part_uuid = None parts = self._get_parts() -for num, p in enumerate(parts, 1): -if p.mountpoint == /: -part = '' -if p.disk.startswith('mmcblk'): -part = 'p' - -pnum = self.__get_part_num(num, parts) -rootdev = /dev/%s%s%-d % (p.disk, part, pnum) -root_part_uuid = p.part_type - -return (rootdev, root_part_uuid) +for num, part in enumerate(parts, 1): +if part.mountpoint == /: +if part.uuid: +return PARTUUID=%s % part.uuid +else: +suffix = 'p' if part.disk.startswith('mmcblk') else '' +pnum = self.__get_part_num(num, parts) +return /dev/%s%s%-d % (part.disk, suffix, pnum) def _cleanup(self): if not self.__image is None: diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 400e3a2..39ce9f3 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -47,7 +47,6 @@ class BootimgEFIPlugin(SourcePlugin): else: splashline = -(rootdev, root_part_uuid) = cr._get_boot_config() options = cr.ks.handler.bootloader.appendLine grubefi_conf = @@ -62,7 +61,7 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) @@ -87,7 +86,6 @@ class BootimgEFIPlugin(SourcePlugin): 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) @@ -107,7 +105,7 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index 1c3c6e6..dd49480 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py @@ -83,7 +83,6 @@ class BootimgPcbiosPlugin(SourcePlugin): else: splashline = -(rootdev, root_part_uuid) = cr._get_boot_config() options = cr.ks.handler.bootloader.appendLine syslinux_conf = @@ -105,7 +104,7 @@ class BootimgPcbiosPlugin(SourcePlugin): syslinux_conf += KERNEL + kernel + \n if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py index 50b2213..90dac05 100644 --- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py +++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py @@ -82,7 +82,6 @@ class RootfsPlugin(SourcePlugin): Called before do_prepare_partition() -rootdev = image_creator._get_boot_config()[0] options = image_creator.ks.handler.bootloader.appendLine syslinux_conf = @@ -102,7 +101,7 @@ class RootfsPlugin(SourcePlugin): syslinux_conf += KERNEL /boot/bzImage\n if image_creator.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = image_creator.rootdev else: raise ImageError(Unsupported partition table format found) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org
[OE-core] [wic][PATCH 5/9] wic: Add parameter 'uuid' to Image.add_partition method
With this parameter it's possible to pass generated UUID into Image class to set it for partition when it's created. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 36150c9..2290ecd 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -272,7 +272,8 @@ class DirectImageCreator(BaseImageCreator): boot=p.active, align=p.align, no_table=p.no_table, - part_type=p.part_type) + part_type=p.part_type, + uuid=p.uuid) self._restore_fstab(fstab) diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 902548f..a6e2e4f 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -86,7 +86,7 @@ class Image(object): def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None, label=None, fsopts=None, boot=False, align=None, no_table=False, - part_type=None): + part_type=None, uuid=None): Add the next partition. Prtitions have to be added in the first-to-last order. @@ -110,7 +110,8 @@ class Image(object): 'boot': boot, # Bootable flag 'align': align, # Partition alignment 'no_table' : no_table, # Partition does not appear in partition table -'part_type' : part_type} # Partition type +'part_type' : part_type, # Partition type +'uuid': uuid} # Partition UUID self.__add_partition(part) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] libxml2: Security Advisory - libxml2 - CVE-2015-1819
From: Yue Tao yue@windriver.com for CVE-2015-1819 Enforce the reader to run in constant memory Signed-off-by: Yue Tao yue@windriver.com --- meta/recipes-core/libxml/libxml2.inc | 1 + ...19-Enforce-the-reader-to-run-in-constant-.patch | 178 + 2 files changed, 179 insertions(+) create mode 100644 meta/recipes-core/libxml/libxml2/0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc index d337bec..1c3c37d 100644 --- a/meta/recipes-core/libxml/libxml2.inc +++ b/meta/recipes-core/libxml/libxml2.inc @@ -20,6 +20,7 @@ SRC_URI = ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \ file://python-sitepackages-dir.patch \ file://libxml-m4-use-pkgconfig.patch \ file://configure.ac-fix-cross-compiling-warning.patch \ + file://0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch \ BINCONFIG = ${bindir}/xml2-config diff --git a/meta/recipes-core/libxml/libxml2/0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch b/meta/recipes-core/libxml/libxml2/0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch new file mode 100644 index 000..8b45dcb --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch @@ -0,0 +1,178 @@ +From 213f1fe0d76d30eaed6e5853057defc43e6df2c9 Mon Sep 17 00:00:00 2001 +From: Daniel Veillard veill...@redhat.com +Date: Tue, 14 Apr 2015 17:41:48 +0800 +Subject: [PATCH] CVE-2015-1819 Enforce the reader to run in constant memory + +One of the operation on the reader could resolve entities +leading to the classic expansion issue. Make sure the +buffer used for xmlreader operation is bounded. +Introduce a new allocation type for the buffers for this effect. + +Upstream-Status: Backport +--- + buf.c | 43 ++- + include/libxml/tree.h |3 ++- + xmlreader.c | 20 +++- + 3 files changed, 63 insertions(+), 3 deletions(-) + +diff --git a/buf.c b/buf.c +index 6efc7b6..07922ff 100644 +--- a/buf.c b/buf.c +@@ -27,6 +27,7 @@ + #include libxml/tree.h + #include libxml/globals.h + #include libxml/tree.h ++#include libxml/parserInternals.h /* for XML_MAX_TEXT_LENGTH */ + #include buf.h + + #define WITH_BUFFER_COMPAT +@@ -299,7 +300,8 @@ xmlBufSetAllocationScheme(xmlBufPtr buf, + if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) || + (scheme == XML_BUFFER_ALLOC_EXACT) || + (scheme == XML_BUFFER_ALLOC_HYBRID) || +-(scheme == XML_BUFFER_ALLOC_IMMUTABLE)) { ++(scheme == XML_BUFFER_ALLOC_IMMUTABLE) || ++ (scheme == XML_BUFFER_ALLOC_BOUNDED)) { + buf-alloc = scheme; + if (buf-buffer) + buf-buffer-alloc = scheme; +@@ -458,6 +460,18 @@ xmlBufGrowInternal(xmlBufPtr buf, size_t len) { + size = buf-use + len + 100; + #endif + ++if (buf-alloc == XML_BUFFER_ALLOC_BOUNDED) { ++/* ++ * Used to provide parsing limits ++ */ ++if ((buf-use + len = XML_MAX_TEXT_LENGTH) || ++ (buf-size = XML_MAX_TEXT_LENGTH)) { ++ xmlBufMemoryError(buf, buffer error: text too long\n); ++ return(0); ++ } ++ if (size = XML_MAX_TEXT_LENGTH) ++ size = XML_MAX_TEXT_LENGTH; ++} + if ((buf-alloc == XML_BUFFER_ALLOC_IO) (buf-contentIO != NULL)) { + size_t start_buf = buf-content - buf-contentIO; + +@@ -739,6 +753,15 @@ xmlBufResize(xmlBufPtr buf, size_t size) + CHECK_COMPAT(buf) + + if (buf-alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0); ++if (buf-alloc == XML_BUFFER_ALLOC_BOUNDED) { ++/* ++ * Used to provide parsing limits ++ */ ++if (size = XML_MAX_TEXT_LENGTH) { ++ xmlBufMemoryError(buf, buffer error: text too long\n); ++ return(0); ++ } ++} + + /* Don't resize if we don't have to */ + if (size buf-size) +@@ -867,6 +890,15 @@ xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len) { + + needSize = buf-use + len + 2; + if (needSize buf-size){ ++ if (buf-alloc == XML_BUFFER_ALLOC_BOUNDED) { ++ /* ++ * Used to provide parsing limits ++ */ ++ if (needSize = XML_MAX_TEXT_LENGTH) { ++ xmlBufMemoryError(buf, buffer error: text too long\n); ++ return(-1); ++ } ++ } + if (!xmlBufResize(buf, needSize)){ + xmlBufMemoryError(buf, growing buffer); + return XML_ERR_NO_MEMORY; +@@ -938,6 +970,15 @@ xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len) { + } + needSize = buf-use + len + 2; + if (needSize buf-size){ ++ if (buf-alloc == XML_BUFFER_ALLOC_BOUNDED) { ++ /* ++ * Used to provide parsing limits ++ */ ++ if (needSize = XML_MAX_TEXT_LENGTH) { ++
[OE-core] [wic][PATCH 1/9] wic: Add --use-uuid partition option
Added --use-uuid option to the configuration of wks parser. Processing of this option will be implemented in the following commits. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 5d033bb..7d04738 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -51,6 +51,7 @@ class Wic_PartData(Mic_PartData): self.no_table = kwargs.get(no-table, False) self.extra_space = kwargs.get(extra-space, 10M) self.overhead_factor = kwargs.get(overhead-factor, 1.3) +self.use_uuid = kwargs.get(use-uuid, False) self.source_file = self.size = 0 @@ -65,6 +66,8 @@ class Wic_PartData(Mic_PartData): retval += --rootfs-dir=%s % self.rootfs if self.no_table: retval += --no-table +if self.use_uuid: +retval += --use-uuid retval += --extra-space=%d % self.extra_space retval += --overhead-factor=%f % self.overhead_factor @@ -561,4 +564,7 @@ class Wic_Partition(Mic_Partition): op.add_option(--overhead-factor, dest=overhead_factor, action=callback, callback=overhead_cb, type=float, nargs=1, default=1.3) +op.add_option(--use-uuid, dest=use_uuid, action=store_true, + default=False) + return op -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 0/9] UUID support
Hi, Please, review implementation of partition UUID support in wic. It contains two options: --part-type and --use-uuid --part-type allows to set partition type UUID. It was incorrectly implemted in wic and now it's hopefully fixed. --use-uuid makes wic to generate random globally unique identifier (GUID) for the partition and configure bootloader to boot from it using root=PARTUUID=GUID in kernel command line. This technique makes boot process more deterministic and reliable for at least two reasons: - It allows to boot the same image from different devices - It fixes possible boot issues caused by using device names in kernel commandline as GUID doesn't change unlike device names. Ed Bartosh (9): wic: Add --use-uuid partition option wic: Generate random uuid for partition wic: Fix format string wic: Refactored getting root device name wic: Add parameter 'uuid' to Image.add_partition method wic: Set type GUID and UUID for partition wic: Use partition UUID in directdisk-gpt wic: oe-selftest: Configure testing of gpt/UUID image wic: Add help for --part-type and --use-uuid options meta/lib/oeqa/selftest/wic.py | 4 +-- scripts/lib/image/canned-wks/directdisk-gpt.wks| 2 +- scripts/lib/image/help.py | 9 +++ scripts/lib/wic/imager/direct.py | 31 ++ .../lib/wic/kickstart/custom_commands/partition.py | 21 ++- scripts/lib/wic/plugins/source/bootimg-efi.py | 6 ++--- scripts/lib/wic/plugins/source/bootimg-pcbios.py | 3 +-- .../lib/wic/plugins/source/rootfs_pcbios_ext.py| 3 +-- scripts/lib/wic/utils/partitionedfs.py | 20 -- 9 files changed, 68 insertions(+), 31 deletions(-) -- Ed -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] alsa-tools: add dependency glib-2.0
On 05/06/15 02:50, Kang Kai wrote: On 2015年06月04日 17:23, Jack Mitchell wrote: On 04/06/15 06:57, Kai Kang wrote: Add dependency glib-2.0 for alsa-tools. It is required by new added sub-component hdajacksensetest. Signed-off-by: Kai Kang kai.k...@windriver.com --- meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb b/meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb index 9133012..b5b9cc4 100644 --- a/meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb +++ b/meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb @@ -3,7 +3,7 @@ HOMEPAGE = http://www.alsa-project.org; BUGTRACKER = https://bugtrack.alsa-project.org/alsa-bug/login_page.php; SECTION = console/utils LICENSE = GPLv2 LGPLv2+ -DEPENDS = alsa-lib ncurses +DEPENDS = alsa-lib ncurses glib-2.0 LIC_FILES_CHKSUM = file://hdsploader/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ file://ld10k1/COPYING.LIB;md5=7fbc338309ac38fefcd64b04bb903e34 It would be nice to put this behind a hdajacksensetest packageconfig if possible. The hdajacksensetest is just a sub-directory/component not a feature, and it can't be built without library glib. If make it as a package config, we have to find a way to remove hdajacksensetes. I suppose it is not proper to add it as a packageconfig. BTW, the dependency on glib-2.0 for alsa-tools is passed by depending on gtk+3 if 'x11' in distro feauture. If without 'x11', not such dependency, then build hdajacksensetest fails. So add 'glib-2.0' to DEPENDS. Thanks, Ok, it's just quite a heavy dependancy for a package which is feasible to be installed on very small systems; as you have proved by glib-2.0 not beiing available in a non-x11 build. In this case I guess the way round it would be to split out the alsa-tools packages, but that is also a lot of work. The patch is fine and I don't use alsa-tools so I have no strong feelings; I just like to keep and eye on and question bloat. Cheers, -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 2/9] wic: Generate random uuid for partition
'uuid' attribute of partition object is set to generated uuid when --use-uuid option is used for partition in .wks file. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 7d04738..f3c5545 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -26,6 +26,7 @@ import os import tempfile +import uuid from pykickstart.commands.partition import * from wic.utils.oe.misc import * @@ -51,6 +52,8 @@ class Wic_PartData(Mic_PartData): self.no_table = kwargs.get(no-table, False) self.extra_space = kwargs.get(extra-space, 10M) self.overhead_factor = kwargs.get(overhead-factor, 1.3) +self._use_uuid = False +self.uuid = None self.use_uuid = kwargs.get(use-uuid, False) self.source_file = self.size = 0 @@ -73,6 +76,16 @@ class Wic_PartData(Mic_PartData): return retval +@property +def use_uuid(self): +return self._use_uuid + +@use_uuid.setter +def use_uuid(self, value): +self._use_uuid = value +if value and not self.uuid: +self.uuid = str(uuid.uuid4()) + def get_rootfs(self): Acessor for rootfs dir -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 3/9] wic: Fix format string
wic crashes with TypeError: %d format: a number is required, not str Due to incorrect format used for Wic_PartData.extra_size attribute. Using %s instead of %d should fix the crash. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index f3c5545..40c2772 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -71,7 +71,7 @@ class Wic_PartData(Mic_PartData): retval += --no-table if self.use_uuid: retval += --use-uuid -retval += --extra-space=%d % self.extra_space +retval += --extra-space=%s % self.extra_space retval += --overhead-factor=%f % self.overhead_factor return retval -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 2/9] wic: generate random uuid for partition
'uuid' attribute of partition object is set to generated uuid when --use-uuid option is used for partition in .wks file. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 7d04738..f3c5545 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -26,6 +26,7 @@ import os import tempfile +import uuid from pykickstart.commands.partition import * from wic.utils.oe.misc import * @@ -51,6 +52,8 @@ class Wic_PartData(Mic_PartData): self.no_table = kwargs.get(no-table, False) self.extra_space = kwargs.get(extra-space, 10M) self.overhead_factor = kwargs.get(overhead-factor, 1.3) +self._use_uuid = False +self.uuid = None self.use_uuid = kwargs.get(use-uuid, False) self.source_file = self.size = 0 @@ -73,6 +76,16 @@ class Wic_PartData(Mic_PartData): return retval +@property +def use_uuid(self): +return self._use_uuid + +@use_uuid.setter +def use_uuid(self, value): +self._use_uuid = value +if value and not self.uuid: +self.uuid = str(uuid.uuid4()) + def get_rootfs(self): Acessor for rootfs dir -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 3/9] wic: fixed format string
wic crashes with TypeError: %d format: a number is required, not str Due to incorrect format used for Wic_PartData.extra_size attribute. Using %s instead of %d should fix the crash. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index f3c5545..40c2772 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -71,7 +71,7 @@ class Wic_PartData(Mic_PartData): retval += --no-table if self.use_uuid: retval += --use-uuid -retval += --extra-space=%d % self.extra_space +retval += --extra-space=%s % self.extra_space retval += --overhead-factor=%f % self.overhead_factor return retval -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 4/9] wic: Refactored getting root device name
Replaced DirectImageCreator._get_boot_config private method with a 'rootdev' property. Simplified the code and API. Used 'uuid' property instead of incorrectly used 'part_type'. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 83f9688..36150c9 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -346,27 +346,23 @@ class DirectImageCreator(BaseImageCreator): msger.info(msg) -def _get_boot_config(self): +@property +def rootdev(self): -Return the rootdev/root_part_uuid (if specified by ---part-type) +Get root device name to use as a 'root' parameter +in kernel command line. Assume partition order same as in wks -rootdev = None -root_part_uuid = None parts = self._get_parts() -for num, p in enumerate(parts, 1): -if p.mountpoint == /: -part = '' -if p.disk.startswith('mmcblk'): -part = 'p' - -pnum = self.__get_part_num(num, parts) -rootdev = /dev/%s%s%-d % (p.disk, part, pnum) -root_part_uuid = p.part_type - -return (rootdev, root_part_uuid) +for num, part in enumerate(parts, 1): +if part.mountpoint == /: +if part.uuid: +return PARTUUID=%s % part.uuid +else: +suffix = 'p' if part.disk.startswith('mmcblk') else '' +pnum = self.__get_part_num(num, parts) +return /dev/%s%s%-d % (part.disk, suffix, pnum) def _cleanup(self): if not self.__image is None: diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 400e3a2..39ce9f3 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -47,7 +47,6 @@ class BootimgEFIPlugin(SourcePlugin): else: splashline = -(rootdev, root_part_uuid) = cr._get_boot_config() options = cr.ks.handler.bootloader.appendLine grubefi_conf = @@ -62,7 +61,7 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) @@ -87,7 +86,6 @@ class BootimgEFIPlugin(SourcePlugin): 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) @@ -107,7 +105,7 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index 1c3c6e6..dd49480 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py @@ -83,7 +83,6 @@ class BootimgPcbiosPlugin(SourcePlugin): else: splashline = -(rootdev, root_part_uuid) = cr._get_boot_config() options = cr.ks.handler.bootloader.appendLine syslinux_conf = @@ -105,7 +104,7 @@ class BootimgPcbiosPlugin(SourcePlugin): syslinux_conf += KERNEL + kernel + \n if cr.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = cr.rootdev else: raise ImageError(Unsupported partition table format found) diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py index 50b2213..90dac05 100644 --- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py +++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py @@ -82,7 +82,6 @@ class RootfsPlugin(SourcePlugin): Called before do_prepare_partition() -rootdev = image_creator._get_boot_config()[0] options = image_creator.ks.handler.bootloader.appendLine syslinux_conf = @@ -102,7 +101,7 @@ class RootfsPlugin(SourcePlugin): syslinux_conf += KERNEL /boot/bzImage\n if image_creator.ptable_format in ('msdos', 'gpt'): -rootstr = rootdev +rootstr = image_creator.rootdev else: raise ImageError(Unsupported partition table format found) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org
[OE-core] [wic][PATCH v2 3/9] wic: Fix format string
wic crashes with TypeError: %d format: a number is required, not str Due to incorrect format used for Wic_PartData.extra_size attribute. Using %s instead of %d should fix the crash. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index f3c5545..40c2772 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -71,7 +71,7 @@ class Wic_PartData(Mic_PartData): retval += --no-table if self.use_uuid: retval += --use-uuid -retval += --extra-space=%d % self.extra_space +retval += --extra-space=%s % self.extra_space retval += --overhead-factor=%f % self.overhead_factor return retval -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 0/9] UUID support
Hi, Please, review implementation of partition UUID support in wic. It contains two options: --part-type and --use-uuid --part-type allows to set partition type UUID. It was incorrectly implemted in wic and now it's hopefully fixed. --use-uuid makes wic to generate random globally unique identifier (GUID) for the partition and configure bootloader to boot from it using root=PARTUUID=GUID in kernel command line. This technique makes boot process more deterministic and reliable for at least two reasons: - It allows to boot the same image from different devices - It fixes possible boot issues caused by using device names in kernel commandline as GUID doesn't change unlike device names. Ed Bartosh (9): wic: Add --use-uuid partition option wic: Generate random uuid for partition wic: Fix format string wic: Refactored getting root device name wic: Add parameter 'uuid' to Image.add_partition method wic: Set type GUID and UUID for partition wic: Use partition UUID in directdisk-gpt wic: oe-selftest: Configure testing of gpt/UUID image wic: Add help for --part-type and --use-uuid options meta/lib/oeqa/selftest/wic.py | 4 +-- scripts/lib/image/canned-wks/directdisk-gpt.wks| 2 +- scripts/lib/image/help.py | 9 +++ scripts/lib/wic/imager/direct.py | 31 ++ .../lib/wic/kickstart/custom_commands/partition.py | 21 ++- scripts/lib/wic/plugins/source/bootimg-efi.py | 6 ++--- scripts/lib/wic/plugins/source/bootimg-pcbios.py | 3 +-- .../lib/wic/plugins/source/rootfs_pcbios_ext.py| 3 +-- scripts/lib/wic/utils/partitionedfs.py | 20 -- 9 files changed, 68 insertions(+), 31 deletions(-) -- Ed -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 7/9] wic: Use partition UUID in directdisk-gpt
Used --use-uuid option for root partition in directdisk-gpt.wks This is useful to have example of image with UUID support. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/image/canned-wks/directdisk-gpt.wks b/scripts/lib/image/canned-wks/directdisk-gpt.wks index 76fda1f..2355259 100644 --- a/scripts/lib/image/canned-wks/directdisk-gpt.wks +++ b/scripts/lib/image/canned-wks/directdisk-gpt.wks @@ -4,7 +4,7 @@ part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 -part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024 +part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024 --use-uuid bootloader --ptable gpt --timeout=0 --append=rootwait rootfstype=ext3 video=vesafb vga=0x318 console=tty0 -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 1/9] wic: Add --use-uuid partition option
Added --use-uuid option to the configuration of wks parser. Processing of this option will be implemented in the following commits. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 5d033bb..7d04738 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -51,6 +51,7 @@ class Wic_PartData(Mic_PartData): self.no_table = kwargs.get(no-table, False) self.extra_space = kwargs.get(extra-space, 10M) self.overhead_factor = kwargs.get(overhead-factor, 1.3) +self.use_uuid = kwargs.get(use-uuid, False) self.source_file = self.size = 0 @@ -65,6 +66,8 @@ class Wic_PartData(Mic_PartData): retval += --rootfs-dir=%s % self.rootfs if self.no_table: retval += --no-table +if self.use_uuid: +retval += --use-uuid retval += --extra-space=%d % self.extra_space retval += --overhead-factor=%f % self.overhead_factor @@ -561,4 +564,7 @@ class Wic_Partition(Mic_Partition): op.add_option(--overhead-factor, dest=overhead_factor, action=callback, callback=overhead_cb, type=float, nargs=1, default=1.3) +op.add_option(--use-uuid, dest=use_uuid, action=store_true, + default=False) + return op -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 8/9] wic: testing: configured testing of gpt/UUID image
Added runtime dependency to gptfdisk-native to wic test suite to be able to test modified directdisk-gpt with UUID support. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py index e97dd1d..358f09e 100644 --- a/meta/lib/oeqa/selftest/wic.py +++ b/meta/lib/oeqa/selftest/wic.py @@ -39,7 +39,7 @@ class Wic(oeSelfTest): @classmethod def setUpClass(cls): Build wic runtime dependencies and images used in the tests. -bitbake('syslinux syslinux-native parted-native ' +bitbake('syslinux syslinux-native parted-native gptfdisk-native ' 'dosfstools-native mtools-native core-image-minimal') def setUp(self): @@ -75,7 +75,7 @@ class Wic(oeSelfTest): self.assertEqual(1, len(glob(self.resultdir + directdisk-*.direct))) def test06_gpt_image(self): -Test creation of core-image-minimal with gpt table +Test creation of core-image-minimal with gpt table and UUID boot self.assertEqual(0, runCmd(wic create directdisk-gpt --image-name core-image-minimal).status) self.assertEqual(1, len(glob(self.resultdir + directdisk-*.direct))) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 8/9] wic: oe-selftest: Configure testing of gpt/UUID image
Added runtime dependency to gptfdisk-native to wic test suite to be able to test modified directdisk-gpt with UUID support. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py index e97dd1d..358f09e 100644 --- a/meta/lib/oeqa/selftest/wic.py +++ b/meta/lib/oeqa/selftest/wic.py @@ -39,7 +39,7 @@ class Wic(oeSelfTest): @classmethod def setUpClass(cls): Build wic runtime dependencies and images used in the tests. -bitbake('syslinux syslinux-native parted-native ' +bitbake('syslinux syslinux-native parted-native gptfdisk-native ' 'dosfstools-native mtools-native core-image-minimal') def setUp(self): @@ -75,7 +75,7 @@ class Wic(oeSelfTest): self.assertEqual(1, len(glob(self.resultdir + directdisk-*.direct))) def test06_gpt_image(self): -Test creation of core-image-minimal with gpt table +Test creation of core-image-minimal with gpt table and UUID boot self.assertEqual(0, runCmd(wic create directdisk-gpt --image-name core-image-minimal).status) self.assertEqual(1, len(glob(self.resultdir + directdisk-*.direct))) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH 6/9] wic: set type GUID and UUID for partition
Set type GUID and UUID for partition using sgdisk utility. Type GUID can be specified for partition in .wks with --part-type option. UUID is generated when --use-uuid option is specified for partition. [YOCTO #7716] Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index a6e2e4f..1eb1f01 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -294,6 +294,21 @@ class Image(object): self.__create_partition(d['disk'].device, p['type'], parted_fs_type, p['start'], p['size']) +if p['part_type']: +msger.debug(partition %d: set type UID to %s % \ +(p['num'], p['part_type'])) +exec_native_cmd(sgdisk --typecode=%d:%s %s % \ + (p['num'], p['part_type'], + d['disk'].device), self.native_sysroot) + +if p['uuid']: +msger.debug(partition %d: set UUID to %s % \ +(p['num'], p['uuid'])) +exec_native_cmd(sgdisk --partition-guid=%d:%s %s % \ + (p['num'], p['uuid'], + d['disk'].device), +self.native_sysroot) + if p['boot']: flag_name = legacy_boot if d['ptable_format'] == 'gpt' else boot msger.debug(Set '%s' flag for partition '%s' on disk '%s' % \ -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 2/9] wic: Generate random uuid for partition
'uuid' attribute of partition object is set to generated uuid when --use-uuid option is used for partition in .wks file. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 7d04738..f3c5545 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py @@ -26,6 +26,7 @@ import os import tempfile +import uuid from pykickstart.commands.partition import * from wic.utils.oe.misc import * @@ -51,6 +52,8 @@ class Wic_PartData(Mic_PartData): self.no_table = kwargs.get(no-table, False) self.extra_space = kwargs.get(extra-space, 10M) self.overhead_factor = kwargs.get(overhead-factor, 1.3) +self._use_uuid = False +self.uuid = None self.use_uuid = kwargs.get(use-uuid, False) self.source_file = self.size = 0 @@ -73,6 +76,16 @@ class Wic_PartData(Mic_PartData): return retval +@property +def use_uuid(self): +return self._use_uuid + +@use_uuid.setter +def use_uuid(self, value): +self._use_uuid = value +if value and not self.uuid: +self.uuid = str(uuid.uuid4()) + def get_rootfs(self): Acessor for rootfs dir -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 5/9] wic: Add parameter 'uuid' to Image.add_partition method
With this parameter it's possible to pass generated UUID into Image class to set it for partition when it's created. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 36150c9..2290ecd 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -272,7 +272,8 @@ class DirectImageCreator(BaseImageCreator): boot=p.active, align=p.align, no_table=p.no_table, - part_type=p.part_type) + part_type=p.part_type, + uuid=p.uuid) self._restore_fstab(fstab) diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 902548f..a6e2e4f 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -86,7 +86,7 @@ class Image(object): def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None, label=None, fsopts=None, boot=False, align=None, no_table=False, - part_type=None): + part_type=None, uuid=None): Add the next partition. Prtitions have to be added in the first-to-last order. @@ -110,7 +110,8 @@ class Image(object): 'boot': boot, # Bootable flag 'align': align, # Partition alignment 'no_table' : no_table, # Partition does not appear in partition table -'part_type' : part_type} # Partition type +'part_type' : part_type, # Partition type +'uuid': uuid} # Partition UUID self.__add_partition(part) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] alsa-tools: add dependency glib-2.0
On 5 June 2015 at 10:30, Jack Mitchell m...@communistcode.co.uk wrote: Ok, it's just quite a heavy dependancy for a package which is feasible to be installed on very small systems; as you have proved by glib-2.0 not beiing available in a non-x11 build. In this case I guess the way round it would be to split out the alsa-tools packages, but that is also a lot of work. The patch is fine and I don't use alsa-tools so I have no strong feelings; I just like to keep and eye on and question bloat. If someone feels strongly they can submit a patch to alsa-tools to make the glib dependency optional. Alternatively, split the alsa-tools packaging in some way. Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 7/9] wic: Use partition UUID in directdisk-gpt
Used --use-uuid option for root partition in directdisk-gpt.wks This is useful to have example of image with UUID support. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/image/canned-wks/directdisk-gpt.wks b/scripts/lib/image/canned-wks/directdisk-gpt.wks index 76fda1f..2355259 100644 --- a/scripts/lib/image/canned-wks/directdisk-gpt.wks +++ b/scripts/lib/image/canned-wks/directdisk-gpt.wks @@ -4,7 +4,7 @@ part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 -part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024 +part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024 --use-uuid bootloader --ptable gpt --timeout=0 --append=rootwait rootfstype=ext3 video=vesafb vga=0x318 console=tty0 -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 6/9] wic: Set type GUID and UUID for partition
Set type GUID and UUID for partition using sgdisk utility. Type GUID can be specified for partition in .wks with --part-type option. UUID is generated when --use-uuid option is specified for partition. [YOCTO #7716] Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index a6e2e4f..1eb1f01 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -294,6 +294,21 @@ class Image(object): self.__create_partition(d['disk'].device, p['type'], parted_fs_type, p['start'], p['size']) +if p['part_type']: +msger.debug(partition %d: set type UID to %s % \ +(p['num'], p['part_type'])) +exec_native_cmd(sgdisk --typecode=%d:%s %s % \ + (p['num'], p['part_type'], + d['disk'].device), self.native_sysroot) + +if p['uuid']: +msger.debug(partition %d: set UUID to %s % \ +(p['num'], p['uuid'])) +exec_native_cmd(sgdisk --partition-guid=%d:%s %s % \ + (p['num'], p['uuid'], + d['disk'].device), +self.native_sysroot) + if p['boot']: flag_name = legacy_boot if d['ptable_format'] == 'gpt' else boot msger.debug(Set '%s' flag for partition '%s' on disk '%s' % \ -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 8/9] wic: oe-selftest: Configure testing of gpt/UUID image
Added runtime dependency to gptfdisk-native to wic test suite to be able to test modified directdisk-gpt with UUID support. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py index e97dd1d..358f09e 100644 --- a/meta/lib/oeqa/selftest/wic.py +++ b/meta/lib/oeqa/selftest/wic.py @@ -39,7 +39,7 @@ class Wic(oeSelfTest): @classmethod def setUpClass(cls): Build wic runtime dependencies and images used in the tests. -bitbake('syslinux syslinux-native parted-native ' +bitbake('syslinux syslinux-native parted-native gptfdisk-native ' 'dosfstools-native mtools-native core-image-minimal') def setUp(self): @@ -75,7 +75,7 @@ class Wic(oeSelfTest): self.assertEqual(1, len(glob(self.resultdir + directdisk-*.direct))) def test06_gpt_image(self): -Test creation of core-image-minimal with gpt table +Test creation of core-image-minimal with gpt table and UUID boot self.assertEqual(0, runCmd(wic create directdisk-gpt --image-name core-image-minimal).status) self.assertEqual(1, len(glob(self.resultdir + directdisk-*.direct))) -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH v2 9/9] wic: Add help for --part-type and --use-uuid options
Added help for two wks partition options specific to GUID partition table and globally unique identificators (GUID). Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py index e365a07..14f0ff1 100644 --- a/scripts/lib/image/help.py +++ b/scripts/lib/image/help.py @@ -757,6 +757,15 @@ DESCRIPTION equal to 1. The default value is 1.3. + --part-type: This option is specific to wic. It specifies partition + type GUID for GPT partitions. + List of partition type GUIDS can be found here: + http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs + + --use-uuid: This option is specific to wic. It makes wic to generate + random globally unique identifier (GUID) for the partition + and use it in bootloader configuration to specify root partition. + * bootloader This command allows the user to specify various bootloader -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [wic][PATCH] wic: Move validation of --ptable option to wks parser
bootloader --ptable option has two valid choices: gpt and msdos Moved this check to wks parser by changing option type to 'choice'. Removed similar checks from 5 other places. Signed-off-by: Ed Bartosh ed.bart...@linux.intel.com --- scripts/lib/wic/kickstart/custom_commands/micboot.py | 3 ++- scripts/lib/wic/plugins/source/bootimg-efi.py| 15 ++- scripts/lib/wic/plugins/source/bootimg-pcbios.py | 8 ++-- scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py | 8 ++-- scripts/lib/wic/utils/partitionedfs.py | 4 5 files changed, 8 insertions(+), 30 deletions(-) diff --git a/scripts/lib/wic/kickstart/custom_commands/micboot.py b/scripts/lib/wic/kickstart/custom_commands/micboot.py index d162142..358b0ea 100644 --- a/scripts/lib/wic/kickstart/custom_commands/micboot.py +++ b/scripts/lib/wic/kickstart/custom_commands/micboot.py @@ -44,6 +44,7 @@ class Mic_Bootloader(F8_Bootloader): def _getParser(self): op = F8_Bootloader._getParser(self) op.add_option(--menus, dest=menus) -op.add_option(--ptable, dest=ptable, type=string) +op.add_option(--ptable, dest=ptable, choices=(msdos, gpt), + default=msdos) return op diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 39ce9f3..d3b8468 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -60,13 +60,8 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage -if cr.ptable_format in ('msdos', 'gpt'): -rootstr = cr.rootdev -else: -raise ImageError(Unsupported partition table format found) - grubefi_conf += linux %s root=%s rootwait %s\n \ -% (kernel, rootstr, options) +% (kernel, cr.rootdev, options) grubefi_conf += }\n msger.debug(Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg \ @@ -104,16 +99,10 @@ class BootimgEFIPlugin(SourcePlugin): kernel = /bzImage -if cr.ptable_format in ('msdos', 'gpt'): -rootstr = cr.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) +boot_conf += options LABEL=Boot root=%s %s\n % (cr.rootdev, options) msger.debug(Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf \ % cr_workdir) diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index dd49480..5caffbc 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py @@ -103,12 +103,8 @@ class BootimgPcbiosPlugin(SourcePlugin): kernel = /vmlinuz syslinux_conf += KERNEL + kernel + \n -if cr.ptable_format in ('msdos', 'gpt'): -rootstr = cr.rootdev -else: -raise ImageError(Unsupported partition table format found) - -syslinux_conf += APPEND label=boot root=%s %s\n % (rootstr, options) +syslinux_conf += APPEND label=boot root=%s %s\n % \ + (cr.rootdev, options) msger.debug(Writing syslinux config %s/hdd/boot/syslinux.cfg \ % cr_workdir) diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py index 90dac05..533eaa7 100644 --- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py +++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py @@ -100,12 +100,8 @@ class RootfsPlugin(SourcePlugin): syslinux_conf += LABEL linux\n syslinux_conf += KERNEL /boot/bzImage\n -if image_creator.ptable_format in ('msdos', 'gpt'): -rootstr = image_creator.rootdev -else: -raise ImageError(Unsupported partition table format found) - -syslinux_conf += APPEND label=boot root=%s %s\n % (rootstr, options) +syslinux_conf += APPEND label=boot root=%s %s\n % \ + (image_creator.rootdev, options) syslinux_cfg = os.path.join(image_creator.rootfs_dir['ROOTFS_DIR'], boot, syslinux.cfg) msger.debug(Writing syslinux config %s % syslinux_cfg) diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 1eb1f01..e093ec5 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -122,10 +122,6 @@ class Image(object): msger.debug(Assigning %s partitions to disks % ptable_format) -if ptable_format not in ('msdos', 'gpt'): -raise ImageError(Unknown partition table format '%s', supported \ -
Re: [OE-core] [PATCH] libxml2: Security Advisory - libxml2 - CVE-2015-1819
On 5 June 2015 at 09:23, wenzong@windriver.com wrote: +From 213f1fe0d76d30eaed6e5853057defc43e6df2c9 Mon Sep 17 00:00:00 2001 +From: Daniel Veillard veill...@redhat.com +Date: Tue, 14 Apr 2015 17:41:48 +0800 +Subject: [PATCH] CVE-2015-1819 Enforce the reader to run in constant memory + +One of the operation on the reader could resolve entities +leading to the classic expansion issue. Make sure the +buffer used for xmlreader operation is bounded. +Introduce a new allocation type for the buffers for this effect. + +Upstream-Status: Backport No signed-off-by. Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] RFC: update_data removal
On Wed, 2015-05-27 at 23:43 +0100, Richard Purdie wrote: I've been experimenting with this and I do have a branch which basically works: http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=rpurdie/noupdatedata5 Testing showed up some issues. I've addressed those and this code is now as a bitbake branch at: http://git.openembedded.org/bitbake/log/?h=noupdatedata This now builds ok on the autobuilder. There is a small issue with bitbake-selftest, I've a patch pending to address that (its a minor tweak). I've also sent a few patches to OE-Core to address issues these changes showed up which I believe are omissions in the metadata. Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] oeqa/selftest: added an auto-test to filter packages by license
Signed-off-by: Costin Constantin costin.c.constan...@intel.com --- meta/lib/oeqa/selftest/buildoptions.py | 36 ++ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index 8cacd1e..257122a 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py @@ -124,18 +124,30 @@ class BuildhistoryTests(BuildhistoryBase): self.run_buildhistory_operation(target, target_config=PR = \r0\, change_bh_location=False, expect_error=True, error_regex=error) class ArchiverTest(oeSelfTest): -@testcase(926) -def test_arch_work_dir_and_export_source(self): +@testcase(929) +def test_gpl_licenses(self): -Test for archiving the work directory and exporting the source files. +Test for checking that correct GPL licenses are used when explicitly required. self.add_command_to_tearDown('cleanup-workdir') -self.write_config(INHERIT += \archiver\\nARCHIVER_MODE[src] = \original\\nARCHIVER_MODE[srpm] = \1\) -self.res = bitbake(xcursor-transparent-theme).status -self.remove_config(INHERIT += \archiver\\nARCHIVER_MODE[src] = \original\\nARCHIVER_MODE[srpm] = \1\) -self.assertEqual(self.res, 0, \nCouldn't build xcursor-transparent-theme.\n) -self.pkgs_path = g.glob(str(self.builddir) + /tmp/deploy/sources/allarch*/xcurs*) -self.src_file_glob = str(self.pkgs_path[0]) + /xcursor*.src.rpm -self.tar_file_glob = str(self.pkgs_path[0]) + /xcursor*.tar.gz -if (g.glob(self.src_file_glob) and g.glob(self.tar_file_glob)): -self.assertTrue(True, Couldn't find .src.rpm and .tar.gz files under tmp/deploy/sources/allarch*/xcursor*) \ No newline at end of file +self.write_config(MACHINE = \qemux86\\nINHERIT += \archiver\\nARCHIVER_MODE[src] = \original\\nCOPYLEFT_LICENSE_INCLUDE = \GPLv2* GPLv3*\) +self.res = bitbake(core-image-minimal).status +self.remove_config(MACHINE = \qemux86\\nINHERIT += \archiver\\nARCHIVER_MODE[src] = \original\\nCOPYLEFT_LICENSE_INCLUDE = \GPLv2* GPLv3*\) +self.assertEqual(self.res, 0, core-image-minimal didn't build. Please check logs for further details) +self.built_pkgs_list = os.listdir(self.builddir + /tmp/deploy/sources/i586-poky-linux/)# the list containing built pkgs with ver. +self.pkg_name_split = [i.split(-) for i in self.built_pkgs_list] +self.pkgs = [] # this will contain the pkgs name as found in tmp/deploy/licenses +for i in self.pkg_name_split: + self.name = + for j in i: +if i.index(j) == 0: + self.name = j +elif j.isalpha() and i.index(j) != 0: + self.name = self.name + - + j +else: + self.pkgs.append(self.name) + break +self.license_dir = self.builddir + /tmp/deploy/licenses/ +for i in self.pkgs: + if os.path.isdir(self.license_dir + i): +self.assertTrue(g.glob(self.license_dir + i + /*GPL*), couldn't find GPL license in + self.license_dir + i) \ No newline at end of file -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] oeqa/selftest: added auto-test for directfb image on arm architecture
Signed-off-by: Costin Constantin costin.c.constan...@intel.com --- meta/lib/oeqa/selftest/buildoptions.py | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index e48bd04..620fd77 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py @@ -124,26 +124,15 @@ class BuildhistoryTests(BuildhistoryBase): self.run_buildhistory_operation(target, target_config=PR = \r0\, change_bh_location=False, expect_error=True, error_regex=error) class BuildImagesTest(oeSelfTest): -@testcase(283) -def test_btrfs(self): +@testcase(563) +def test_directfb(self): -This method is used to test the build of an image with btrfs file system. After building it, qemu is launched -and the test searches for the login keyword that it expects in order to consider an image as functional. -Please note that runquemu requires sudo access. In order to solve this please add to visudo (sudo visudo) -the following line: your_username ALL=NOPASSWD: ALL -The above setting was tested in Ubuntu +This method is used to test the build of directfb image for arm arch. +In essence we build a core-image-directfb and test the exitcode of bitbake that in case of success is 0. self.add_command_to_tearDown('cleanup-workdir') -self.write_config(MACHINE = \qemux86\\nIMAGE_FSTYPES = \btrfs\\nKERNEL_FEATURES_append = \ cfg/fs/btrfs \) -self.res = bitbake(core-image-sato).status -self.remove_config(MACHINE = \qemux86\\nIMAGE_FSTYPES = \btrfs\\nKERNEL_FEATURES_append = \ cfg/fs/btrfs \) -self.assertEqual(self.res, 0, \nbtrfs core-image-sato failed to build. Please check logs for further details.\n) -self.prc = p.spawn(runqemu qemux86 core-image-sato nographic) -try: - self.prc.expect(login, timeout=150) - self.prc.kill(9) - self.assertTrue(True, couldn't start qemu) -except: - self.prc.kill(9) - self.log.error(It is possible that runquemu didn't start correctly. Add this line your_username ALL=NOPASSWD: ALL\nto your visudo) - self.assertTrue(False, Couldn't start qemu) \ No newline at end of file +self.write_config(DISTRO_FEATURES_remove = \x11\\nDISTRO_FEATURES_append = \ directfb\\nMACHINE ??= \qemuarm\) +self.res = bitbake(core-image-directfb).status +self.remove_config(DISTRO_FEATURES_remove = \x11\\nDISTRO_FEATURES_append = \ directfb\\nMACHINE ??= \qemuarm\) +self.assertEqual(self.res, 0, \ndirectfb image couldn't be built\n) +self.assertEqual(self.res, 0, \ncore-image-directfb failed to build. Please check logs for further details.\n) \ No newline at end of file -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] oeqa/selftest: added auto-test for btrfs image type
Signed-off-by: Costin Constantin costin.c.constan...@intel.com --- meta/lib/oeqa/selftest/buildoptions.py | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index 926ffe9..e48bd04 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py @@ -2,6 +2,10 @@ import unittest import os import logging import re +from time import sleep +import pexpect as p +import glob as g + from oeqa.selftest.base import oeSelfTest from oeqa.selftest.buildhistory import BuildhistoryBase @@ -119,8 +123,27 @@ class BuildhistoryTests(BuildhistoryBase): self.run_buildhistory_operation(target, target_config=PR = \r1\, change_bh_location=True) self.run_buildhistory_operation(target, target_config=PR = \r0\, change_bh_location=False, expect_error=True, error_regex=error) - - - - - +class BuildImagesTest(oeSelfTest): +@testcase(283) +def test_btrfs(self): + +This method is used to test the build of an image with btrfs file system. After building it, qemu is launched +and the test searches for the login keyword that it expects in order to consider an image as functional. +Please note that runquemu requires sudo access. In order to solve this please add to visudo (sudo visudo) +the following line: your_username ALL=NOPASSWD: ALL +The above setting was tested in Ubuntu + +self.add_command_to_tearDown('cleanup-workdir') +self.write_config(MACHINE = \qemux86\\nIMAGE_FSTYPES = \btrfs\\nKERNEL_FEATURES_append = \ cfg/fs/btrfs \) +self.res = bitbake(core-image-sato).status +self.remove_config(MACHINE = \qemux86\\nIMAGE_FSTYPES = \btrfs\\nKERNEL_FEATURES_append = \ cfg/fs/btrfs \) +self.assertEqual(self.res, 0, \nbtrfs core-image-sato failed to build. Please check logs for further details.\n) +self.prc = p.spawn(runqemu qemux86 core-image-sato nographic) +try: + self.prc.expect(login, timeout=150) + self.prc.kill(9) + self.assertTrue(True, couldn't start qemu) +except: + self.prc.kill(9) + self.log.error(It is possible that runquemu didn't start correctly. Add this line your_username ALL=NOPASSWD: ALL\nto your visudo) + self.assertTrue(False, Couldn't start qemu) \ No newline at end of file -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] oeqa/selftest: added auto-test for archiving working dir and expeort source package
Signed-off-by: Costin Constantin costin.c.constan...@intel.com --- meta/lib/oeqa/selftest/buildoptions.py | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index 620fd77..8cacd1e 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py @@ -123,16 +123,19 @@ class BuildhistoryTests(BuildhistoryBase): self.run_buildhistory_operation(target, target_config=PR = \r1\, change_bh_location=True) self.run_buildhistory_operation(target, target_config=PR = \r0\, change_bh_location=False, expect_error=True, error_regex=error) -class BuildImagesTest(oeSelfTest): -@testcase(563) -def test_directfb(self): +class ArchiverTest(oeSelfTest): +@testcase(926) +def test_arch_work_dir_and_export_source(self): -This method is used to test the build of directfb image for arm arch. -In essence we build a core-image-directfb and test the exitcode of bitbake that in case of success is 0. +Test for archiving the work directory and exporting the source files. self.add_command_to_tearDown('cleanup-workdir') -self.write_config(DISTRO_FEATURES_remove = \x11\\nDISTRO_FEATURES_append = \ directfb\\nMACHINE ??= \qemuarm\) -self.res = bitbake(core-image-directfb).status -self.remove_config(DISTRO_FEATURES_remove = \x11\\nDISTRO_FEATURES_append = \ directfb\\nMACHINE ??= \qemuarm\) -self.assertEqual(self.res, 0, \ndirectfb image couldn't be built\n) -self.assertEqual(self.res, 0, \ncore-image-directfb failed to build. Please check logs for further details.\n) \ No newline at end of file +self.write_config(INHERIT += \archiver\\nARCHIVER_MODE[src] = \original\\nARCHIVER_MODE[srpm] = \1\) +self.res = bitbake(xcursor-transparent-theme).status +self.remove_config(INHERIT += \archiver\\nARCHIVER_MODE[src] = \original\\nARCHIVER_MODE[srpm] = \1\) +self.assertEqual(self.res, 0, \nCouldn't build xcursor-transparent-theme.\n) +self.pkgs_path = g.glob(str(self.builddir) + /tmp/deploy/sources/allarch*/xcurs*) +self.src_file_glob = str(self.pkgs_path[0]) + /xcursor*.src.rpm +self.tar_file_glob = str(self.pkgs_path[0]) + /xcursor*.tar.gz +if (g.glob(self.src_file_glob) and g.glob(self.tar_file_glob)): +self.assertTrue(True, Couldn't find .src.rpm and .tar.gz files under tmp/deploy/sources/allarch*/xcursor*) \ No newline at end of file -- 2.1.4 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] Yocto Project Status WW23
Current Dev Position: 1.9 Milestone 1 (M1) Next Deadline: M1 cut off of June 23rd SWAT team rotation: Anibal - Tracy https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team Key Status/Updates: Bitbake's update_data datastore changes now on a bitbake branch after wider testing Improvements to sstate from http performance Various package upgrades (including toolchain) Meta-Intel 3.0 has been released. Key YP 1.9 Dates: M2 Cut off July 28, 2015 1.9 Feature Freeze Date/M3 Cut off: Aug. 25, 2015 M4 Cut off: Sept. 29, 2015 1.9 M1 Release Target: Before July 10, 2015 1.9 M2 Release Target: Before Aug. 14, 2015 1.9 M3 Release Target: Before Sept. 11 2015 1.9 final Release Target: Before Oct. 30, 2015 Key Status Links for YP: https://wiki.yoctoproject.org/wiki/Yocto_Project_v1.9_Status https://wiki.yoctoproject.org/wiki/Yocto_1.9_Schedule https://wiki.yoctoproject.org/wiki/Yocto_1.9_Features Tracking Metrics: WDD 1757 (last week 1745) (https://wiki.yoctoproject.org/charts/combo.html) Performance Benchmarks stable compared to last week. [If anyone has suggestions for other information you'd like to see on this weekly status update, let us know!] Stephen K. Jolley Yocto Project Program Manager INTEL, MS JF1-255, 2111 N.E. 25th Avenue, Hillsboro, OR 97124 * Work Telephone: (503) 712-0534 *Cell:(208) 244-4460 * Email: stephen.k.jol...@intel.com -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH 1/1] systemd: Don't create /var/tmp, log directories
On Sat, Jan 17, 2015 at 6:37 PM, Otavio Salvador ota...@ossystems.com.br wrote: Adding Armin in Cc. On Fri, Jan 16, 2015 at 11:43 AM, Andrei Gherzan and...@gherzan.ro wrote: Hi guys, On Fri, Jan 16, 2015 at 2:38 PM, Andrei Gherzan and...@gherzan.ro wrote: /var/tmp and /var/log are symlinks created by base-files and point to their respective directories in /var/volatile. With this patch we avoid systemd-tmpfiles runtime errors like: systemd-tmpfiles[108]: chmod(/var/tmp) failed: No such file or directory Signed-off-by: Andrei Gherzan andrei.gher...@windriver.com Could you please cherry-pick this into the dizzy branch too? Thanks. Ping. -- Andrei Gherzan e: and...@gherzan.ro w: www.gherzan.ro -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [wic][PATCH 3/4] wic: replaced __run_parted with exec_native_cmd
On 05/06/2015 07:13, Ed Bartosh wrote: There is no need for yet another wrapper around exec_native_cmd. This doesn't appear to apply to master, can you rebase? (or does it depend on your other series?) Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] External modules fail to load due to unknown symbols
From da12fa5e6daca0c0b7bb15df030b1c79fbefa089 Mon Sep 17 00:00:00 2001 From: Amy Fong amy.f...@windriver.com Date: Mon, 1 Jun 2015 13:16:20 -0400 Subject: [PATCH] External modules fail to load due to unknown symbols When building external kernel modules, a failure can happen when the module has dependencies on other kernel modules. In such cases, the build looks at Module.symvers to do symbol lookups of the other kernel modules that it depends on. Module.symvers gets copied by do_shared_workdir after do_compile and Module.symvers gets updated during do_compile_kernelmodules. do_compile_kernelmodules is modified to explicitly copy Module.symvers to the shared workdir. Signed-off-by: Amy Fong amy.f...@windriver.com Signed-off-by: Bruce Ashfield bruce.ashfi...@windriver.com --- meta/classes/kernel.bbclass | 8 1 file changed, 8 insertions(+) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 4f22cde..4a177b1 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -215,6 +215,14 @@ do_compile_kernelmodules() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then oe_runmake ${PARALLEL_MAKE} modules CC=${KERNEL_CC} LD=${KERNEL_LD} ${KERNEL_EXTRA_ARGS} + + # Module.symvers gets updated during the + # building of the kernel modules. We need to + # update this in the shared workdir since some + # external kernel modules has a dependency on + # other kernel modules and will look at this + # file to do symbol lookups + cp Module.symvers ${STAGING_KERNEL_BUILDDIR} else bbnote no modules to compile fi -- 2.0.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH V5 3/3] systemd: split modules into packages
Ping. On Ter, 2015-05-19 at 10:18 -0300, Bottazzini, Bruno wrote: On Qui, 2015-05-14 at 00:41 +0200, Andreas Oberritter wrote: Hello Bruno, On 13.05.2015 23:51, Bruno Bottazzini wrote: + +# Aggregation of Split Packages + +PACKAGES =+ ${PN}-services-base +SUMMARY_${PN}-services-base = Base services aggregation +ALLOW_EMPTY_${PN}-services-base = 1 +RDEPENDS_${PN}-services-base = \ I think it would be better to use RRECOMMENDS, in order to support BAD_RECOMMENDATIONS per image. This would also remove the need to use bb.utils.contains, because unavailable recommended packages get ignored by the package managers. I don't think if we should use RRECOMENDS. There are some packages described in services-base that it is not on the default PACKAGECONFIG. With RRECOMENDS and with out bb.utils.contains, it will install all the packages that it is described on the recipe and this is not the behavior we are looking for. Besides that, I wonder whether ${PN}-services would be a better name, because the -base suffix suggests that it contained only the most important services. Sure, we can change it. Btw., sorry for commenting late again, but it's quite a big patch Regards, Andreas +${@bb.utils.contains('PACKAGECONFIG', 'ask-password', '${PN}-services-ask-password', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'backlight', '${PN}-services-backlight', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-services-binfmt', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'dbus', '${PN}-services-dbus', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'firstboot', '${PN}-services-firstboot', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'fuse', '${PN}-services-fuse', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'quota', '${PN}-services-quota', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'rfkill', '${PN}-services-rfkill', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '${PN}-services-timesyncd', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'update', '${PN}-services-update', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'vconsole', '${PN}-services-vconsole', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'filesystems', '${PN}-generators-filesystems', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'preset', '${PN}-preset', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'fsck', '${PN}-services-fsck', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'journal', '${PN}-services-journal', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'modules-load', '${PN}-services-modules-load', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'randomseed', '${PN}-services-randomseed', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'sleep', '${PN}-services-sleep', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'sysctl', '${PN}-services-sysctl', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'sysusers', '${PN}-services-sysusers', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'tmpfiles', '${PN}-services-tmpfiles', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'udev', '${PN}-services-udev', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'tools', '${PN}-tools', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'bash', '${PN}-bash', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'initramfs', '${PN}-initramfs', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'kernel-install', '${PN}-kernel-install', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'rpm-macros', '${PN}-rpm-macros', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'zsh', '${PN}-zsh', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'bootchart', '${PN}-services-bootchart', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'debug', '${PN}-services-debug', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'machined', '${PN}-services-machined', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'nspawn', '${PN}-services-nspawn', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'sysvcompat', '${PN}-services-sysvcompat', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'getty', '${PN}-generators-getty', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'getty', '${PN}-services-getty', '', d)} \ +${@bb.utils.contains('PACKAGECONFIG', 'ldconfig', '${PN}-services-ldconfig',
[OE-core] [PATCH] xserver-xorg: always enable DRI2 by default
DRI2 is more abstract than the original DRI and isn't tied to OpenGL or any other rendering system, and as such is being used by more than OpenGL support in xserver. In particular, the new modesettings driver uses DRI2 to accelerate drawing, so enable DRI2 by default. This was spotted because the nodistro DISTRO doesn't enable OpenGL, so xserver failed to build as dri2proto wasn't built. Signed-off-by: Ross Burton ross.bur...@intel.com --- meta/recipes-graphics/xorg-xserver/xserver-xorg.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc index 04289f8..02a170a 100644 --- a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc @@ -122,7 +122,7 @@ EXTRA_OECONF += --with-fop=no \ ac_cv_file__usr_share_sgml_X11_defs_ent=no \ -PACKAGECONFIG ??= udev ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'dri dri2 glx', '', d)} \ +PACKAGECONFIG ??= dri2 udev ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'dri glx', '', d)} \ ${@bb.utils.contains(DISTRO_FEATURES, wayland, xwayland, , d)} \ -- 2.1.4 -- ___ 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: update beaglebone, mpc8315e and edgerouter to 3.19
On 2015-06-05 11:07 AM, Burton, Ross wrote: On 5 June 2015 at 05:13, Bruce Ashfield bruce.ashfi...@windriver.com mailto:bruce.ashfi...@windriver.com wrote: Bumping the linux-yocto SRCREVs to integrate fixes for the h/w reference BSPs to the 3.19 kernel. edgerouter fails for me: It's Kevin you should be cc'ing .. I'm just the guy that merges these ones :) Kevin did fix this though .. I wonder if I did drop a patch, so I'll double check (maybe I was the right guy to cc' ') Bruce | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/fs/aufs/i_op.c: In function 'au_pin_hdir_set_owner': | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/fs/aufs/i_op.c:445:28: error: 'struct mutex' has no member named 'owner' | p-hdir-hi_inode-i_mutex.owner = task; | ^ | LD drivers/idle/built-in.o | CC fs/aufs/i_op_del.o | LD drivers/i2c/busses/built-in.o | CC drivers/base/module.o | LD drivers/i2c/muxes/built-in.o | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/scripts/Makefile.build:257: recipe for target 'fs/aufs/i_op.o' failed | make[4]: *** [fs/aufs/i_op.o] Error 1 Ross -- ___ 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: update beaglebone, mpc8315e and edgerouter to 3.19
On 2015-06-05 11:07 AM, Burton, Ross wrote: On 5 June 2015 at 05:13, Bruce Ashfield bruce.ashfi...@windriver.com mailto:bruce.ashfi...@windriver.com wrote: Bumping the linux-yocto SRCREVs to integrate fixes for the h/w reference BSPs to the 3.19 kernel. edgerouter fails for me: | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/fs/aufs/i_op.c: In function 'au_pin_hdir_set_owner': | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/fs/aufs/i_op.c:445:28: error: 'struct mutex' has no member named 'owner' | p-hdir-hi_inode-i_mutex.owner = task; | ^ | LD drivers/idle/built-in.o | CC fs/aufs/i_op_del.o | LD drivers/i2c/busses/built-in.o | CC drivers/base/module.o | LD drivers/i2c/muxes/built-in.o | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/scripts/Makefile.build:257: recipe for target 'fs/aufs/i_op.o' failed | make[4]: *** [fs/aufs/i_op.o] Error 1 Indeed, we have this fix: commit 6c21811060c03100a32d0acc493df5fb3743b7c8 Author: Kevin Hao kexin@windriver.com Date: Wed May 27 20:19:12 2015 +0800 fs: aufs: fix a build error for archs which doesn't support MUTEX_SPIN_ON_OWNER For struct mutex, the member owner only exist when either DEBUG_MUTEXES or MUTEX_SPIN_ON_OWNER is enabled. The SMP is a necessary condition, but not a sufficiency condition for MUTEX_SPIN_ON_OWNER. So we would get build error on arch such as mpis due to SMP is enabled and both DEBUG_MUTEXES and MUTEX_SPIN_ON_OWNER are disabled. Replace the SMP with MUTEX_SPIN_ON_OWNER to fix it. Signed-off-by: Kevin Hao kexin@windriver.com Signed-off-by: Bruce Ashfield bruce.ashfi...@windriver.com :100644 100644 f0edd021102b... 268a8a54ebfc... Mfs/aufs/i_op.c - And it is on the edgerouter branch. So either the fix isn't complete, or we are building a different config here, or the revs are wrong. ... and indeed, that isn't part of the patch Kevin sent, so you are building and old SRCREV. I'll send a follow up patch shortly. Bruce Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] oeqa/selftest: added auto-test for directfb image on arm architecture
On Fri, 2015-06-05 at 16:33 +0300, Costin Constantin wrote: Signed-off-by: Costin Constantin costin.c.constan...@intel.com --- meta/lib/oeqa/selftest/buildoptions.py | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index e48bd04..620fd77 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py @@ -124,26 +124,15 @@ class BuildhistoryTests(BuildhistoryBase): self.run_buildhistory_operation(target, target_config=PR = \r0\, change_bh_location=False, expect_error=True, error_regex=error) class BuildImagesTest(oeSelfTest): -@testcase(283) -def test_btrfs(self): +@testcase(563) +def test_directfb(self): These patches seem a little confused, doesn't this remove the btrfs test you just added? Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] External modules fail to load due to unknown symbols
On Fri, 2015-06-05 at 13:18 -0400, Amy Fong wrote: From da12fa5e6daca0c0b7bb15df030b1c79fbefa089 Mon Sep 17 00:00:00 2001 From: Amy Fong amy.f...@windriver.com Date: Mon, 1 Jun 2015 13:16:20 -0400 Subject: [PATCH] External modules fail to load due to unknown symbols When building external kernel modules, a failure can happen when the module has dependencies on other kernel modules. In such cases, the build looks at Module.symvers to do symbol lookups of the other kernel modules that it depends on. Module.symvers gets copied by do_shared_workdir after do_compile and Module.symvers gets updated during do_compile_kernelmodules. do_compile_kernelmodules is modified to explicitly copy Module.symvers to the shared workdir. Signed-off-by: Amy Fong amy.f...@windriver.com Signed-off-by: Bruce Ashfield bruce.ashfi...@windriver.com --- meta/classes/kernel.bbclass | 8 1 file changed, 8 insertions(+) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 4f22cde..4a177b1 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -215,6 +215,14 @@ do_compile_kernelmodules() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then oe_runmake ${PARALLEL_MAKE} modules CC=${KERNEL_CC} LD=${KERNEL_LD} ${KERNEL_EXTRA_ARGS} + + # Module.symvers gets updated during the + # building of the kernel modules. We need to + # update this in the shared workdir since some + # external kernel modules has a dependency on + # other kernel modules and will look at this + # file to do symbol lookups + cp Module.symvers ${STAGING_KERNEL_BUILDDIR} else bbnote no modules to compile fi Sadly this will give rise to a race. shared_workdir is defined as: addtask shared_workdir after do_compile before do_compile_kernelmodule and other modules depend on the shared_workdir task. Your other modules could therefore compile before the code in compile_kernelmodule has run. At a guess you will next suggest we change shared_workdir to be after compile_kernelmodules. The problem there is one of performance. We had bug reports from the community and Wind River people about the fact that shared_workdir executes when building kernel modules and doesn't come from sstate. Forcing shared_workdir to run more tasks every time isn't going to make people happy either :( So I'm not sure how we solve this but it is going to need more thought and the above patch isn't right. Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [fido][PATCH 00/13] devtool backports for fido (cover letter only)
Some fixes for devtool in fido. The oe-selftest tests all pass with these applied. The following changes since commit b266977372f2d5704d00dd07b29ea49898ebf70e: combo-layer: handle unset dest_dir in sanity_check() (2015-05-29 13:00:52 +0100) are available in the git repository at: git://git.openembedded.org/openembedded-core-contrib paule/devtool-fido http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool-fido Markus Lehtonen (4): devtool: call parse_recipe with correct arguments devtool: modify: use B=S if that is the default for the recipe devtool: modify: implement --no-same-dir devtool: include bbappends in recipe parsing Paul Eggleton (9): devtool: handle . in recipe name devtool: add: use correct bbappend file name with -V option devtool: update-recipe: handle unversioned bbappends devtool: update-recipe: check if source tree is a git repository recipetool: avoid second-level subdir when extracting recipetool: ensure git clone is standalone when extracting devtool: fix build env command execution error handling devtool: if workspace layer exists, still ensure it's in bblayers.conf oe-selftest: devtool: add a proper test to see if tap devices exist meta/lib/oe/recipeutils.py| 10 +-- meta/lib/oeqa/selftest/devtool.py | 14 - scripts/devtool | 38 +++- scripts/lib/devtool/__init__.py | 9 ++- scripts/lib/devtool/standard.py | 126 -- scripts/lib/recipetool/create.py | 15 +++-- scripts/lib/scriptutils.py| 11 7 files changed, 148 insertions(+), 75 deletions(-) -- 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] linux-yocto: update beaglebone, mpc8315e and edgerouter to 3.19
On 5 June 2015 at 05:13, Bruce Ashfield bruce.ashfi...@windriver.com wrote: Bumping the linux-yocto SRCREVs to integrate fixes for the h/w reference BSPs to the 3.19 kernel. edgerouter fails for me: | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/fs/aufs/i_op.c: In function 'au_pin_hdir_set_owner': | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/fs/aufs/i_op.c:445:28: error: 'struct mutex' has no member named 'owner' | p-hdir-hi_inode-i_mutex.owner = task; | ^ | LD drivers/idle/built-in.o | CC fs/aufs/i_op_del.o | LD drivers/i2c/busses/built-in.o | CC drivers/base/module.o | LD drivers/i2c/muxes/built-in.o | /data/poky-master/tmp/work-shared/edgerouter/kernel-source/scripts/Makefile.build:257: recipe for target 'fs/aufs/i_op.o' failed | make[4]: *** [fs/aufs/i_op.o] Error 1 Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core