* Re: Contents of non-rootfs partitions
From: Enrico Joerns @ 2016-11-23 10:12 UTC (permalink / raw)
To: Maciej Borzęcki
Cc: Eduard Bartosh, Patches and discussions about the oe-core layer
In-Reply-To: <CAD4b0_LrF=sQMV3r+3Kb8hqxcqD9U_LBMesxCyby+FGS7YssFQ@mail.gmail.com>
On 11/23/2016 10:24 AM, Maciej Borzęcki wrote:
> On Wed, Nov 23, 2016 at 9:40 AM, Enrico Joerns <ejo@pengutronix.de> wrote:
>> On 11/22/2016 12:54 PM, Kristian Amlie wrote:
>>>
>>> On 22/11/16 12:10, Patrick Ohly wrote:
>>>>>
>>>>> ...
>>>>
>>>>
>>>> All of these introduce some special mechanism. Let me propose something
>>>> that might integrate better with the existing tooling:
>>>>
>>>> The "rootfs" directory gets redefined as representing the entire virtual
>>>> file system. When creating a disk image, it gets split up into different
>>>> partitions based on the image configuration.
>>>>
>>>> For example, the /home or /data directories in the rootfs could hold the
>>>> content that in some image configurations goes into separate partitions.
>>>>
>>>> The advantage of this approach is that the tooling for staging content
>>>> for image creation does not need to be changed. The same staged content
>>>> then can be used to create different images, potentially even using
>>>> different partition layouts.
>>>
>>>
>>> That's a very good idea. I think it beats all of my suggestions!
>>
>>
>> I totally agree with this solution, because it is the same approach we are
>> already using for several years.
>>
>> Instead of wic we are using the genimage tool
>> (http://public.pengutronix.de/software/genimage/) together with a Yocto
>> class for easing image creation, but its pretty much the same concerning its
>> base purpose.
>>
>> We called the option to split up 'mountpoint' while assuming that the
>> splitted partition will be mounted to the same location in the file system
>> it was taken from.
>>
>> An example configuration would look like this (stripped down to the
>> essential parts):
>>
>> image my-disk-image {
>> [...]
>> partition root {
>> image = "rootfs.ext4"
>> [...]
>> }
>>
>> partition home {
>> image = "home.ext4"
>> [...]
>> }
>> }
>>
>> image rootfs.ext4 {
>> [...]
>> mountpoint = "/"
>> }
>>
>> image home.ext4 {
>> [...]
>> mountpoint = "/home"
>> }
>>
>> Maybe a similar approach could be used in wic, too.
>
> I went through the README from genimage repo
> https://git.pengutronix.de/cgit/genimage/tree/README. Definitely looks
> interesting and covers storage medias that are not supported by wic
> right now. The split option does not seem to be documented though. If I
> understood you correctly, the partition is seeded with data from
> location specified by `mountpoint` inside IMAGE_ROOTFS. Is that correct?
Yes, what the genimage class (see below) does, is unpacking the final
rootfs.tar.xz inside a fakeroot environment and call the genimage tool
with the --rootpath argument set to this path.
The mountpoint="/home" tells genimage to pack all content in directory
/home into a separate data ext4 image (temporary named 'home.ext4') and
all other content in a rootfs ext4 image (temporary named 'rootfs.ext4').
The `image` section then specifies how to construct the final disk image
using the referenced generated rootfs and datafs images (and optionally
some bootloader, non-partition-data, etc.).
Note that this is only one way to use genimage. Another common way to
use it is to simply construct complex disk images out of different
filesystem images, e.g. with
partition barebox {
image = "barebox-any-platform.img"
size = 1M
in-partition-table = false
}
> I see there's a large overlap in functionality with wic (at least for
> block devices), so perhaps the best way would be introduce genimage as
> another IMAGE_CMD.
>
> I've quickly checked at https://layers.openembedded.org and there are no
> recipes for genimage/libconfuse listed there. Do happen to have done
> integration with OE in some private repo already? Would it be possible
> for you to post the relevant patches?
>
We have a layer for this, which is potentially publicly available but
not advertised as the general plan was to move some of its content to
upstream (oe-core, meta-oe) and split up other content (e.g. the rauc
update tool stuff) to separate layers that will be made publicly
available. But, as always, there are more plans than time left ;)
Well, to make a long story short, the path to the git repository is:
https://git.pengutronix.de/cgit/meta-ptx
The genimage class I mentioned above you can find in it, too:
https://git.pengutronix.de/cgit/meta-ptx/tree/classes/genimage.bbclass
When starting with Yocto I thought about changing from genimage to wic
for disk image creation as wic already seemed to become the standard
solution for building disk images. But back in these days it was a very
separate tool and there was no integration with the BSP itself (which is
crucial when having to reproduce builds). But the main reason why I
decided to stay with genimage was that wic simply did not cover most of
the use cases I required for building complex disk images for different
embedded platforms. I'm pretty sure that this has changed in some
points, but had no time to get deeper into this topic again, yet.
Hope that helps, best regards
Enrico
--
Pengutronix e.K. | Enrico Jörns |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH] libpcap: Fix build when PACKAGECONFIG ipv6 is not enable
From: Otavio Salvador @ 2016-11-23 10:00 UTC (permalink / raw)
To: Christopher Larson; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CABcZANnL5MxwQmiZZ0i8CGHaYxsD9zapNfcyB_a37OoigHq2oA@mail.gmail.com>
On Thu, Nov 17, 2016 at 2:24 PM, Christopher Larson <clarson@kergoth.com> wrote:
>
> On Thu, Nov 17, 2016 at 9:21 AM, Fabio Berton
> <fabio.berton@ossystems.com.br> wrote:
>>
>> No, I created a patch, git format-patch and then edit generated files with
>> Upstream-Status tag and added to recipe. Is this wrong?
>
>
> As I indicated in my first reply, it’s best to put the tag outside the
> generated patch (above it, or below the —-), as it isn’t part of the commit,
> only part of the patch file. It’s minor, and you don’t need to re-submit,
> but in general the tag is not part of the commit message. For example, if
> your patch was applied to a git repository with git-am, it’d be in the
> commit message, which should not be the case.
To be honest, there a many files which does as Fabio did and I also
personally do as well. I don't like it outside of the commit log as it
looks out of context.
If someone is getting the patch file, it is expected they will review
it and not blindly apply it on upstream repository.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply
* [PATCH V3 2/2] systemd: Upgrade to 232
From: Khem Raj @ 2016-11-23 9:28 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <20161123092807.28693-1-raj.khem@gmail.com>
* Drop support for rcS.d SysV init scripts.
These are prone to cause dependency loops, and almost all packages with
rcS scripts now ship a native systemd service.
* Drop mount propagation patch, it only happens with libseccomp, OE doesnt
enable it
* kdbus option has disappeared from configure
* Ignore dev-so for PN now since systemd introduced private .so see
https://github.com/systemd/systemd/issues/3810
* Add libnss* to PACKAGES_DYNAMIC for libnss-resolve to work correctly
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-core/systemd/systemd.inc | 4 +-
....c-Change-the-default-device-timeout-to-2.patch | 8 +-
...r-getty-to-agetty-in-console-setup-system.patch | 10 +-
.../systemd/0003-define-exp10-if-missing.patch | 12 +-
...nv-when-secure-versions-are-not-available.patch | 21 ++--
...t-install-dependency-links-at-install-tim.patch | 10 +-
...heck-for-additional-features-that-uclibc-.patch | 10 +-
...pper-instead-of-looking-for-relative-opti.patch | 38 ++----
...wn-Use-execvpe-only-when-libc-supports-it.patch | 16 +--
...-unimplemented-_SC_PHYS_PAGES-system-conf.patch | 27 +++--
...0010-implment-systemd-sysv-install-for-OE.patch | 6 +-
...nes-Build-conditionally-when-HAVE_MYHOSTN.patch | 12 +-
.../systemd/0012-rules-whitelist-hd-devices.patch | 21 ++--
...-Make-root-s-home-directory-configurable.patch} | 90 +++++---------
...tor-add-support-for-executing-scripts-und.patch | 133 ---------------------
...vert-rules-remove-firmware-loading-rules.patch} | 6 +-
...remove-userspace-firmware-loading-suppor.patch} | 58 +++++----
...0015-systemd-user-avoid-using-system-auth.patch | 35 ------
...patch => 0016-make-test-dir-configurable.patch} | 21 ++--
...=> 0017-remove-duplicate-include-uchar.h.patch} | 10 +-
...h => 0018-check-for-uchar.h-in-configure.patch} | 16 ++-
...l-don-t-fail-if-libc-doesn-t-support-IDN.patch} | 20 ++--
...sing.h-for-getting-secure_getenv-definiti.patch | 27 -----
.../systemd/systemd/CVE-2016-7795.patch | 69 -----------
...dev-re-enable-mount-propagation-for-udevd.patch | 31 -----
.../systemd/{systemd_230.bb => systemd_232.bb} | 24 ++--
26 files changed, 196 insertions(+), 539 deletions(-)
rename meta/recipes-core/systemd/systemd/{0014-Make-root-s-home-directory-configurable.patch => 0013-Make-root-s-home-directory-configurable.patch} (66%)
delete mode 100644 meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
rename meta/recipes-core/systemd/systemd/{0016-Revert-rules-remove-firmware-loading-rules.patch => 0014-Revert-rules-remove-firmware-loading-rules.patch} (84%)
rename meta/recipes-core/systemd/systemd/{0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch => 0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch} (89%)
delete mode 100644 meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
rename meta/recipes-core/systemd/systemd/{0018-make-test-dir-configurable.patch => 0016-make-test-dir-configurable.patch} (77%)
rename meta/recipes-core/systemd/systemd/{0019-remove-duplicate-include-uchar.h.patch => 0017-remove-duplicate-include-uchar.h.patch} (81%)
rename meta/recipes-core/systemd/systemd/{0020-check-for-uchar.h-in-configure.patch => 0018-check-for-uchar.h-in-configure.patch} (76%)
rename meta/recipes-core/systemd/systemd/{0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch => 0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch} (69%)
delete mode 100644 meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
delete mode 100644 meta/recipes-core/systemd/systemd/CVE-2016-7795.patch
delete mode 100644 meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch
rename meta/recipes-core/systemd/{systemd_230.bb => systemd_232.bb} (96%)
diff --git a/meta/recipes-core/systemd/systemd.inc b/meta/recipes-core/systemd/systemd.inc
index f800f42..29e0be6 100644
--- a/meta/recipes-core/systemd/systemd.inc
+++ b/meta/recipes-core/systemd/systemd.inc
@@ -14,12 +14,10 @@ LICENSE = "GPLv2 & LGPLv2.1"
LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
-SRCREV = "3a74d4fc90cb322a4784a3515bef7118c8f8c5ba"
+SRCREV = "a1e2ef7ec912902d8142e7cb5830cbfb47dba86c"
SRC_URI = "git://github.com/systemd/systemd.git;protocol=git"
-PV = "230+git${SRCPV}"
-
S = "${WORKDIR}/git"
LDFLAGS_append_libc-uclibc = " -lrt -lssp_nonshared -lssp "
diff --git a/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch b/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
index f7ef7a3..ee2cd6c 100644
--- a/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
+++ b/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
@@ -1,7 +1,7 @@
-From 3bc4552117879f57522b5972b724729ca993f1ea Mon Sep 17 00:00:00 2001
+From a544d6d15f5c418084f322349aafe341128d5fca Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 14 Dec 2015 04:09:19 +0000
-Subject: [PATCH 01/36] core/device.c: Change the default device timeout to 240
+Subject: [PATCH 01/19] core/device.c: Change the default device timeout to 240
sec.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -16,7 +16,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/device.c b/src/core/device.c
-index d201dc5..340d62a 100644
+index c572a67..f90774e 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -112,7 +112,7 @@ static void device_init(Unit *u) {
@@ -29,5 +29,5 @@ index d201dc5..340d62a 100644
u->ignore_on_isolate = true;
}
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch b/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
index 28939eb..951a28d 100644
--- a/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
+++ b/meta/recipes-core/systemd/systemd/0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch
@@ -1,7 +1,7 @@
-From e5f405aba347d216e7f2b73d7dd681b13be442e3 Mon Sep 17 00:00:00 2001
+From 8736d9b9bb492f60e8f3a1a7fb5a05ba3201d86b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 20 Feb 2015 05:29:15 +0000
-Subject: [PATCH 02/36] units: Prefer getty to agetty in console setup systemd
+Subject: [PATCH 02/19] units: Prefer getty to agetty in console setup systemd
units
Upstream-Status: Inappropriate [configuration specific]
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
-index 46164ab..bdf6ec8 100644
+index 5b82c13..e729469 100644
--- a/units/getty@.service.m4
+++ b/units/getty@.service.m4
-@@ -27,7 +27,7 @@ ConditionPathExists=/dev/tty0
+@@ -33,7 +33,7 @@ ConditionPathExists=/dev/tty0
[Service]
# the VT is cleared by TTYVTDisallocate
@@ -40,5 +40,5 @@ index 4522d0d..e6d499d 100644
Restart=always
UtmpIdentifier=%I
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch b/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
index e62d580..37c6ac5 100644
--- a/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
+++ b/meta/recipes-core/systemd/systemd/0003-define-exp10-if-missing.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 03/36] define exp10 if missing
+From b383c286f58184575216b2bf6f185ba2ad648956 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 19:25:45 -0800
+Subject: [PATCH 03/19] define exp10 if missing
Inspired by: http://peter.korsgaard.com/patches/alsa-utils/alsamixer-fix-build-on-uClibc-exp10.patch
@@ -8,16 +11,15 @@ Upstream-Status: Pending
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
---
src/basic/missing.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/basic/missing.h b/src/basic/missing.h
-index 651e414..fafa233 100644
+index 4c013be..4a3fd9c 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
-@@ -1013,4 +1013,9 @@ typedef int32_t key_serial_t;
+@@ -1078,4 +1078,9 @@ typedef int32_t key_serial_t;
#endif
@@ -28,5 +30,5 @@ index 651e414..fafa233 100644
+
#include "missing_syscall.h"
--
-2.8.3
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch b/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
index 989a1fa..ab2cbe0 100644
--- a/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
+++ b/meta/recipes-core/systemd/systemd/0004-Use-getenv-when-secure-versions-are-not-available.patch
@@ -1,7 +1,7 @@
-From bb8d8148b16572ae17d3c308552cf73915386b05 Mon Sep 17 00:00:00 2001
+From 5765cda4f7243e240b1e8723dc536fb20503d544 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 12 Sep 2015 19:10:04 +0000
-Subject: [PATCH 04/36] Use getenv when secure versions are not available
+Date: Wed, 9 Nov 2016 19:28:32 -0800
+Subject: [PATCH 04/19] Use getenv when secure versions are not available
musl doesnt implement secure version, so we default
to it if configure does not detect a secure imeplementation
@@ -9,19 +9,14 @@ to it if configure does not detect a secure imeplementation
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Denied
---
- src/basic/missing.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
+ src/basic/missing.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/basic/missing.h b/src/basic/missing.h
-index ee7e7ea..3170429 100644
+index 4a3fd9c..4936873 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
-@@ -585,12 +585,11 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle
- return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
- }
- #endif
--
- #ifndef HAVE_SECURE_GETENV
+@@ -529,7 +529,7 @@ struct btrfs_ioctl_quota_ctl_args {
# ifdef HAVE___SECURE_GETENV
# define secure_getenv __secure_getenv
# else
@@ -31,5 +26,5 @@ index ee7e7ea..3170429 100644
#endif
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
index f69e26e..7016e98 100644
--- a/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
+++ b/meta/recipes-core/systemd/systemd/0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -1,7 +1,7 @@
-From 3436b12d40bf4f4ab7e3e16600e5f6c35a470da4 Mon Sep 17 00:00:00 2001
+From 74450f0dbad2f8478c26eeaa46d4e4a987858f45 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 20 Feb 2015 05:03:44 +0000
-Subject: [PATCH 05/36] binfmt: Don't install dependency links at install time
+Subject: [PATCH 05/19] binfmt: Don't install dependency links at install time
for the binfmt services
use [Install] blocks so that they get created when the service is enabled
@@ -24,10 +24,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index 03341fc..629740f 100644
+index 50da458..29ed1dd 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -4387,10 +4387,6 @@ INSTALL_DIRS += \
+@@ -4635,10 +4635,6 @@ INSTALL_DIRS += \
$(prefix)/lib/binfmt.d \
$(sysconfdir)/binfmt.d
@@ -70,5 +70,5 @@ index d53073e..8c57ee0 100644
+[Install]
+WantedBy=sysinit.target
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch b/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
index 0d63755..43a0d3f 100644
--- a/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
+++ b/meta/recipes-core/systemd/systemd/0006-configure-Check-for-additional-features-that-uclibc-.patch
@@ -1,7 +1,7 @@
-From bb6f1d8a000b337280541afde7cccdcfe03cdeb1 Mon Sep 17 00:00:00 2001
+From 82d837b76618a773485b96e38b7b91083a7437e8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 20 Feb 2015 05:05:45 +0000
-Subject: [PATCH 06/36] configure: Check for additional features that uclibc
+Subject: [PATCH 06/19] configure: Check for additional features that uclibc
doesnt support
This helps in supporting uclibc which does not have all features that
@@ -15,10 +15,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 18 insertions(+)
diff --git a/configure.ac b/configure.ac
-index f51533c..0239fd0 100644
+index 7f6b3b9..7c4b5a2 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -112,6 +112,24 @@ AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin]
+@@ -110,6 +110,24 @@ AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin]
AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
@@ -44,5 +44,5 @@ index f51533c..0239fd0 100644
AC_CHECK_TOOL(OBJCOPY, objcopy)
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch b/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
index 12f6ace..fad69a5 100644
--- a/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
+++ b/meta/recipes-core/systemd/systemd/0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
@@ -1,31 +1,22 @@
-From fa5e137fbd2fb081ae897575377d718ee8cb6349 Mon Sep 17 00:00:00 2001
+From a3482c91642cf568b3ac27fa6c0cb3c6b30669b7 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 20 Dec 2015 04:20:28 +0000
-Subject: [PATCH 07/36] use lnr wrapper instead of looking for --relative
+Date: Wed, 9 Nov 2016 19:32:14 -0800
+Subject: [PATCH 07/19] use lnr wrapper instead of looking for --relative
option for ln
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
- Makefile.am | 6 +++---
+ Makefile.am | 2 +-
configure.ac | 2 --
- 2 files changed, 3 insertions(+), 5 deletions(-)
+ 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index 629740f..82b6553 100644
+index 29ed1dd..02f4017 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -243,7 +243,7 @@ define move-to-rootlibdir
- $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
- so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
- rm -f $(DESTDIR)$(libdir)/$$libname && \
-- $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
-+ lnr $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
- mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
- fi
- endef
-@@ -317,7 +317,7 @@ define install-relative-aliases
+@@ -320,7 +320,7 @@ define install-relative-aliases
while [ -n "$$1" ]; do \
$(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
rm -f $(DESTDIR)$$dir/$$2 && \
@@ -34,20 +25,11 @@ index 629740f..82b6553 100644
shift 2 || exit $$?; \
done
endef
-@@ -2781,7 +2781,7 @@ systemd_dbus1_generator_LDADD = \
- dbus1-generator-install-hook:
- $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
- $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
-- $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
-+ $(AM_V_LN)lnr $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
-
- dbus1-generator-uninstall-hook:
- rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
diff --git a/configure.ac b/configure.ac
-index 0239fd0..c5ab9d0 100644
+index 7c4b5a2..b10c952 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -110,8 +110,6 @@ AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
+@@ -108,8 +108,6 @@ AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
AC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
@@ -57,5 +39,5 @@ index 0239fd0..c5ab9d0 100644
AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch b/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
index 6e6f199..586b5aa 100644
--- a/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
+++ b/meta/recipes-core/systemd/systemd/0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch
@@ -1,7 +1,7 @@
-From ae999ff50efb9cc82537adef7696c6f732afcfc8 Mon Sep 17 00:00:00 2001
+From 96026a3763264eb41a2c3e374f232f6e543284a8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 20 Feb 2015 05:10:37 +0000
-Subject: [PATCH 08/36] nspawn: Use execvpe only when libc supports it
+Date: Wed, 9 Nov 2016 19:33:49 -0800
+Subject: [PATCH 08/19] nspawn: Use execvpe only when libc supports it
Upstream-Status: Denied [no desire for uclibc support]
@@ -11,10 +11,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 7 insertions(+)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
-index 5a68fec..65e65ec 100644
+index 9b9ae90..19b47cd 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
-@@ -111,6 +111,8 @@ typedef enum LinkJournal {
+@@ -123,6 +123,8 @@ typedef enum LinkJournal {
LINK_GUEST
} LinkJournal;
@@ -23,7 +23,7 @@ index 5a68fec..65e65ec 100644
static char *arg_directory = NULL;
static char *arg_template = NULL;
static char *arg_chdir = NULL;
-@@ -2637,7 +2639,12 @@ static int inner_child(
+@@ -2871,7 +2873,12 @@ static int inner_child(
a[0] = (char*) "/sbin/init";
execve(a[0], a, env_use);
} else if (!strv_isempty(arg_parameters))
@@ -35,7 +35,7 @@ index 5a68fec..65e65ec 100644
+#endif /* HAVE_EXECVPE */
else {
if (!arg_chdir)
- chdir(home ?: "/root");
+ /* If we cannot change the directory, we'll end up in /, that is expected. */
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch b/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
index 116f3d4..f150bb0 100644
--- a/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
+++ b/meta/recipes-core/systemd/systemd/0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
@@ -1,7 +1,7 @@
-From 3498f488b27f90398d7c8d1d06aac5ab684370e8 Mon Sep 17 00:00:00 2001
+From 085c8b6f253726ad547e7be84ff3f2b99701488b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 14 Dec 2015 00:47:53 +0000
-Subject: [PATCH 09/36] util: bypass unimplemented _SC_PHYS_PAGES system
+Date: Wed, 9 Nov 2016 19:38:07 -0800
+Subject: [PATCH 09/19] util: bypass unimplemented _SC_PHYS_PAGES system
configuration API on uclibc
Upstream-Status: Inappropriate [uclibc-specific]
@@ -12,12 +12,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 15 insertions(+)
diff --git a/src/basic/util.c b/src/basic/util.c
-index ea1bed7..fdaf340 100644
+index c1b5ca1..4c62d43 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
-@@ -767,10 +767,25 @@ uint64_t physical_memory(void) {
- /* We return this as uint64_t in case we are running as 32bit
- * process on a 64bit kernel with huge amounts of memory */
+@@ -742,6 +742,20 @@ uint64_t physical_memory(void) {
+ * In order to support containers nicely that have a configured memory limit we'll take the minimum of the
+ * physically reported amount of memory and the limit configured for the root cgroup, if there is any. */
+#ifdef __UCLIBC__
+ char line[128];
@@ -33,14 +33,17 @@ index ea1bed7..fdaf340 100644
+ fclose(f);
+ return (uint64_t) mem;
+#else
- mem = sysconf(_SC_PHYS_PAGES);
- assert(mem > 0);
+ sc = sysconf(_SC_PHYS_PAGES);
+ assert(sc > 0);
- return (uint64_t) mem * (uint64_t) page_size();
+@@ -762,6 +776,7 @@ uint64_t physical_memory(void) {
+ lim *= ps;
+
+ return MIN(mem, lim);
+#endif
}
- int update_reboot_param_file(const char *param) {
+ uint64_t physical_memory_scale(uint64_t v, uint64_t max) {
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch b/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
index 75fa3a5..8828d6e 100644
--- a/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
+++ b/meta/recipes-core/systemd/systemd/0010-implment-systemd-sysv-install-for-OE.patch
@@ -1,7 +1,7 @@
-From 5f94f5ad46c1ded54c3797979d384e4c1eb77bb0 Mon Sep 17 00:00:00 2001
+From 52726be92e2b841f744a96c378cc872ae0033a2b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 5 Sep 2015 06:31:47 +0000
-Subject: [PATCH 10/36] implment systemd-sysv-install for OE
+Subject: [PATCH 10/19] implment systemd-sysv-install for OE
Use update-rc.d for enabling/disabling and status command
to check the status of the sysv service
@@ -39,5 +39,5 @@ index a53a3e6..5d877b0 100755
*)
usage ;;
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch b/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
index 34ae645..b01ae97 100644
--- a/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
+++ b/meta/recipes-core/systemd/systemd/0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch
@@ -1,7 +1,7 @@
-From 2b2450f6b7197bff4637c0283e8784500471d083 Mon Sep 17 00:00:00 2001
+From 3f6f45578b828e414f50c6822375073e7174236a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 14 Dec 2015 00:50:01 +0000
-Subject: [PATCH 11/36] nss-mymachines: Build conditionally when
+Subject: [PATCH 11/19] nss-mymachines: Build conditionally when
HAVE_MYHOSTNAME is set
Fixes build failures when building with --disable-myhostname
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 2 insertions(+)
diff --git a/Makefile.am b/Makefile.am
-index 82b6553..b3f3343 100644
+index 02f4017..420e0e0 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -4876,6 +4876,7 @@ SYSTEM_UNIT_ALIASES += \
+@@ -5146,6 +5146,7 @@ SYSTEM_UNIT_ALIASES += \
BUSNAMES_TARGET_WANTS += \
org.freedesktop.machine1.busname
@@ -25,7 +25,7 @@ index 82b6553..b3f3343 100644
libnss_mymachines_la_SOURCES = \
src/nss-mymachines/nss-mymachines.sym \
src/nss-mymachines/nss-mymachines.c
-@@ -4896,6 +4897,7 @@ lib_LTLIBRARIES += \
+@@ -5167,6 +5168,7 @@ rootlib_LTLIBRARIES += \
libnss_mymachines.la
endif
@@ -34,5 +34,5 @@ index 82b6553..b3f3343 100644
polkitpolicy_in_files += \
src/machine/org.freedesktop.machine1.policy.in
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch b/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
index 6143088..8666bdc 100644
--- a/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
+++ b/meta/recipes-core/systemd/systemd/0012-rules-whitelist-hd-devices.patch
@@ -1,7 +1,7 @@
-From 5ebc0d87565a73710dea602c00b1586d5a1364e5 Mon Sep 17 00:00:00 2001
-From: Patrick Ohly <patrick.ohly@intel.com>
-Date: Wed, 16 Sep 2015 13:55:58 +0200
-Subject: [PATCH 12/36] rules: whitelist hd* devices
+From 8cc1ae11f54dcc38ee2168b0f99703b835dd3942 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 19:41:13 -0800
+Subject: [PATCH 12/19] rules: whitelist hd* devices
qemu by default emulates IDE and the linux-yocto kernel(s) use
CONFIG_IDE instead of the more modern libsata, so disks appear as
@@ -10,23 +10,24 @@ CONFIG_IDE instead of the more modern libsata, so disks appear as
Upstream-Status: Denied [https://github.com/systemd/systemd/pull/1276]
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
rules/60-persistent-storage.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
-index 0b14bb4..1c4d97a 100644
+index c13d05c..b14fbed 100644
--- a/rules/60-persistent-storage.rules
+++ b/rules/60-persistent-storage.rules
-@@ -6,7 +6,7 @@
- ACTION=="remove", GOTO="persistent_storage_end"
+@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end"
+ ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"
SUBSYSTEM!="block", GOTO="persistent_storage_end"
--KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*", GOTO="persistent_storage_end"
-+KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|hd*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*", GOTO="persistent_storage_end"
+-KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*", GOTO="persistent_storage_end"
++KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|hd*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*", GOTO="persistent_storage_end"
# ignore partitions that span the entire disk
TEST=="whole_disk", GOTO="persistent_storage_end"
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0013-Make-root-s-home-directory-configurable.patch
similarity index 66%
rename from meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch
rename to meta/recipes-core/systemd/systemd/0013-Make-root-s-home-directory-configurable.patch
index 2eea0ff..2b33337 100644
--- a/meta/recipes-core/systemd/systemd/0014-Make-root-s-home-directory-configurable.patch
+++ b/meta/recipes-core/systemd/systemd/0013-Make-root-s-home-directory-configurable.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 14/36] Make root's home directory configurable
+From 79e64a07840e0d97d66e46111f1c086bf83981b7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:35:30 -0800
+Subject: [PATCH 13/19] Make root's home directory configurable
OpenEmbedded has a configurable home directory for root. Allow
systemd to be built using its idea of what root's home directory
@@ -11,23 +14,20 @@ https://github.com/systemd/systemd/issues/541
Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
---
- Makefile.am | 2 ++
- configure.ac | 7 +++++++
- src/basic/user-util.c | 4 ++--
- src/core/namespace.c | 2 +-
- src/nspawn/nspawn.c | 4 ++--
- units/console-shell.service.m4.in | 4 ++--
- units/emergency.service.in | 4 ++--
- units/rescue.service.in | 4 ++--
- 8 files changed, 20 insertions(+), 11 deletions(-)
+ Makefile.am | 2 ++
+ configure.ac | 7 +++++++
+ src/basic/user-util.c | 4 ++--
+ src/nspawn/nspawn.c | 4 ++--
+ units/emergency.service.in | 4 ++--
+ units/rescue.service.in | 4 ++--
+ 6 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
-index 305099a..88c1250 100644
+index 420e0e0..3010b01 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -206,6 +206,7 @@ AM_CPPFLAGS = \
+@@ -213,6 +213,7 @@ AM_CPPFLAGS = \
-DLIBDIR=\"$(libdir)\" \
-DROOTLIBDIR=\"$(rootlibdir)\" \
-DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
@@ -35,8 +35,8 @@ index 305099a..88c1250 100644
-DTEST_DIR=\"$(abs_top_srcdir)/test\" \
-I $(top_srcdir)/src \
-I $(top_builddir)/src/basic \
-@@ -5863,6 +5864,7 @@ EXTRA_DIST += \
- substitutions = \
+@@ -6057,6 +6058,7 @@ substitutions = \
+ '|rootlibdir=$(rootlibdir)|' \
'|rootlibexecdir=$(rootlibexecdir)|' \
'|rootbindir=$(rootbindir)|' \
+ '|roothomedir=$(roothomedir)|' \
@@ -44,10 +44,10 @@ index 305099a..88c1250 100644
'|SYSTEMCTL=$(rootbindir)/systemctl|' \
'|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
diff --git a/configure.ac b/configure.ac
-index 329861a..01764f5 100644
+index b10c952..dfc0bd3 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1478,6 +1478,11 @@ AC_ARG_WITH([rootlibdir],
+@@ -1513,6 +1513,11 @@ AC_ARG_WITH([rootlibdir],
[with_rootlibdir=${libdir}])
AX_NORMALIZE_PATH([with_rootlibdir])
@@ -59,7 +59,7 @@ index 329861a..01764f5 100644
AC_ARG_WITH([pamlibdir],
AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
[],
-@@ -1562,6 +1567,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir])
+@@ -1598,6 +1603,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir])
AC_SUBST([pamconfdir], [$with_pamconfdir])
AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
@@ -67,7 +67,7 @@ index 329861a..01764f5 100644
AC_CONFIG_FILES([
Makefile
-@@ -1653,6 +1659,7 @@ AC_MSG_RESULT([
+@@ -1688,6 +1694,7 @@ AC_MSG_RESULT([
includedir: ${includedir}
lib dir: ${libdir}
rootlib dir: ${with_rootlibdir}
@@ -76,10 +76,10 @@ index 329861a..01764f5 100644
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
Build Python: ${PYTHON}
diff --git a/src/basic/user-util.c b/src/basic/user-util.c
-index f65ca3e..da1101a 100644
+index 938533d..3f9fdc4 100644
--- a/src/basic/user-util.c
+++ b/src/basic/user-util.c
-@@ -123,7 +123,7 @@ int get_user_creds(
+@@ -127,7 +127,7 @@ int get_user_creds(
*gid = 0;
if (home)
@@ -88,7 +88,7 @@ index f65ca3e..da1101a 100644
if (shell)
*shell = "/bin/sh";
-@@ -354,7 +354,7 @@ int get_home_dir(char **_h) {
+@@ -387,7 +387,7 @@ int get_home_dir(char **_h) {
/* Hardcode home directory for root to avoid NSS */
u = getuid();
if (u == 0) {
@@ -97,24 +97,11 @@ index f65ca3e..da1101a 100644
if (!h)
return -ENOMEM;
-diff --git a/src/core/namespace.c b/src/core/namespace.c
-index 203d122..45c0d11 100644
---- a/src/core/namespace.c
-+++ b/src/core/namespace.c
-@@ -415,7 +415,7 @@ int setup_namespace(
- home_dir = strjoina("-", home_dir);
- run_user_dir = prefix_roota(root_directory, "/run/user");
- run_user_dir = strjoina("-", run_user_dir);
-- root_dir = prefix_roota(root_directory, "/root");
-+ root_dir = prefix_roota(root_directory, ROOTHOMEDIR);
- root_dir = strjoina("-", root_dir);
-
- r = append_mounts(&m, STRV_MAKE(home_dir, run_user_dir, root_dir),
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
-index 8ec0584..51df00b 100644
+index 19b47cd..e42bf19 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
-@@ -2739,7 +2739,7 @@ static int inner_child(
+@@ -2798,7 +2798,7 @@ static int inner_child(
if (envp[n_env])
n_env++;
@@ -123,7 +110,7 @@ index 8ec0584..51df00b 100644
(asprintf((char**)(envp + n_env++), "USER=%s", arg_user ? arg_user : "root") < 0) ||
(asprintf((char**)(envp + n_env++), "LOGNAME=%s", arg_user ? arg_user : "root") < 0))
return log_oom();
-@@ -2816,7 +2816,7 @@ static int inner_child(
+@@ -2882,7 +2882,7 @@ static int inner_child(
else {
if (!arg_chdir)
/* If we cannot change the directory, we'll end up in /, that is expected. */
@@ -132,23 +119,8 @@ index 8ec0584..51df00b 100644
execle("/bin/bash", "-bash", NULL, env_use);
execle("/bin/sh", "-sh", NULL, env_use);
-diff --git a/units/console-shell.service.m4.in b/units/console-shell.service.m4.in
-index a345ec2..3caae7d 100644
---- a/units/console-shell.service.m4.in
-+++ b/units/console-shell.service.m4.in
-@@ -15,8 +15,8 @@ After=rc-local.service
- Before=getty.target
-
- [Service]
--Environment=HOME=/root
--WorkingDirectory=-/root
-+Environment=HOME=@roothomedir@
-+WorkingDirectory=-@roothomedir@
- ExecStart=-@SULOGIN@
- ExecStopPost=-@SYSTEMCTL@ poweroff
- Type=idle
diff --git a/units/emergency.service.in b/units/emergency.service.in
-index 0de16f2..4826062 100644
+index da68eb8..e25f879 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -15,8 +15,8 @@ Conflicts=syslog.socket
@@ -160,10 +132,10 @@ index 0de16f2..4826062 100644
+Environment=HOME=@roothomedir@
+WorkingDirectory=-@roothomedir@
ExecStartPre=-/bin/plymouth --wait quit
- ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
+ ExecStartPre=-/bin/echo -e 'You are in emergency mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
diff --git a/units/rescue.service.in b/units/rescue.service.in
-index 92553f6..590ae17 100644
+index 5feff69..a83439e 100644
--- a/units/rescue.service.in
+++ b/units/rescue.service.in
@@ -14,8 +14,8 @@ After=sysinit.target plymouth-start.service
@@ -174,9 +146,9 @@ index 92553f6..590ae17 100644
-WorkingDirectory=-/root
+Environment=HOME=@roothomedir@
+WorkingDirectory=-@roothomedir@
- ExecStartPre=-/bin/plymouth quit
- ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
+ ExecStartPre=-/bin/plymouth --wait quit
+ ExecStartPre=-/bin/echo -e 'You are in rescue mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
--
-2.8.3
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch b/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
deleted file mode 100644
index ac67f65..0000000
--- a/meta/recipes-core/systemd/systemd/0013-sysv-generator-add-support-for-executing-scripts-und.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From 6736de4a3caf9a0b3c888c6cc05103ab1b86907d Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 14 Dec 2015 05:09:53 +0000
-Subject: [PATCH 13/36] sysv-generator: add support for executing scripts under
- /etc/rcS.d/
-
-To be compatible, all services translated from scripts under /etc/rcS.d would
-run before services translated from scripts under /etc/rcN.d.
-
-Upstream-Status: Inappropriate [OE specific]
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/sysv-generator/sysv-generator.c | 47 ++++++++++++++++++++++++++++---------
- 1 file changed, 36 insertions(+), 11 deletions(-)
-
-diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
-index b5925a4..ea06d6a 100644
---- a/src/sysv-generator/sysv-generator.c
-+++ b/src/sysv-generator/sysv-generator.c
-@@ -44,7 +44,8 @@
-
- typedef enum RunlevelType {
- RUNLEVEL_UP,
-- RUNLEVEL_DOWN
-+ RUNLEVEL_DOWN,
-+ RUNLEVEL_SYSINIT
- } RunlevelType;
-
- static const struct {
-@@ -59,6 +60,9 @@ static const struct {
- { "rc4.d", SPECIAL_MULTI_USER_TARGET, RUNLEVEL_UP },
- { "rc5.d", SPECIAL_GRAPHICAL_TARGET, RUNLEVEL_UP },
-
-+ /* Debian style rcS.d, also adopted by OE */
-+ { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT},
-+
- /* Standard SysV runlevels for shutdown */
- { "rc0.d", SPECIAL_POWEROFF_TARGET, RUNLEVEL_DOWN },
- { "rc6.d", SPECIAL_REBOOT_TARGET, RUNLEVEL_DOWN }
-@@ -67,7 +71,7 @@ static const struct {
- directories in this order, and we want to make sure that
- sysv_start_priority is known when we first load the
- unit. And that value we only know from S links. Hence
-- UP must be read before DOWN */
-+ UP/SYSINIT must be read before DOWN */
- };
-
- static const char *arg_dest = "/tmp";
-@@ -86,6 +90,8 @@ typedef struct SysvStub {
- bool has_lsb;
- bool reload;
- bool loaded;
-+ bool default_dependencies;
-+ bool from_rcsd;
- } SysvStub;
-
- static void free_sysvstub(SysvStub *s) {
-@@ -711,17 +717,31 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
- if (s->has_lsb && other->has_lsb)
- continue;
-
-- if (other->sysv_start_priority < s->sysv_start_priority) {
-- r = strv_extend(&s->after, other->name);
-+ /* All scripts under /etc/rcS.d should execute before scripts under
-+ * /etc/rcN.d */
-+ if (!other->from_rcsd && s->from_rcsd) {
-+ r = strv_extend(&s->before, other->name);
- if (r < 0)
- return log_oom();
-
-- } else if (other->sysv_start_priority > s->sysv_start_priority) {
-- r = strv_extend(&s->before, other->name);
-+ } else if (other->from_rcsd && !s->from_rcsd) {
-+ r = strv_extend(&s->after, other->name);
- if (r < 0)
- return log_oom();
-- } else
-- continue;
-+ } else {
-+ if (other->sysv_start_priority < s->sysv_start_priority) {
-+ r = strv_extend(&s->after, other->name);
-+ if (r < 0)
-+ return log_oom();
-+ }
-+ else if (other->sysv_start_priority > s->sysv_start_priority) {
-+ r = strv_extend(&s->before, other->name);
-+ if (r < 0)
-+ return log_oom();
-+ }
-+ else
-+ continue;
-+ }
-
- /* FIXME: Maybe we should compare the name here lexicographically? */
- }
-@@ -788,6 +808,8 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
- return log_oom();
-
- service->sysv_start_priority = -1;
-+ service->default_dependencies = true;
-+ service->from_rcsd = false;
- service->name = name;
- service->path = fpath;
- name = fpath = NULL;
-@@ -871,9 +893,11 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
-
- if (de->d_name[0] == 'S') {
-
-- if (rcnd_table[i].type == RUNLEVEL_UP)
-+ if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) {
- service->sysv_start_priority = MAX(a*10 + b, service->sysv_start_priority);
--
-+ service->default_dependencies = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?false:true;
-+ service->from_rcsd = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?true:false;
-+ }
- r = set_ensure_allocated(&runlevel_services[i], NULL);
- if (r < 0) {
- log_oom();
-@@ -887,7 +911,8 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
- }
-
- } else if (de->d_name[0] == 'K' &&
-- (rcnd_table[i].type == RUNLEVEL_DOWN)) {
-+ (rcnd_table[i].type == RUNLEVEL_DOWN ||
-+ rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
-
- r = set_ensure_allocated(&shutdown_services, NULL);
- if (r < 0) {
---
-1.8.3.1
-
diff --git a/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
similarity index 84%
rename from meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch
rename to meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
index 66905b5..ed7c68f 100644
--- a/meta/recipes-core/systemd/systemd/0016-Revert-rules-remove-firmware-loading-rules.patch
+++ b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
@@ -1,7 +1,7 @@
-From 7311ecc745c17d6ed9fd9cf43039648483a87605 Mon Sep 17 00:00:00 2001
+From 0f47cfcb16e8e40a90a9221f9995f8cd8a915c22 Mon Sep 17 00:00:00 2001
From: Jonathan Liu <net147@gmail.com>
Date: Thu, 19 Mar 2015 15:01:29 +1100
-Subject: [PATCH 16/36] Revert "rules: remove firmware loading rules"
+Subject: [PATCH 14/19] Revert "rules: remove firmware loading rules"
This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
Userspace firmware loading support is needed for Linux < 3.7.
@@ -24,5 +24,5 @@ index 0000000..f0ae684
+
+SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
similarity index 89%
rename from meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch
rename to meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
index 642625f..f31d211 100644
--- a/meta/recipes-core/systemd/systemd/0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch
+++ b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 17/36] Revert "udev: remove userspace firmware loading
+From 4d28d9a7d8d69fb429955d770e53e7a81640da24 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:45:23 -0800
+Subject: [PATCH 15/19] Revert "udev: remove userspace firmware loading
support"
This reverts commit be2ea723b1d023b3d385d3b791ee4607cbfb20ca.
@@ -10,21 +13,21 @@ Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile.am | 12 +++
- README | 4 +-
+ README | 6 +-
TODO | 1 +
- configure.ac | 22 ++++++
+ configure.ac | 18 +++++
src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
src/udev/udev-builtin.c | 3 +
src/udev/udev.h | 6 ++
src/udev/udevd.c | 13 ++++
- 8 files changed, 213 insertions(+), 2 deletions(-)
+ 8 files changed, 210 insertions(+), 3 deletions(-)
create mode 100644 src/udev/udev-builtin-firmware.c
diff --git a/Makefile.am b/Makefile.am
-index 305099a..e774976 100644
+index 3010b01..229492a 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -3706,6 +3706,18 @@ libudev_core_la_LIBADD = \
+@@ -3791,6 +3791,18 @@ libudev_core_la_LIBADD = \
$(BLKID_LIBS) \
$(KMOD_LIBS)
@@ -44,10 +47,17 @@ index 305099a..e774976 100644
libudev_core_la_SOURCES += \
src/udev/udev-builtin-kmod.c
diff --git a/README b/README
-index ca8993c..87f3297 100644
+index 9f5bc93..f60ae11 100644
--- a/README
+++ b/README
-@@ -56,8 +56,8 @@ REQUIREMENTS:
+@@ -50,14 +50,14 @@ REQUIREMENTS:
+ CONFIG_PROC_FS
+ CONFIG_FHANDLE (libudev, mount and bind mount handling)
+
+- udev will fail to work with the legacy sysfs layout:
++ Udev will fail to work with the legacy sysfs layout:
+ CONFIG_SYSFS_DEPRECATED=n
+
Legacy hotplug slows down the system and confuses udev:
CONFIG_UEVENT_HELPER_PATH=""
@@ -59,10 +69,10 @@ index ca8993c..87f3297 100644
Some udev rules and virtualization detection relies on it:
diff --git a/TODO b/TODO
-index fac9ccf..2645582 100644
+index baaac94..1ab1691 100644
--- a/TODO
+++ b/TODO
-@@ -642,6 +642,7 @@ Features:
+@@ -658,6 +658,7 @@ Features:
* initialize the hostname from the fs label of /, if /etc/hostname does not exist?
* udev:
@@ -71,13 +81,13 @@ index fac9ccf..2645582 100644
- kill scsi_id
- add trigger --subsystem-match=usb/usb_device device
diff --git a/configure.ac b/configure.ac
-index 329861a..af85405 100644
+index dfc0bd3..1de0066 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1361,6 +1361,25 @@ AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database
+@@ -1394,6 +1394,23 @@ AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
+ AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database support])],
+ enable_hwdb=$enableval, enable_hwdb=yes)
AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
-
- # ------------------------------------------------------------------------------
+AC_ARG_WITH(firmware-path,
+ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
+ [Firmware search path (default="")]),
@@ -93,19 +103,15 @@ index 329861a..af85405 100644
+done
+IFS=$OLD_IFS
+AC_SUBST(FIRMWARE_PATH)
-+AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is availabe]) ])
++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
+AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
-+
-+# ------------------------------------------------------------------------------
+
+ # ------------------------------------------------------------------------------
have_manpages=no
- AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
- AC_PATH_PROG([XSLTPROC], [xsltproc])
-@@ -1656,6 +1675,9 @@ AC_MSG_RESULT([
+@@ -1698,6 +1715,7 @@ AC_MSG_RESULT([
SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
Build Python: ${PYTHON}
-+ Installation Python: ${PYTHON_BINARY}
-+ sphinx binary: ${SPHINX_BUILD}
+ firmware path: ${FIRMWARE_PATH}
PAM modules dir: ${with_pamlibdir}
PAM configuration dir: ${with_pamconfdir}
@@ -309,7 +315,7 @@ index 8433e8d..d32366d 100644
extern const struct udev_builtin udev_builtin_input_id;
extern const struct udev_builtin udev_builtin_keyboard;
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
-index e9dd2f4..0abc28e 100644
+index d336ee0..81e5dc5 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -125,6 +125,9 @@ struct event {
@@ -322,7 +328,7 @@ index e9dd2f4..0abc28e 100644
};
static inline struct event *node_to_event(struct udev_list_node *node) {
-@@ -614,6 +617,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
+@@ -613,6 +616,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
event->devnum = udev_device_get_devnum(dev);
event->is_block = streq("block", udev_device_get_subsystem(dev));
event->ifindex = udev_device_get_ifindex(dev);
@@ -333,7 +339,7 @@ index e9dd2f4..0abc28e 100644
log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
udev_device_get_action(dev), udev_device_get_subsystem(dev));
-@@ -699,6 +706,12 @@ static bool is_devpath_busy(Manager *manager, struct event *event) {
+@@ -698,6 +705,12 @@ static bool is_devpath_busy(Manager *manager, struct event *event) {
return true;
}
@@ -347,5 +353,5 @@ index e9dd2f4..0abc28e 100644
if (event->devpath[common] == '/') {
event->delaying_seqnum = loop_event->seqnum;
--
-2.8.3
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch b/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
deleted file mode 100644
index 6e6f344..0000000
--- a/meta/recipes-core/systemd/systemd/0015-systemd-user-avoid-using-system-auth.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Subject: [PATCH 15/36] systemd-user: avoid using system-auth
-
-In OE, we don't provide system-auth, instead, we use common-* files.
-So modify systemd-user file to use common-* files.
-
-Upstream-Status: Inappropriate [oe specific]
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
- src/login/systemd-user.m4 | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/login/systemd-user.m4 b/src/login/systemd-user.m4
-index f188a8e..862d8d7 100644
---- a/src/login/systemd-user.m4
-+++ b/src/login/systemd-user.m4
-@@ -2,11 +2,11 @@
- #
- # Used by systemd --user instances.
-
--account include system-auth
-+account include common-account
-
- m4_ifdef(`HAVE_SELINUX',
- session required pam_selinux.so close
- session required pam_selinux.so nottys open
- )m4_dnl
- session required pam_loginuid.so
--session include system-auth
-+session include common-session
---
-2.8.3
-
diff --git a/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch b/meta/recipes-core/systemd/systemd/0016-make-test-dir-configurable.patch
similarity index 77%
rename from meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch
rename to meta/recipes-core/systemd/systemd/0016-make-test-dir-configurable.patch
index 5d13e4a..10d1df5 100644
--- a/meta/recipes-core/systemd/systemd/0018-make-test-dir-configurable.patch
+++ b/meta/recipes-core/systemd/systemd/0016-make-test-dir-configurable.patch
@@ -1,4 +1,7 @@
-Subject: [PATCH 18/36] make test dir configurable
+From 218bbc555a37f9373fbb7f03c744eb65109d3470 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:47:37 -0800
+Subject: [PATCH 16/19] make test dir configurable
Upstream-Status: Pending
@@ -6,17 +9,17 @@ test maybe be run on target in cross-compile environment, and test dir
is not the compilation dir, so make it configurable
Signed-off-by: Roy Li <rongqing.li@windriver.com>
-
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile.am | 2 +-
configure.ac | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
-index a94636a..dbd3386 100644
+index 229492a..e997d82 100644
--- a/Makefile.am
+++ b/Makefile.am
-@@ -207,7 +207,7 @@ AM_CPPFLAGS = \
+@@ -214,7 +214,7 @@ AM_CPPFLAGS = \
-DROOTLIBDIR=\"$(rootlibdir)\" \
-DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
-DROOTHOMEDIR=\"$(roothomedir)\" \
@@ -26,10 +29,10 @@ index a94636a..dbd3386 100644
-I $(top_builddir)/src/basic \
-I $(top_srcdir)/src/basic \
diff --git a/configure.ac b/configure.ac
-index 45aae8a..c53fae2 100644
+index 1de0066..b12e320 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1518,6 +1518,11 @@ AC_ARG_WITH([roothomedir],
+@@ -1535,6 +1535,11 @@ AC_ARG_WITH([roothomedir],
[],
[with_roothomedir=/root])
@@ -41,7 +44,7 @@ index 45aae8a..c53fae2 100644
AC_ARG_WITH([pamlibdir],
AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
[],
-@@ -1603,6 +1608,7 @@ AC_SUBST([pamconfdir], [$with_pamconfdir])
+@@ -1621,6 +1626,7 @@ AC_SUBST([pamconfdir], [$with_pamconfdir])
AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
AC_SUBST([roothomedir], [$with_roothomedir])
@@ -49,7 +52,7 @@ index 45aae8a..c53fae2 100644
AC_CONFIG_FILES([
Makefile
-@@ -1695,6 +1701,7 @@ AC_MSG_RESULT([
+@@ -1712,6 +1718,7 @@ AC_MSG_RESULT([
lib dir: ${libdir}
rootlib dir: ${with_rootlibdir}
root home dir: ${with_roothomedir}
@@ -58,5 +61,5 @@ index 45aae8a..c53fae2 100644
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
Build Python: ${PYTHON}
--
-2.8.3
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch b/meta/recipes-core/systemd/systemd/0017-remove-duplicate-include-uchar.h.patch
similarity index 81%
rename from meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch
rename to meta/recipes-core/systemd/systemd/0017-remove-duplicate-include-uchar.h.patch
index 17592f8..77dbd6e 100644
--- a/meta/recipes-core/systemd/systemd/0019-remove-duplicate-include-uchar.h.patch
+++ b/meta/recipes-core/systemd/systemd/0017-remove-duplicate-include-uchar.h.patch
@@ -1,14 +1,12 @@
-From 3ca534935460647fed66e31aaa90b364e29eab5c Mon Sep 17 00:00:00 2001
+From e78af874fc9f3d3af49498b8207109993d93a596 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 22 Feb 2016 05:59:01 +0000
-Subject: [PATCH 1/2] remove duplicate include uchar.h
+Subject: [PATCH 17/19] remove duplicate include uchar.h
missing.h already includes it
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
-Upstream-Status: Pending
-
src/basic/escape.h | 1 -
src/basic/utf8.h | 1 -
2 files changed, 2 deletions(-)
@@ -26,7 +24,7 @@ index deaa4de..36d437c 100644
#include "string-util.h"
#include "missing.h"
diff --git a/src/basic/utf8.h b/src/basic/utf8.h
-index 12c272d..bea93a6 100644
+index f9b9c94..6ac9a3c 100644
--- a/src/basic/utf8.h
+++ b/src/basic/utf8.h
@@ -22,7 +22,6 @@
@@ -38,5 +36,5 @@ index 12c272d..bea93a6 100644
#include "macro.h"
#include "missing.h"
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch b/meta/recipes-core/systemd/systemd/0018-check-for-uchar.h-in-configure.patch
similarity index 76%
rename from meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch
rename to meta/recipes-core/systemd/systemd/0018-check-for-uchar.h-in-configure.patch
index a027fad..5824033 100644
--- a/meta/recipes-core/systemd/systemd/0020-check-for-uchar.h-in-configure.patch
+++ b/meta/recipes-core/systemd/systemd/0018-check-for-uchar.h-in-configure.patch
@@ -1,23 +1,21 @@
-From e06eec89a22719c38e257fe07afff18e359114cb Mon Sep 17 00:00:00 2001
+From 7cc0b19d244023c7b3e557765b03b7971e047f29 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 22 Feb 2016 06:02:38 +0000
-Subject: [PATCH 2/2] check for uchar.h in configure
+Subject: [PATCH 18/19] check for uchar.h in configure
Use ifdef to include uchar.h
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
-Upstream-Status: Pending
-
configure.ac | 1 +
src/basic/missing.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/configure.ac b/configure.ac
-index ecc3e6b..62f934e 100644
+index b12e320..4e6dfdf 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -297,6 +297,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
+@@ -298,6 +298,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
# ------------------------------------------------------------------------------
@@ -26,10 +24,10 @@ index ecc3e6b..62f934e 100644
AC_CHECK_HEADERS([linux/btrfs.h], [], [])
AC_CHECK_HEADERS([linux/memfd.h], [], [])
diff --git a/src/basic/missing.h b/src/basic/missing.h
-index f704422..a1baa95 100644
+index 4936873..ce79404 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
-@@ -34,7 +34,9 @@
+@@ -35,7 +35,9 @@
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/syscall.h>
@@ -40,5 +38,5 @@ index f704422..a1baa95 100644
#ifdef HAVE_AUDIT
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch b/meta/recipes-core/systemd/systemd/0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
similarity index 69%
rename from meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
rename to meta/recipes-core/systemd/systemd/0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
index 96fc3d8..66aa4ca 100644
--- a/meta/recipes-core/systemd/systemd/0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
+++ b/meta/recipes-core/systemd/systemd/0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
@@ -1,23 +1,23 @@
-From 71e710a6c8a3879af7d50c4cb995e0615deba5c3 Mon Sep 17 00:00:00 2001
-From: Emil Renner Berthing <systemd@esmil.dk>
-Date: Sat, 12 Sep 2015 19:56:52 +0000
-Subject: [PATCH 29/38] socket-util: don't fail if libc doesn't support IDN
+From 289554d87e4fd96cae08c0fb449bf41d5641cd24 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 20:49:53 -0800
+Subject: [PATCH 19/19] socket-util: don't fail if libc doesn't support IDN
+
+Upstream-Status: Pending
Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
-Upstream-Status: Pending
-
src/basic/socket-util.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
-index 5851268..aefaca5 100644
+index 4ebf106..53b9a12 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
-@@ -44,6 +44,15 @@
- #include "string-util.h"
+@@ -47,6 +47,15 @@
#include "user-util.h"
+ #include "utf8.h"
#include "util.h"
+/* Don't fail if the standard library
+ * doesn't support IDN */
@@ -32,5 +32,5 @@ index 5851268..aefaca5 100644
int socket_address_parse(SocketAddress *a, const char *s) {
char *e, *n;
--
-1.8.3.1
+2.10.2
diff --git a/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch b/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
deleted file mode 100644
index 5797a29..0000000
--- a/meta/recipes-core/systemd/systemd/0021-include-missing.h-for-getting-secure_getenv-definiti.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 6cedbaee7964f6a6c61b9f2c8f0b87cef9370424 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 15 Dec 2015 22:51:55 +0000
-Subject: [PATCH 26/38] include missing.h for getting secure_getenv definition
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- src/basic/user-util.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/basic/user-util.c b/src/basic/user-util.c
-index 55672b3..22c4a23 100644
---- a/src/basic/user-util.c
-+++ b/src/basic/user-util.c
-@@ -38,6 +38,7 @@
- #include "path-util.h"
- #include "string-util.h"
- #include "user-util.h"
-+#include "missing.h"
-
- bool uid_is_valid(uid_t uid) {
-
---
-1.8.3.1
-
diff --git a/meta/recipes-core/systemd/systemd/CVE-2016-7795.patch b/meta/recipes-core/systemd/systemd/CVE-2016-7795.patch
deleted file mode 100644
index 5ecb9c3..0000000
--- a/meta/recipes-core/systemd/systemd/CVE-2016-7795.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Subject: Fix CVE-2016-7795
-
-This undoes 531ac2b. I acked that patch without looking at the code
-carefully enough. There are two problems:
-- we want to process the fds anyway
-- in principle empty notification messages are valid, and we should
- process them as usual, including logging using log_unit_debug().
-
-Upstream-Status: Backport
-CVE: CVE-2016-7795
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- src/core/manager.c | 11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/src/core/manager.c b/src/core/manager.c
-index 7838f56..f165d08e 100644
---- a/src/core/manager.c
-+++ b/src/core/manager.c
-@@ -1589,13 +1589,12 @@ static int manager_dispatch_cgroups_agent_fd(sd_event_source *source, int fd, ui
- return 0;
- }
-
--static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const char *buf, size_t n, FDSet *fds) {
-+static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const char *buf, FDSet *fds) {
- _cleanup_strv_free_ char **tags = NULL;
-
- assert(m);
- assert(u);
- assert(buf);
-- assert(n > 0);
-
- tags = strv_split(buf, "\n\r");
- if (!tags) {
-@@ -1688,25 +1687,27 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
- return 0;
- }
-
-+ /* The message should be a string. Here we make sure it's NUL-terminated,
-+ * but only the part until first NUL will be used anyway. */
- buf[n] = 0;
-
- /* Notify every unit that might be interested, but try
- * to avoid notifying the same one multiple times. */
- u1 = manager_get_unit_by_pid_cgroup(m, ucred->pid);
- if (u1) {
-- manager_invoke_notify_message(m, u1, ucred->pid, buf, n, fds);
-+ manager_invoke_notify_message(m, u1, ucred->pid, buf, fds);
- found = true;
- }
-
- u2 = hashmap_get(m->watch_pids1, PID_TO_PTR(ucred->pid));
- if (u2 && u2 != u1) {
-- manager_invoke_notify_message(m, u2, ucred->pid, buf, n, fds);
-+ manager_invoke_notify_message(m, u2, ucred->pid, buf, fds);
- found = true;
- }
-
- u3 = hashmap_get(m->watch_pids2, PID_TO_PTR(ucred->pid));
- if (u3 && u3 != u2 && u3 != u1) {
-- manager_invoke_notify_message(m, u3, ucred->pid, buf, n, fds);
-+ manager_invoke_notify_message(m, u3, ucred->pid, buf, fds);
- found = true;
- }
-
---
-2.8.3
-
diff --git a/meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch b/meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch
deleted file mode 100644
index 23e22d4..0000000
--- a/meta/recipes-core/systemd/systemd/udev-re-enable-mount-propagation-for-udevd.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Michael Biebl <biebl@debian.org>
-Date: Sat, 27 Sep 2014 04:19:24 +0200
-Subject: udev: re-enable mount propagation for udevd
-
-Upstream-Status: Backport [http://http.debian.net/debian/pool/main/s/systemd/systemd_215-17+deb8u4.debian.tar.xz]
-
-laptop-mode-tools remounts file systems from within a udev rule to apply
-certain mount options. With MountFlags=slave, those mounts then become private
-to the systemd-udevd namespace and are no longer accessible from outside the
-namespace.
-While the root cause is the broken behaviour of laptop-mode-tools, with mount
-propagation turned off, this can result in a read-only root file system.
-Therefore revert the relevant parts from commit
-c2c13f2df42e0691aecabe3979ea81cd7faa35c7 to re-enable mount propagation for
-udevd.
-
-Once affected packages have been fixed, this patch should be dropped
-again.
-
-Closes: #762018
-diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
-index e7216d6..1e9a600 100644
---- a/units/systemd-udevd.service.in
-+++ b/units/systemd-udevd.service.in
-@@ -21,6 +21,5 @@ Sockets=systemd-udevd-control.socket systemd-udevd-kernel.socket
- Restart=always
- RestartSec=0
- ExecStart=@rootlibexecdir@/systemd-udevd
--MountFlags=slave
- KillMode=mixed
- WatchdogSec=1min
diff --git a/meta/recipes-core/systemd/systemd_230.bb b/meta/recipes-core/systemd/systemd_232.bb
similarity index 96%
rename from meta/recipes-core/systemd/systemd_230.bb
rename to meta/recipes-core/systemd/systemd_232.bb
index f60dd60..def6e05 100644
--- a/meta/recipes-core/systemd/systemd_230.bb
+++ b/meta/recipes-core/systemd/systemd_232.bb
@@ -25,18 +25,13 @@ SRC_URI += " \
file://0010-implment-systemd-sysv-install-for-OE.patch \
file://0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch \
file://0012-rules-whitelist-hd-devices.patch \
- file://0013-sysv-generator-add-support-for-executing-scripts-und.patch \
- file://0014-Make-root-s-home-directory-configurable.patch \
- file://0015-systemd-user-avoid-using-system-auth.patch \
- file://0016-Revert-rules-remove-firmware-loading-rules.patch \
- file://0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
- file://0018-make-test-dir-configurable.patch \
- file://0019-remove-duplicate-include-uchar.h.patch \
- file://0020-check-for-uchar.h-in-configure.patch \
- file://0021-include-missing.h-for-getting-secure_getenv-definiti.patch \
- file://0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
- file://udev-re-enable-mount-propagation-for-udevd.patch \
- file://CVE-2016-7795.patch \
+ file://0013-Make-root-s-home-directory-configurable.patch \
+ file://0014-Revert-rules-remove-firmware-loading-rules.patch \
+ file://0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+ file://0016-make-test-dir-configurable.patch \
+ file://0017-remove-duplicate-include-uchar.h.patch \
+ file://0018-check-for-uchar.h-in-configure.patch \
+ file://0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
"
SRC_URI_append_libc-uclibc = "\
file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
@@ -61,7 +56,6 @@ PACKAGECONFIG ??= "xz \
timedated \
timesyncd \
localed \
- kdbus \
ima \
smack \
logind \
@@ -96,7 +90,6 @@ PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated"
PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd"
PACKAGECONFIG[localed] = "--enable-localed,--disable-localed"
PACKAGECONFIG[efi] = "--enable-efi,--disable-efi"
-PACKAGECONFIG[kdbus] = "--enable-kdbus,--disable-kdbus"
PACKAGECONFIG[ima] = "--enable-ima,--disable-ima"
PACKAGECONFIG[smack] = "--enable-smack,--disable-smack"
# libseccomp is found in meta-security
@@ -282,7 +275,7 @@ python populate_packages_prepend (){
systemdlibdir = d.getVar("rootlibdir", True)
do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
}
-PACKAGES_DYNAMIC += "^lib(udev|systemd).*"
+PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
PACKAGES =+ "\
${PN}-gui \
@@ -491,6 +484,7 @@ RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-genera
os-release \
"
+INSANE_SKIP_${PN} += "dev-so"
INSANE_SKIP_${PN}-doc += " libdir"
PACKAGES =+ "udev udev-hwdb"
--
2.10.2
^ permalink raw reply related
* [PATCH 1/2] arch-arm64.inc: Include arch-armv7ve.inc
From: Khem Raj @ 2016-11-23 9:28 UTC (permalink / raw)
To: openembedded-core
All armv8 implementations from a53 - a73 supports
virtual extentions
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/conf/machine/include/arm/arch-arm64.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/conf/machine/include/arm/arch-arm64.inc b/meta/conf/machine/include/arm/arch-arm64.inc
index 9440698..9eeffac 100644
--- a/meta/conf/machine/include/arm/arch-arm64.inc
+++ b/meta/conf/machine/include/arm/arch-arm64.inc
@@ -1,6 +1,6 @@
DEFAULTTUNE ?= "aarch64"
-require conf/machine/include/arm/arch-armv7a.inc
+require conf/machine/include/arm/arch-armv7ve.inc
TUNEVALID[aarch64] = "Enable instructions for aarch64"
--
2.10.2
^ permalink raw reply related
* Re: Contents of non-rootfs partitions
From: Maciej Borzęcki @ 2016-11-23 9:24 UTC (permalink / raw)
To: Enrico Joerns
Cc: Eduard Bartosh, Patches and discussions about the oe-core layer
In-Reply-To: <776827b7-ca3e-e319-c2f0-b8b15bef4fb2@pengutronix.de>
On Wed, Nov 23, 2016 at 9:40 AM, Enrico Joerns <ejo@pengutronix.de> wrote:
> On 11/22/2016 12:54 PM, Kristian Amlie wrote:
>>
>> On 22/11/16 12:10, Patrick Ohly wrote:
>>>>
>>>> ...
>>>
>>>
>>> All of these introduce some special mechanism. Let me propose something
>>> that might integrate better with the existing tooling:
>>>
>>> The "rootfs" directory gets redefined as representing the entire virtual
>>> file system. When creating a disk image, it gets split up into different
>>> partitions based on the image configuration.
>>>
>>> For example, the /home or /data directories in the rootfs could hold the
>>> content that in some image configurations goes into separate partitions.
>>>
>>> The advantage of this approach is that the tooling for staging content
>>> for image creation does not need to be changed. The same staged content
>>> then can be used to create different images, potentially even using
>>> different partition layouts.
>>
>>
>> That's a very good idea. I think it beats all of my suggestions!
>
>
> I totally agree with this solution, because it is the same approach we are
> already using for several years.
>
> Instead of wic we are using the genimage tool
> (http://public.pengutronix.de/software/genimage/) together with a Yocto
> class for easing image creation, but its pretty much the same concerning its
> base purpose.
>
> We called the option to split up 'mountpoint' while assuming that the
> splitted partition will be mounted to the same location in the file system
> it was taken from.
>
> An example configuration would look like this (stripped down to the
> essential parts):
>
> image my-disk-image {
> [...]
> partition root {
> image = "rootfs.ext4"
> [...]
> }
>
> partition home {
> image = "home.ext4"
> [...]
> }
> }
>
> image rootfs.ext4 {
> [...]
> mountpoint = "/"
> }
>
> image home.ext4 {
> [...]
> mountpoint = "/home"
> }
>
> Maybe a similar approach could be used in wic, too.
I went through the README from genimage repo
https://git.pengutronix.de/cgit/genimage/tree/README. Definitely looks
interesting and covers storage medias that are not supported by wic
right now. The split option does not seem to be documented though. If I
understood you correctly, the partition is seeded with data from
location specified by `mountpoint` inside IMAGE_ROOTFS. Is that correct?
I see there's a large overlap in functionality with wic (at least for
block devices), so perhaps the best way would be introduce genimage as
another IMAGE_CMD.
I've quickly checked at https://layers.openembedded.org and there are no
recipes for genimage/libconfuse listed there. Do happen to have done
integration with OE in some private repo already? Would it be possible
for you to post the relevant patches?
--
Maciej Borzecki
RnDity
^ permalink raw reply
* Re: Contents of non-rootfs partitions
From: Kristian Amlie @ 2016-11-23 9:04 UTC (permalink / raw)
To: Enrico Joerns, Patrick Ohly, Eduard Bartosh; +Cc: openembedded-core
In-Reply-To: <776827b7-ca3e-e319-c2f0-b8b15bef4fb2@pengutronix.de>
On 23/11/16 09:40, Enrico Joerns wrote:
> On 11/22/2016 12:54 PM, Kristian Amlie wrote:
>> On 22/11/16 12:10, Patrick Ohly wrote:
>>>> ...
>>>
>>> All of these introduce some special mechanism. Let me propose something
>>> that might integrate better with the existing tooling:
>>>
>>> The "rootfs" directory gets redefined as representing the entire virtual
>>> file system. When creating a disk image, it gets split up into different
>>> partitions based on the image configuration.
>>>
>>> For example, the /home or /data directories in the rootfs could hold the
>>> content that in some image configurations goes into separate partitions.
>>>
>>> The advantage of this approach is that the tooling for staging content
>>> for image creation does not need to be changed. The same staged content
>>> then can be used to create different images, potentially even using
>>> different partition layouts.
>>
>> That's a very good idea. I think it beats all of my suggestions!
>
> I totally agree with this solution, because it is the same approach we
> are already using for several years.
Good! Sounds like there are several votes in favor of this proposal then.
> Instead of wic we are using the genimage tool
> (http://public.pengutronix.de/software/genimage/) together with a Yocto
> class for easing image creation, but its pretty much the same concerning
> its base purpose.
>
> We called the option to split up 'mountpoint' while assuming that the
> splitted partition will be mounted to the same location in the file
> system it was taken from.
>
> An example configuration would look like this (stripped down to the
> essential parts):
>
> image my-disk-image {
> [...]
> partition root {
> image = "rootfs.ext4"
> [...]
> }
>
> partition home {
> image = "home.ext4"
> [...]
> }
> }
>
> image rootfs.ext4 {
> [...]
> mountpoint = "/"
> }
>
> image home.ext4 {
> [...]
> mountpoint = "/home"
> }
>
> Maybe a similar approach could be used in wic, too.
Yes, this looks very similar "in spirit" to what I'm thinking of right now.
--
Kristian
^ permalink raw reply
* Re: Contents of non-rootfs partitions
From: Kristian Amlie @ 2016-11-23 9:01 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
In-Reply-To: <FDD8C344-D3E7-45B6-A463-2E4803B95572@gmail.com>
On 23/11/16 08:26, Khem Raj wrote:
>
>> On Nov 22, 2016, at 11:13 PM, Kristian Amlie <kristian.amlie@mender.io> wrote:
>>
>> On 23/11/16 00:45, Khem Raj wrote:
>>> Firstly, it needs to be defined what the data partition is about.
>>> 1. is it some pre-initialized/seeded data that can then be modified during
>>> subsequent boots ?
>>> 2. Is it read-only data which is then used to populate r/w data segments in
>>> RAM during boot
>>> 3. is it data that does not change over the course of install and reboots of
>>> the device
>>
>> It's preseeded, but modifiable data, that survives complete rootfs
>> updates. IOW if you overwrite either of your A/B rootfs partitions, the
>> data partition and its content survives.
>
> at some point this data segment will be seeded.
> think of factory case.
The creation of the initial partitioned image for the memory card
preseeds the data partition. This is meant to be used in initial factory
flashing (by which I mean literally "at the factory", not the factory
reset button). Subsequent rootfs updates would not touch the data partition.
> So in such a case updates should not touch them unless user does a factory reset
> which should clean it up
Factory reset is not covered in my suggestion. While also important, I
consider this a separate feature, which would require cooperation by the
running OS. I hope it's acceptable to keep this out of the first patchset?
--
Kristian
^ permalink raw reply
* Re: Contents of non-rootfs partitions
From: Enrico Joerns @ 2016-11-23 8:40 UTC (permalink / raw)
To: Kristian Amlie, Patrick Ohly, Eduard Bartosh; +Cc: openembedded-core
In-Reply-To: <6913e4bf-96dc-eefa-d214-9df5cde181b8@mender.io>
On 11/22/2016 12:54 PM, Kristian Amlie wrote:
> On 22/11/16 12:10, Patrick Ohly wrote:
>>> ...
>>
>> All of these introduce some special mechanism. Let me propose something
>> that might integrate better with the existing tooling:
>>
>> The "rootfs" directory gets redefined as representing the entire virtual
>> file system. When creating a disk image, it gets split up into different
>> partitions based on the image configuration.
>>
>> For example, the /home or /data directories in the rootfs could hold the
>> content that in some image configurations goes into separate partitions.
>>
>> The advantage of this approach is that the tooling for staging content
>> for image creation does not need to be changed. The same staged content
>> then can be used to create different images, potentially even using
>> different partition layouts.
>
> That's a very good idea. I think it beats all of my suggestions!
I totally agree with this solution, because it is the same approach we
are already using for several years.
Instead of wic we are using the genimage tool
(http://public.pengutronix.de/software/genimage/) together with a Yocto
class for easing image creation, but its pretty much the same concerning
its base purpose.
We called the option to split up 'mountpoint' while assuming that the
splitted partition will be mounted to the same location in the file
system it was taken from.
An example configuration would look like this (stripped down to the
essential parts):
image my-disk-image {
[...]
partition root {
image = "rootfs.ext4"
[...]
}
partition home {
image = "home.ext4"
[...]
}
}
image rootfs.ext4 {
[...]
mountpoint = "/"
}
image home.ext4 {
[...]
mountpoint = "/home"
}
Maybe a similar approach could be used in wic, too.
Best regards, Enrico
--
Pengutronix e.K. | Enrico Jörns |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH] module.bbclass: allow to override location of Module.symvers
From: André Draszik @ 2016-11-23 8:01 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: openembedded-core
In-Reply-To: <20161122223342.GC31090@denix.org>
On Tue, 2016-11-22 at 17:33 -0500, Denys Dmytriyenko wrote:
> On Mon, Nov 21, 2016 at 09:37:13AM +0000, André Draszik wrote:
> > + install -Dm0644
> > "${B}/${MODULES_MODULE_SYMVERS_LOCATION}"/Module.symvers
> > ${D}${includedir}/${BPN}/Module.symvers
>
> BTW, is "-Dm0644" portable?
Not sure, I would expect busybox' install to support it. OTOH, FreeBSD
install seems to have completely different parameters, in particular -D has
different semantics.
Cheers,
Andre'
^ permalink raw reply
* [PATCH 2/2] base-passwd: set root's default password to 'root'
From: Robert Yang @ 2016-11-23 7:49 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1479871728.git.liezhi.yang@windriver.com>
[YOCTO #10710]
Otherwise, we can't login as root when debug-tweaks is not in
IMAGE_FEATURES, and there is no other users to login by default, so
there is no way to login.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
.../base-passwd/base-passwd/passwd_master.patch | 16 ++++++++++++++++
meta/recipes-core/base-passwd/base-passwd_3.5.29.bb | 1 +
2 files changed, 17 insertions(+)
create mode 100644 meta/recipes-core/base-passwd/base-passwd/passwd_master.patch
diff --git a/meta/recipes-core/base-passwd/base-passwd/passwd_master.patch b/meta/recipes-core/base-passwd/base-passwd/passwd_master.patch
new file mode 100644
index 0000000..909c2a4
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/passwd_master.patch
@@ -0,0 +1,16 @@
+Set root's default password to 'root'
+
+Upstream-Status: Inappropriate [OE config specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/passwd.master b/passwd.master
+index 82df9e5..c29e76d 100644
+--- a/passwd.master
++++ b/passwd.master
+@@ -1,4 +1,4 @@
+-root::0:0:root:/root:/bin/sh
++root:6UZSjeWUui3JQ:0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
index 10457b2..a3477a1 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -12,6 +12,7 @@ SRC_URI = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar
file://noshadow.patch \
file://input.patch \
file://disable-docs.patch \
+ file://passwd_master.patch \
"
SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421"
--
2.10.2
^ permalink raw reply related
* [PATCH 1/2] rootfs-postcommands.bbclass: fix zap_empty_root_password
From: Robert Yang @ 2016-11-23 7:49 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1479871728.git.liezhi.yang@windriver.com>
[YOCTO #10710]
The previous logic works when root passwd is blank, but it doesn't work
when there is a root passws, for example:
1) Set a root passwd in base-passwd
2) IMAGE_FEATURES += "debug-tweaks"
Start the target, it still requires passwd to login.
Empty passwd if debug-tweaks is in IMAGE_FEATURES, else do nothing can
fix problem.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
meta/classes/rootfs-postcommands.bbclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 0c7ceea..353dc4f 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -1,6 +1,6 @@
# Zap the root password if debug-tweaks feature is not enabled
-ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'empty-root-password' ], "", "zap_empty_root_password ; ",d)}'
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'empty-root-password' ], "empty_root_password ; ", "",d)}'
# Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled
ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-empty-password' ], "ssh_allow_empty_password; ", "",d)}'
@@ -105,12 +105,12 @@ read_only_rootfs_hook () {
#
# This function is intended to disallow empty root password if 'debug-tweaks' is not in IMAGE_FEATURES.
#
-zap_empty_root_password () {
+empty_root_password () {
if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then
- sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow
+ sed -i 's%^root:[^:]*:%root::%' ${IMAGE_ROOTFS}/etc/shadow
fi
if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then
- sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd
+ sed -i 's%^root:[^:]*:%root::%' ${IMAGE_ROOTFS}/etc/passwd
fi
}
--
2.10.2
^ permalink raw reply related
* [PATCH 0/2] fix can't login when debug-tweaks is not in IMAGE_FEATURES
From: Robert Yang @ 2016-11-23 7:49 UTC (permalink / raw)
To: openembedded-core
Fixed 2 bugs:
- Can't login as root when debug-tweaks/empty-root-password is not in
IMAGE_FEATURES since no passwd.
- When set root passwd and debug-tweaks/empty-root-password is in
IMAGE_FEATURES, passwd is *required* to login.
Filed https://bugzilla.yoctoproject.org/show_bug.cgi?id=10710, and
marked doc changes required as yes.
// Robert
The following changes since commit a675b2c89e477af088faee9b3be96eae19a85f0b:
sanity.bbclass: fix logging of an error (2016-11-15 15:18:50 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/root
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/root
Robert Yang (2):
rootfs-postcommands.bbclass: fix zap_empty_root_password
base-passwd: set root's default password to 'root'
meta/classes/rootfs-postcommands.bbclass | 8 ++++----
.../base-passwd/base-passwd/passwd_master.patch | 16 ++++++++++++++++
meta/recipes-core/base-passwd/base-passwd_3.5.29.bb | 1 +
3 files changed, 21 insertions(+), 4 deletions(-)
create mode 100644 meta/recipes-core/base-passwd/base-passwd/passwd_master.patch
--
2.10.2
^ permalink raw reply
* [PATCH v4 7/7] wic: selftest: add tests for --fixed-size partition flags
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479887010.git.maciej.borzecki@rndity.com>
wic has a new flag for setting a fixed parition size --fixed-size. Add
tests that verify if partition is indeed sized properly and that errors
are signaled when there is not enough space to fit partition data.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 69 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index ad783043b92130a023fd70120becec479c6253a7..45f68df1e74828e11401f57dd732a88a50dd1f00 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -29,6 +29,7 @@ import unittest
from glob import glob
from shutil import rmtree
from functools import wraps
+from tempfile import NamedTemporaryFile
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
@@ -61,6 +62,8 @@ class Wic(oeSelfTest):
def setUpLocal(self):
"""This code is executed before each test method."""
+ self.native_sysroot = get_bb_var('STAGING_DIR_NATIVE', 'core-image-minimal')
+
arch = get_bb_var('HOST_ARCH', 'core-image-minimal')
is_x86 = arch in ['i586', 'i686', 'x86_64']
if is_x86:
@@ -378,3 +381,69 @@ class Wic(oeSelfTest):
self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
% wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+ def _make_fixed_size_wks(self, size):
+ """
+ Create a wks of an image with a single partition. Size of the partition is set
+ using --fixed-size flag. Returns a tuple: (path to wks file, wks image name)
+ """
+ with NamedTemporaryFile("w", suffix=".wks", delete=False) as tf:
+ wkspath = tf.name
+ tf.write("part " \
+ "--source rootfs --ondisk hda --align 4 --fixed-size %d "
+ "--fstype=ext4\n" % size)
+ wksname = os.path.splitext(os.path.basename(wkspath))[0]
+
+ return (wkspath, wksname)
+
+ def test_fixed_size(self):
+ """
+ Test creation of a simple image with partition size controlled through
+ --fixed-size flag
+ """
+ wkspath, wksname = self._make_fixed_size_wks(200)
+
+ wic_cmd_vars = {
+ 'wks': wkspath,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
+ os.remove(wkspath)
+ wicout = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(1, len(wicout))
+
+ wicimg = wicout[0]
+
+ # verify partition size with wic
+ res = runCmd("parted -m %s unit mib p 2>/dev/null" % wicimg,
+ ignore_status=True,
+ native_sysroot=self.native_sysroot)
+ self.assertEqual(0, res.status)
+
+ # parse parted output which looks like this:
+ # BYT;\n
+ # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+ # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+ partlns = res.output.splitlines()[2:]
+
+ self.assertEqual(1, len(partlns))
+ self.assertEqual("1:0.00MiB:200MiB:200MiB:ext4::;", partlns[0])
+
+ def test_fixed_size_error(self):
+ """
+ Test creation of a simple image with partition size controlled through
+ --fixed-size flag. The size of partition is intentionally set to 1MiB
+ in order to trigger an error in wic.
+ """
+ wkspath, wksname = self._make_fixed_size_wks(1)
+
+ wic_cmd_vars = {
+ 'wks': wkspath,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(1, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars, ignore_status=True).status)
+ os.remove(wkspath)
+ wicout = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(0, len(wicout))
--
2.5.0
^ permalink raw reply related
* [PATCH v4 6/7] wic: selftest: do not assume bzImage kernel image
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479887010.git.maciej.borzecki@rndity.com>
Instead of assuming that bzImage is available, query bitbake enviroment
for KERNEL_IMAGETYPE.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index 37ed2c6de5a7f22f982f921476fa392304995b2e..ad783043b92130a023fd70120becec479c6253a7 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -369,7 +369,8 @@ class Wic(oeSelfTest):
def test_sdimage_bootpart(self):
"""Test creation of sdimage-bootpart image"""
image = "sdimage-bootpart"
- self.write_config('IMAGE_BOOT_FILES = "bzImage"\n')
+ kimgtype = get_bb_var('KERNEL_IMAGETYPE', self.OE_IMAGE)
+ self.write_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
wic_cmd_vars = {
'wks': image,
'image': self.OE_IMAGE,
--
2.5.0
^ permalink raw reply related
* [PATCH v4 5/7] wic: selftest: do not repeat core-image-minimal
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479887010.git.maciej.borzecki@rndity.com>
Replace repeated core-image-minimal with Wic class field.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 111 +++++++++++++++++++++++++++---------------
1 file changed, 73 insertions(+), 38 deletions(-)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index 2db14445956bc5adcf1e755844bbdb69edcb468f..37ed2c6de5a7f22f982f921476fa392304995b2e 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -57,6 +57,8 @@ class Wic(oeSelfTest):
resultdir = "/var/tmp/wic/build/"
image_is_ready = False
+ OE_IMAGE = "core-image-minimal"
+
def setUpLocal(self):
"""This code is executed before each test method."""
arch = get_bb_var('HOST_ARCH', 'core-image-minimal')
@@ -75,7 +77,7 @@ class Wic(oeSelfTest):
tools += ' syslinux syslinux-native'
bitbake(tools)
- bitbake('core-image-minimal')
+ bitbake(self.OE_IMAGE)
Wic.image_is_ready = True
rmtree(self.resultdir, ignore_errors=True)
@@ -100,14 +102,14 @@ class Wic(oeSelfTest):
def test_build_image_name(self):
"""Test wic create directdisk --image-name core-image-minimal"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal").status)
+ "--image-name %s" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1212)
@onlyForArch('i586', 'i686', 'x86_64')
def test_build_artifacts(self):
"""Test wic create directdisk providing all artifacts."""
- bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+ bbvars = dict((var.lower(), get_bb_var(var, self.OE_IMAGE)) \
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
status = runCmd("wic create directdisk "
@@ -123,7 +125,7 @@ class Wic(oeSelfTest):
def test_gpt_image(self):
"""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)
+ "--image-name %s" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1213)
@@ -157,8 +159,8 @@ class Wic(oeSelfTest):
def test_compress_gzip(self):
"""Test compressing an image with gzip"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c gzip").status)
+ "--image-name %s "
+ "-c gzip" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + \
"directdisk-*.direct.gz")))
@@ -167,8 +169,8 @@ class Wic(oeSelfTest):
def test_compress_bzip2(self):
"""Test compressing an image with bzip2"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c bzip2").status)
+ "--image-name %s "
+ "-c bzip2" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + \
"directdisk-*.direct.bz2")))
@@ -177,8 +179,8 @@ class Wic(oeSelfTest):
def test_compress_xz(self):
"""Test compressing an image with xz"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c xz").status)
+ "--image-name %s "
+ "-c xz" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + \
"directdisk-*.direct.xz")))
@@ -187,26 +189,31 @@ class Wic(oeSelfTest):
def test_wrong_compressor(self):
"""Test how wic breaks if wrong compressor is provided"""
self.assertEqual(2, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c wrong", ignore_status=True).status)
+ "--image-name %s "
+ "-c wrong" % self.OE_IMAGE,
+ ignore_status=True).status)
@testcase(1268)
@onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_indirect_recipes(self):
"""Test usage of rootfs plugin with rootfs recipes"""
wks = "directdisk-multi-rootfs"
- self.assertEqual(0, runCmd("wic create %s "
- "--image-name core-image-minimal "
- "--rootfs rootfs1=core-image-minimal "
- "--rootfs rootfs2=core-image-minimal" \
- % wks).status)
+ wic_cmd_vars = {
+ 'wks': wks,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s "
+ "--image-name %(image)s "
+ "--rootfs rootfs1=%(image)s "
+ "--rootfs rootfs2=%(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
@testcase(1269)
@onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_artifacts(self):
"""Test usage of rootfs plugin with rootfs paths"""
- bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+ bbvars = dict((var.lower(), get_bb_var(var, self.OE_IMAGE)) \
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
bbvars['wks'] = "directdisk-multi-rootfs"
@@ -226,24 +233,23 @@ class Wic(oeSelfTest):
def test_iso_image(self):
"""Test creation of hybrid iso image with legacy and EFI boot"""
self.assertEqual(0, runCmd("wic create mkhybridiso "
- "--image-name core-image-minimal").status)
+ "--image-name %s" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
@testcase(1347)
def test_image_env(self):
"""Test generation of <image>.env files."""
- image = 'core-image-minimal'
- self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
- stdir = get_bb_var('STAGING_DIR_TARGET', image)
+ self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % self.OE_IMAGE).status)
+ stdir = get_bb_var('STAGING_DIR_TARGET', self.OE_IMAGE)
imgdatadir = os.path.join(stdir, 'imgdata')
- basename = get_bb_var('IMAGE_BASENAME', image)
- self.assertEqual(basename, image)
+ basename = get_bb_var('IMAGE_BASENAME', self.OE_IMAGE)
+ self.assertEqual(basename, self.OE_IMAGE)
path = os.path.join(imgdatadir, basename) + '.env'
self.assertTrue(os.path.isfile(path))
- wicvars = set(get_bb_var('WICVARS', image).split())
+ wicvars = set(get_bb_var('WICVARS', self.OE_IMAGE).split())
# filter out optional variables
wicvars = wicvars.difference(('HDDDIR', 'IMAGE_BOOT_FILES',
'INITRD', 'ISODIR'))
@@ -275,8 +281,12 @@ class Wic(oeSelfTest):
def test_qemux86_directdisk(self):
"""Test creation of qemux-86-directdisk image"""
image = "qemux86-directdisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1349)
@@ -284,8 +294,12 @@ class Wic(oeSelfTest):
def test_mkgummidisk(self):
"""Test creation of mkgummidisk image"""
image = "mkgummidisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1350)
@@ -293,8 +307,12 @@ class Wic(oeSelfTest):
def test_mkefidisk(self):
"""Test creation of mkefidisk image"""
image = "mkefidisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1385)
@@ -302,8 +320,12 @@ class Wic(oeSelfTest):
def test_directdisk_bootloader_config(self):
"""Test creation of directdisk-bootloader-config image"""
image = "directdisk-bootloader-config"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1422)
@@ -322,7 +344,12 @@ class Wic(oeSelfTest):
def test_bmap(self):
"""Test generation of .bmap file"""
image = "directdisk"
- status = runCmd("wic create %s -e core-image-minimal --bmap" % image).status
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ status = runCmd("wic create %(wks)s -e %(image)s --bmap" \
+ % wic_cmd_vars).status
self.assertEqual(0, status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct.bmap" % image)))
@@ -331,14 +358,22 @@ class Wic(oeSelfTest):
def test_systemd_bootdisk(self):
"""Test creation of systemd-bootdisk image"""
image = "systemd-bootdisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
def test_sdimage_bootpart(self):
"""Test creation of sdimage-bootpart image"""
image = "sdimage-bootpart"
self.write_config('IMAGE_BOOT_FILES = "bzImage"\n')
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
--
2.5.0
^ permalink raw reply related
* [PATCH v4 4/7] wic: selftest: avoid COMPATIBLE_HOST issues
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479887010.git.maciej.borzecki@rndity.com>
wic tests will unconditionally attempt to build syslinux and add
configuration options that may not be compatible with current machine.
Resolve this by consulting HOST_ARCH (which defaults to TARGET_ARCH) and build
recipes, add configuration options or skip tests conditionally.
A convenience decorator onlyForArch() can be used to skip test cases for
specific architectures.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 51 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 47 insertions(+), 4 deletions(-)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index faac11e21643e4c32a83b649b6ae986fead498f1..2db14445956bc5adcf1e755844bbdb69edcb468f 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -24,15 +24,33 @@
"""Test cases for wic."""
import os
+import unittest
from glob import glob
from shutil import rmtree
+from functools import wraps
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
from oeqa.utils.decorators import testcase
+class onlyForArch(object):
+
+ def __init__(self, *args):
+ self.archs = args
+
+ def __call__(self,f):
+ @wraps(f)
+ def wrapped_f(*args, **kwargs):
+ arch = get_bb_var('HOST_ARCH', 'core-image-minimal')
+ if self.archs and arch not in self.archs :
+ raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch)
+ return f(*args, **kwargs)
+ wrapped_f.__name__ = f.__name__
+ return wrapped_f
+
+
class Wic(oeSelfTest):
"""Wic test class."""
@@ -41,15 +59,22 @@ class Wic(oeSelfTest):
def setUpLocal(self):
"""This code is executed before each test method."""
- self.write_config('IMAGE_FSTYPES += " hddimg"\n'
- 'MACHINE_FEATURES_append = " efi"\n')
+ arch = get_bb_var('HOST_ARCH', 'core-image-minimal')
+ is_x86 = arch in ['i586', 'i686', 'x86_64']
+ if is_x86:
+ self.write_config('IMAGE_FSTYPES += " hddimg"\n' \
+ 'MACHINE_FEATURES_append = " efi"\n')
# Do this here instead of in setUpClass as the base setUp does some
# clean up which can result in the native tools built earlier in
# setUpClass being unavailable.
if not Wic.image_is_ready:
- bitbake('syslinux syslinux-native parted-native gptfdisk-native '
- 'dosfstools-native mtools-native bmap-tools-native')
+ tools = 'parted-native gptfdisk-native ' \
+ 'dosfstools-native mtools-native bmap-tools-native'
+ if is_x86:
+ tools += ' syslinux syslinux-native'
+ bitbake(tools)
+
bitbake('core-image-minimal')
Wic.image_is_ready = True
@@ -71,6 +96,7 @@ class Wic(oeSelfTest):
self.assertEqual(0, runCmd('wic list --help').status)
@testcase(1211)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_build_image_name(self):
"""Test wic create directdisk --image-name core-image-minimal"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -78,6 +104,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1212)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_build_artifacts(self):
"""Test wic create directdisk providing all artifacts."""
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
@@ -92,6 +119,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1157)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_gpt_image(self):
"""Test creation of core-image-minimal with gpt table and UUID boot"""
self.assertEqual(0, runCmd("wic create directdisk-gpt "
@@ -125,6 +153,7 @@ class Wic(oeSelfTest):
self.assertEqual(0, runCmd('wic help kickstart').status)
@testcase(1264)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_compress_gzip(self):
"""Test compressing an image with gzip"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -134,6 +163,7 @@ class Wic(oeSelfTest):
"directdisk-*.direct.gz")))
@testcase(1265)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_compress_bzip2(self):
"""Test compressing an image with bzip2"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -143,6 +173,7 @@ class Wic(oeSelfTest):
"directdisk-*.direct.bz2")))
@testcase(1266)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_compress_xz(self):
"""Test compressing an image with xz"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -152,6 +183,7 @@ class Wic(oeSelfTest):
"directdisk-*.direct.xz")))
@testcase(1267)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_wrong_compressor(self):
"""Test how wic breaks if wrong compressor is provided"""
self.assertEqual(2, runCmd("wic create directdisk "
@@ -159,6 +191,7 @@ class Wic(oeSelfTest):
"-c wrong", ignore_status=True).status)
@testcase(1268)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_indirect_recipes(self):
"""Test usage of rootfs plugin with rootfs recipes"""
wks = "directdisk-multi-rootfs"
@@ -170,6 +203,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
@testcase(1269)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_artifacts(self):
"""Test usage of rootfs plugin with rootfs paths"""
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
@@ -188,6 +222,7 @@ class Wic(oeSelfTest):
"%(wks)s-*.direct" % bbvars)))
@testcase(1346)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_iso_image(self):
"""Test creation of hybrid iso image with legacy and EFI boot"""
self.assertEqual(0, runCmd("wic create mkhybridiso "
@@ -220,6 +255,7 @@ class Wic(oeSelfTest):
self.assertTrue(content[var])
@testcase(1351)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_wic_image_type(self):
"""Test building wic images by bitbake"""
self.assertEqual(0, bitbake('wic-image-minimal').status)
@@ -235,6 +271,7 @@ class Wic(oeSelfTest):
self.assertTrue(os.path.isfile(os.path.realpath(path)))
@testcase(1348)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_qemux86_directdisk(self):
"""Test creation of qemux-86-directdisk image"""
image = "qemux86-directdisk"
@@ -243,6 +280,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1349)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_mkgummidisk(self):
"""Test creation of mkgummidisk image"""
image = "mkgummidisk"
@@ -251,6 +289,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1350)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_mkefidisk(self):
"""Test creation of mkefidisk image"""
image = "mkefidisk"
@@ -259,6 +298,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1385)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_directdisk_bootloader_config(self):
"""Test creation of directdisk-bootloader-config image"""
image = "directdisk-bootloader-config"
@@ -267,6 +307,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1422)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_qemu(self):
"""Test wic-image-minimal under qemu"""
self.assertEqual(0, bitbake('wic-image-minimal').status)
@@ -277,6 +318,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (command, output))
self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt')
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_bmap(self):
"""Test generation of .bmap file"""
image = "directdisk"
@@ -285,6 +327,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct.bmap" % image)))
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_systemd_bootdisk(self):
"""Test creation of systemd-bootdisk image"""
image = "systemd-bootdisk"
--
2.5.0
^ permalink raw reply related
* [PATCH v4 3/7] wic: add --fixed-size wks option
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479887010.git.maciej.borzecki@rndity.com>
Added new option --fixed-size to wks. The option can be used to indicate
the exact size of a partition. The option cannot be added together with
--size, in which case an error will be raised. Other options that
influence automatic partition size (--extra-space, --overhead-factor),
if specifiec along with --fixed-size, will raise an error.
If it partition data is larger than the amount of space specified with
--fixed-size option wic will raise an error.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/lib/wic/help.py | 14 ++++--
scripts/lib/wic/imager/direct.py | 2 +-
scripts/lib/wic/ksparser.py | 41 ++++++++++++++--
scripts/lib/wic/partition.py | 88 +++++++++++++++++++++-------------
scripts/lib/wic/utils/partitionedfs.py | 2 +-
5 files changed, 105 insertions(+), 42 deletions(-)
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index e5347ec4b7c900c68fc64351a5293e75de0672b3..daa11bf489c135627ddfe4cef968e48f8e3ad1d8 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -646,6 +646,12 @@ DESCRIPTION
not specified, the size is in MB.
You do not need this option if you use --source.
+ --fixed-size: Exact partition size. Value format is the same
+ as for --size option. This option cannot be
+ specified along with --size. If partition data
+ is larger than --fixed-size and error will be
+ raised when assembling disk image.
+
--source: This option is a wic-specific option that names the
source of the data that will populate the
partition. The most common value for this option
@@ -719,13 +725,15 @@ DESCRIPTION
space after the space filled by the content
of the partition. The final size can go
beyond the size specified by --size.
- By default, 10MB.
+ By default, 10MB. This option cannot be used
+ with --fixed-size option.
--overhead-factor: This option is specific to wic. The
size of the partition is multiplied by
this factor. It has to be greater than or
- equal to 1.
- The default value is 1.3.
+ equal to 1. The default value is 1.3.
+ This option cannot be used with --fixed-size
+ option.
--part-type: This option is specific to wic. It specifies partition
type GUID for GPT partitions.
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 2bedef08d6450096c786def6f75a9ee53fcd4b3b..11ec15e33f65885618c7adc83e55c6a39fedbe99 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -290,7 +290,7 @@ class DirectImageCreator(BaseImageCreator):
self.bootimg_dir, self.kernel_dir, self.native_sysroot)
- self.__image.add_partition(int(part.size),
+ self.__image.add_partition(part.disk_size,
part.disk,
part.mountpoint,
part.source_file,
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 0894e2b199a299fbbed272f2e1c95e9d692e3ab1..62c490274aa92bf82aac304d9323250e3b728d0c 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -113,6 +113,9 @@ def systemidtype(arg):
class KickStart():
""""Kickstart parser implementation."""
+ DEFAULT_EXTRA_SPACE = 10*1024
+ DEFAULT_OVERHEAD_FACTOR = 1.3
+
def __init__(self, confpath):
self.partitions = []
@@ -127,16 +130,24 @@ class KickStart():
part.add_argument('mountpoint', nargs='?')
part.add_argument('--active', action='store_true')
part.add_argument('--align', type=int)
- part.add_argument("--extra-space", type=sizetype, default=10*1024)
+ part.add_argument("--extra-space", type=sizetype)
part.add_argument('--fsoptions', dest='fsopts')
part.add_argument('--fstype')
part.add_argument('--label')
part.add_argument('--no-table', action='store_true')
part.add_argument('--ondisk', '--ondrive', dest='disk')
- part.add_argument("--overhead-factor", type=overheadtype, default=1.3)
+ part.add_argument("--overhead-factor", type=overheadtype)
part.add_argument('--part-type')
part.add_argument('--rootfs-dir')
- part.add_argument('--size', type=sizetype, default=0)
+
+ # --size and --fixed-size cannot be specified together; options
+ # ----extra-space and --overhead-factor should also raise a parser
+ # --error, but since nesting mutually exclusive groups does not work,
+ # ----extra-space/--overhead-factor are handled later
+ sizeexcl = part.add_mutually_exclusive_group()
+ sizeexcl.add_argument('--size', type=sizetype, default=0)
+ sizeexcl.add_argument('--fixed-size', type=sizetype, default=0)
+
part.add_argument('--source')
part.add_argument('--sourceparams')
part.add_argument('--system-id', type=systemidtype)
@@ -170,11 +181,33 @@ class KickStart():
lineno += 1
if line and line[0] != '#':
try:
- parsed = parser.parse_args(shlex.split(line))
+ line_args = shlex.split(line)
+ parsed = parser.parse_args(line_args)
except ArgumentError as err:
raise KickStartError('%s:%d: %s' % \
(confpath, lineno, err))
if line.startswith('part'):
+ # using ArgumentParser one cannot easily tell if option
+ # was passed as argument, if said option has a default
+ # value; --overhead-factor/--extra-space cannot be used
+ # with --fixed-size, so at least detect when these were
+ # passed with non-0 values ...
+ if parsed.fixed_size:
+ if parsed.overhead_factor or parsed.extra_space:
+ err = "%s:%d: arguments --overhead-factor and --extra-space not "\
+ "allowed with argument --fixed-size" \
+ % (confpath, lineno)
+ raise KickStartError(err)
+ else:
+ # ... and provide defaults if not using
+ # --fixed-size iff given option was not used
+ # (again, one cannot tell if option was passed but
+ # with value equal to 0)
+ if '--overhead-factor' not in line_args:
+ parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR
+ if '--extra-space' not in line_args:
+ parsed.extra_space = self.DEFAULT_EXTRA_SPACE
+
self.partnum += 1
self.partitions.append(Partition(parsed, self.partnum))
elif line.startswith('include'):
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index ac4c836bdb53300d3a4e4c09926b7b1514b8faf2..8cf966ebc6d07490c44cefc93acbe5868be30ac7 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -54,6 +54,7 @@ class Partition():
self.part_type = args.part_type
self.rootfs_dir = args.rootfs_dir
self.size = args.size
+ self.fixed_size = args.fixed_size
self.source = args.source
self.sourceparams = args.sourceparams
self.system_id = args.system_id
@@ -87,6 +88,41 @@ class Partition():
else:
return 0
+ def get_rootfs_size(self, actual_rootfs_size=0):
+ """
+ Calculate the required size of rootfs taking into consideration
+ --size/--fixed-size flags as well as overhead and extra space, as
+ specified in kickstart file. Raises an error if the
+ `actual_rootfs_size` is larger than fixed-size rootfs.
+
+ """
+ if self.fixed_size:
+ rootfs_size = self.fixed_size
+ if actual_rootfs_size > rootfs_size:
+ msger.error("Actual rootfs size (%d kB) is larger than allowed size %d kB" \
+ %(actual_rootfs_size, rootfs_size))
+ else:
+ extra_blocks = self.get_extra_block_count(actual_rootfs_size)
+ if extra_blocks < self.extra_space:
+ extra_blocks = self.extra_space
+
+ rootfs_size = actual_rootfs_size + extra_blocks
+ rootfs_size *= self.overhead_factor
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, self.mountpoint, rootfs_size))
+
+ return rootfs_size
+
+ @property
+ def disk_size(self):
+ """
+ Obtain on-disk size of partition taking into consideration
+ --size/--fixed-size options.
+
+ """
+ return self.fixed_size if self.fixed_size else self.size
+
def prepare(self, creator, cr_workdir, oe_builddir, rootfs_dir,
bootimg_dir, kernel_dir, native_sysroot):
"""
@@ -97,9 +133,9 @@ class Partition():
self.sourceparams_dict = parse_sourceparams(self.sourceparams)
if not self.source:
- if not self.size:
- msger.error("The %s partition has a size of zero. Please "
- "specify a non-zero --size for that partition." % \
+ if not self.size and not self.fixed_size:
+ msger.error("The %s partition has a size of zero. Please "
+ "specify a non-zero --size/--fixed-size for that partition." % \
self.mountpoint)
if self.fstype and self.fstype == "swap":
self.prepare_swap_partition(cr_workdir, oe_builddir,
@@ -146,6 +182,7 @@ class Partition():
oe_builddir,
bootimg_dir, kernel_dir, rootfs_dir,
native_sysroot)
+
# further processing required Partition.size to be an integer, make
# sure that it is one
if type(self.size) is not int:
@@ -153,6 +190,12 @@ class Partition():
"This a bug in source plugin %s and needs to be fixed." \
% (self.mountpoint, self.source))
+ if self.fixed_size and self.size > self.fixed_size:
+ msger.error("File system image of partition %s is larger (%d kB) than its"\
+ "allowed size %d kB" % (self.mountpoint,
+ self.size, self.fixed_size))
+
+
def prepare_rootfs_from_fs_image(self, cr_workdir, oe_builddir,
rootfs_dir):
"""
@@ -217,15 +260,7 @@ class Partition():
out = exec_cmd(du_cmd)
actual_rootfs_size = int(out.split()[0])
- extra_blocks = self.get_extra_block_count(actual_rootfs_size)
- if extra_blocks < self.extra_space:
- extra_blocks = self.extra_space
-
- rootfs_size = actual_rootfs_size + extra_blocks
- rootfs_size *= self.overhead_factor
-
- msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
- (extra_blocks, self.mountpoint, rootfs_size))
+ rootfs_size = self.get_rootfs_size(actual_rootfs_size)
with open(rootfs, 'w') as sparse:
os.ftruncate(sparse.fileno(), rootfs_size * 1024)
@@ -251,15 +286,7 @@ class Partition():
out = exec_cmd(du_cmd)
actual_rootfs_size = int(out.split()[0])
- extra_blocks = self.get_extra_block_count(actual_rootfs_size)
- if extra_blocks < self.extra_space:
- extra_blocks = self.extra_space
-
- rootfs_size = actual_rootfs_size + extra_blocks
- rootfs_size *= self.overhead_factor
-
- msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
- (extra_blocks, self.mountpoint, rootfs_size))
+ rootfs_size = self.get_rootfs_size(actual_rootfs_size)
with open(rootfs, 'w') as sparse:
os.ftruncate(sparse.fileno(), rootfs_size * 1024)
@@ -281,20 +308,13 @@ class Partition():
out = exec_cmd(du_cmd)
blocks = int(out.split()[0])
- extra_blocks = self.get_extra_block_count(blocks)
- if extra_blocks < self.extra_space:
- extra_blocks = self.extra_space
-
- blocks += extra_blocks
-
- msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
- (extra_blocks, self.mountpoint, blocks))
+ rootfs_size = self.get_rootfs_size(blocks)
label_str = "-n boot"
if self.label:
label_str = "-n %s" % self.label
- dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
+ dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, rootfs_size)
exec_native_cmd(dosfs_cmd, native_sysroot)
mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir)
@@ -317,8 +337,9 @@ class Partition():
"""
Prepare an empty ext2/3/4 partition.
"""
+ size = self.disk_size
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), self.size * 1024)
+ os.ftruncate(sparse.fileno(), size * 1024)
extra_imagecmd = "-i 8192"
@@ -335,8 +356,9 @@ class Partition():
"""
Prepare an empty btrfs partition.
"""
+ size = self.disk_size
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), self.size * 1024)
+ os.ftruncate(sparse.fileno(), size * 1024)
label_str = ""
if self.label:
@@ -351,7 +373,7 @@ class Partition():
"""
Prepare an empty vfat partition.
"""
- blocks = self.size
+ blocks = self.disk_size
label_str = "-n boot"
if self.label:
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index 9e76487844eebfffc7227d053a65dc9fdab3678b..cfa5f5ce09b764c1c2a9b7a3f7bf7d677a6811c4 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -209,7 +209,7 @@ class Image():
msger.debug("Assigned %s to %s%d, sectors range %d-%d size %d "
"sectors (%d bytes)." \
% (part['mountpoint'], part['disk_name'], part['num'],
- part['start'], part['start'] + part['size'] - 1,
+ part['start'], disk['offset'] - 1,
part['size'], part['size'] * self.sector_size))
# Once all the partitions have been layed out, we can calculate the
--
2.5.0
^ permalink raw reply related
* [PATCH v4 2/7] oeqa/utils/commands.py: allow use of binaries from native sysroot
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479887010.git.maciej.borzecki@rndity.com>
Tests may need to run a native tool that is not available on the host
filesystem, but can be built using one of the *-native recipes. In such case,
the tool will be available in native sysroot, and running in from that location
will require adjustments to PATH.
runCmd() can now take a path to native sysroot as one of its arguments and
setup PATH accordingly.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/utils/commands.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 5cd0f7477baa5bb45f2b2b5b93fb1ff0efd02923..657c9dba34ea9d42aa416f3b889f4b04129e8da9 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -97,9 +97,16 @@ class Result(object):
pass
-def runCmd(command, ignore_status=False, timeout=None, assert_error=True, **options):
+def runCmd(command, ignore_status=False, timeout=None, assert_error=True, native_sysroot=None, **options):
result = Result()
+ if native_sysroot:
+ extra_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
+ (native_sysroot, native_sysroot, native_sysroot)
+ nenv = dict(options.get('env', os.environ))
+ nenv['PATH'] = extra_paths + ':' + nenv.get('PATH', '')
+ options['env'] = nenv
+
cmd = Command(command, timeout=timeout, **options)
cmd.run()
--
2.5.0
^ permalink raw reply related
* [PATCH v4 1/7] oe-selftest: enforce en_US.UTF-8 locale
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479887010.git.maciej.borzecki@rndity.com>
Replicate bitbake and eforce en_US.UTF-8 locale so that ouptut of locale-aware
tools remains stable.
Signed-off-by: Maciej Birzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/oe-selftest | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index c3215ea6592e128d17da550d778272985f5bd1a6..deaa4324cc888ea261687f90f83e8759c4436a15 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -468,6 +468,9 @@ def main():
sys.path.extend(layer_libdirs)
imp.reload(oeqa.selftest)
+ # act like bitbake and enforce en_US.UTF-8 locale
+ os.environ["LC_ALL"] = "en_US.UTF-8"
+
if args.run_tests_by and len(args.run_tests_by) >= 2:
valid_options = ['name', 'class', 'module', 'id', 'tag']
if args.run_tests_by[0] not in valid_options:
--
2.5.0
^ permalink raw reply related
* [PATCH v4 0/7] wic: bugfixes & --fixed-size support, tests, oe-selftest: minor fixes
From: Maciej Borzecki @ 2016-11-23 7:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
v4 of patch series previously posted here [1].
Some of the patches that were posted as part of v3 are already in master. This
version contains only the patches that were not merged yet.
Changes since v3:
* Running wic tests on Ubuntu resulted in test_fixed_size to fail. The reason
was that `parted` is not a part of the base system, but is needed for
verification of wic-produced partition layout. Parted is built as part of wic
dependencies, hence oeqa/utils/commands.py:runCmd() was extended to include a
new paramter - native_sysroot. This allows runCmd() to run binaries from
STAGING_DIR_NATIVE{/sbin,/usr/bin,/usr/sbin}.
[1]. http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128785.html
Maciej Borzecki (7):
oe-selftest: enforce en_US.UTF-8 locale
oeqa/utils/commands.py: allow use of binaries from native sysroot
wic: add --fixed-size wks option
wic: selftest: avoid COMPATIBLE_HOST issues
wic: selftest: do not repeat core-image-minimal
wic: selftest: do not assume bzImage kernel image
wic: selftest: add tests for --fixed-size partition flags
meta/lib/oeqa/selftest/wic.py | 234 +++++++++++++++++++++++++++------
meta/lib/oeqa/utils/commands.py | 9 +-
scripts/lib/wic/help.py | 14 +-
scripts/lib/wic/imager/direct.py | 2 +-
scripts/lib/wic/ksparser.py | 41 +++++-
scripts/lib/wic/partition.py | 88 ++++++++-----
scripts/lib/wic/utils/partitionedfs.py | 2 +-
scripts/oe-selftest | 3 +
8 files changed, 307 insertions(+), 86 deletions(-)
--
2.5.0
^ permalink raw reply
* Re: Contents of non-rootfs partitions
From: Khem Raj @ 2016-11-23 7:26 UTC (permalink / raw)
To: Kristian Amlie; +Cc: openembedded-core
In-Reply-To: <839768d8-710e-b4b0-88ad-1c5780f4c51d@mender.io>
> On Nov 22, 2016, at 11:13 PM, Kristian Amlie <kristian.amlie@mender.io> wrote:
>
> On 23/11/16 00:45, Khem Raj wrote:
>> On 11/22/16 1:05 AM, Kristian Amlie wrote:
>>> Hey
>>>
>>> In Mender we are using a dual rootfs partition layout (A/B layout) with a persistent data partition on the side. We're using wic to do the actual image building.
>>>
>>> However, putting files into this data partition is not a straightforward operation ATM. All recipes in OE put files into the rootfs only, and we'd like there to be a way to specify that files should go into the data partition.
>>>
>>> I haven't seen any straightforward way to do this in OE. Some suggestions for how it could be done:
>>>
>>> * A "DATA_FILES" variable (like "IMAGE_BOOT_FILES"), where you can list files you'd like to be included. This is very straightforward, but has the disadvantage of being a bit hairy when paths are involved, and it doesn't allow for much logic.
>>>
>>> * Keep a special "data" directory, something similar to sysroot, where recipes could install files into in order to have it included on the data partition. We could potentially have a bbclass for use in recipes to make this more streamlined.
>>>
>>
>> Firstly, it needs to be defined what the data partition is about.
>> 1. is it some pre-initialized/seeded data that can then be modified during
>> subsequent boots ?
>> 2. Is it read-only data which is then used to populate r/w data segments in
>> RAM during boot
>> 3. is it data that does not change over the course of install and reboots of
>> the device
>
> It's preseeded, but modifiable data, that survives complete rootfs
> updates. IOW if you overwrite either of your A/B rootfs partitions, the
> data partition and its content survives.
at some point this data segment will be seeded.
think of factory case.
So in such a case updates should not touch them unless user does a factory reset
which should clean it up
>
> --
> Kristian
^ permalink raw reply
* Re: Contents of non-rootfs partitions
From: Kristian Amlie @ 2016-11-23 7:13 UTC (permalink / raw)
To: Khem Raj, openembedded-core
In-Reply-To: <1d5954ab-1a9a-b73d-7f72-fbe84c8e2250@gmail.com>
On 23/11/16 00:45, Khem Raj wrote:
> On 11/22/16 1:05 AM, Kristian Amlie wrote:
>> Hey
>>
>> In Mender we are using a dual rootfs partition layout (A/B layout) with a persistent data partition on the side. We're using wic to do the actual image building.
>>
>> However, putting files into this data partition is not a straightforward operation ATM. All recipes in OE put files into the rootfs only, and we'd like there to be a way to specify that files should go into the data partition.
>>
>> I haven't seen any straightforward way to do this in OE. Some suggestions for how it could be done:
>>
>> * A "DATA_FILES" variable (like "IMAGE_BOOT_FILES"), where you can list files you'd like to be included. This is very straightforward, but has the disadvantage of being a bit hairy when paths are involved, and it doesn't allow for much logic.
>>
>> * Keep a special "data" directory, something similar to sysroot, where recipes could install files into in order to have it included on the data partition. We could potentially have a bbclass for use in recipes to make this more streamlined.
>>
>
> Firstly, it needs to be defined what the data partition is about.
> 1. is it some pre-initialized/seeded data that can then be modified during
> subsequent boots ?
> 2. Is it read-only data which is then used to populate r/w data segments in
> RAM during boot
> 3. is it data that does not change over the course of install and reboots of
> the device
It's preseeded, but modifiable data, that survives complete rootfs
updates. IOW if you overwrite either of your A/B rootfs partitions, the
data partition and its content survives.
--
Kristian
^ permalink raw reply
* Re: [PATCH 1/1] gdb-cross: depends on flex-native and bison-native
From: Khem Raj @ 2016-11-23 6:52 UTC (permalink / raw)
To: Yuanjie Huang; +Cc: openembedded-core
In-Reply-To: <926fbd84-941c-2eeb-d189-27133a6b0688@windriver.com>
> On Nov 22, 2016, at 10:49 PM, Yuanjie Huang <yuanjie.huang@windriver.com> wrote:
>
>
> On 11/23/2016 11:38 AM, Khem Raj wrote:
>> are they regenerating code during configure ?
> No, code is generated during compilation. Corresponding c files are not included in git repo, so these files are always compiled from flex/bison source files.
OK.
>>> On Nov 22, 2016, at 7:22 PM, Yuanjie Huang <yuanjie.huang@windriver.com> wrote:
>>>
>>> Hi Raj,
>>>
>>> We observed gdb/ada-lex.l is processed by flex while gdb/c-exp.y, gdb/f-exp.y, gdb/go-exp.y and many others are handled by bison. Basically, all language-specific codes in gdb are generated.
>>>
>>> Best,
>>> Yuanjie
>>>
>>> On 11/23/2016 11:05 AM, Khem Raj wrote:
>>>>> On Nov 22, 2016, at 6:00 PM, Yuanjie Huang <Yuanjie.Huang@windriver.com> wrote:
>>>>>
>>>>> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>>>>>
>>>>> Some source code of gdb is generated with flex or bison. Make both
>>>>> dependencies, to avoid compilation failure on host without them.
>>>> can you find out which parts those are ? what is it trying to do to need flex/yacc
>>>>> Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
>>>>> ---
>>>>> meta/recipes-devtools/gdb/gdb-cross.inc | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/meta/recipes-devtools/gdb/gdb-cross.inc b/meta/recipes-devtools/gdb/gdb-cross.inc
>>>>> index 5fa7c33..a34223e 100644
>>>>> --- a/meta/recipes-devtools/gdb/gdb-cross.inc
>>>>> +++ b/meta/recipes-devtools/gdb/gdb-cross.inc
>>>>> @@ -1,6 +1,6 @@
>>>>> require gdb-common.inc
>>>>>
>>>>> -DEPENDS = "expat-native ncurses-native"
>>>>> +DEPENDS = "expat-native ncurses-native flex-native bison-native"
>>>>>
>>>>> inherit python3native
>>>>>
>>>>> --
>>>>> 2.7.4
>>>>>
>>>>> --
>>>>> _______________________________________________
>>>>> Openembedded-core mailing list
>>>>> Openembedded-core@lists.openembedded.org
>>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
^ permalink raw reply
* Re: [PATCH 1/1] gdb-cross: depends on flex-native and bison-native
From: Yuanjie Huang @ 2016-11-23 6:49 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
In-Reply-To: <76B00DDD-67D7-467A-84F7-67C0FB25EA62@gmail.com>
On 11/23/2016 11:38 AM, Khem Raj wrote:
> are they regenerating code during configure ?
No, code is generated during compilation. Corresponding c files are not
included in git repo, so these files are always compiled from flex/bison
source files.
>> On Nov 22, 2016, at 7:22 PM, Yuanjie Huang <yuanjie.huang@windriver.com> wrote:
>>
>> Hi Raj,
>>
>> We observed gdb/ada-lex.l is processed by flex while gdb/c-exp.y, gdb/f-exp.y, gdb/go-exp.y and many others are handled by bison. Basically, all language-specific codes in gdb are generated.
>>
>> Best,
>> Yuanjie
>>
>> On 11/23/2016 11:05 AM, Khem Raj wrote:
>>>> On Nov 22, 2016, at 6:00 PM, Yuanjie Huang <Yuanjie.Huang@windriver.com> wrote:
>>>>
>>>> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>>>>
>>>> Some source code of gdb is generated with flex or bison. Make both
>>>> dependencies, to avoid compilation failure on host without them.
>>> can you find out which parts those are ? what is it trying to do to need flex/yacc
>>>> Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
>>>> ---
>>>> meta/recipes-devtools/gdb/gdb-cross.inc | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/meta/recipes-devtools/gdb/gdb-cross.inc b/meta/recipes-devtools/gdb/gdb-cross.inc
>>>> index 5fa7c33..a34223e 100644
>>>> --- a/meta/recipes-devtools/gdb/gdb-cross.inc
>>>> +++ b/meta/recipes-devtools/gdb/gdb-cross.inc
>>>> @@ -1,6 +1,6 @@
>>>> require gdb-common.inc
>>>>
>>>> -DEPENDS = "expat-native ncurses-native"
>>>> +DEPENDS = "expat-native ncurses-native flex-native bison-native"
>>>>
>>>> inherit python3native
>>>>
>>>> --
>>>> 2.7.4
>>>>
>>>> --
>>>> _______________________________________________
>>>> Openembedded-core mailing list
>>>> Openembedded-core@lists.openembedded.org
>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply
* Re: [PATCH] kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLE
From: Nathan Rossi @ 2016-11-23 5:29 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <20161021120728.22639-1-nathan@nathanrossi.com>
Just pinging these patches, to see if there were any issues or
comments. I realize I sent them just before a release so it was very
likely they would get lost in the noise.
Thanks,
Nathan
On 21 October 2016 at 22:07, Nathan Rossi <nathan@nathanrossi.com> wrote:
> Check the value of UBOOT_SIGN_ENABLE, as it is defaulted to "0" which
> for matches as True in python due to being a non-empty string.
>
> Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
> ---
> meta/classes/kernel-fitimage.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
> index 8580247f82..3bbf91f65a 100644
> --- a/meta/classes/kernel-fitimage.bbclass
> +++ b/meta/classes/kernel-fitimage.bbclass
> @@ -26,7 +26,7 @@ python __anonymous () {
> # Verified boot will sign the fitImage and append the public key to
> # U-boot dtb. We ensure the U-Boot dtb is deployed before assembling
> # the fitImage:
> - if d.getVar('UBOOT_SIGN_ENABLE', True):
> + if d.getVar('UBOOT_SIGN_ENABLE', True) == "1":
> uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot'
> d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn)
> }
> --
> 2.9.3
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox