<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 25, 2016 at 4:12 AM, Bogdan Purcareata <span dir="ltr"><<a href="mailto:bogdan.purcareata@nxp.com" target="_blank">bogdan.purcareata@nxp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Warnings fixes:<br>
- optional mounts when dirs not available<br>
- busybox dynamically linked<br>
- fstab not available in container<br>
<br>
Please apply on master and jethro branches.<br></blockquote><div><br></div><div>merged.</div><div><br></div><div>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Signed-off-by: Bogdan Purcareata <<a href="mailto:bogdan.purcareata@nxp.com">bogdan.purcareata@nxp.com</a>><br>
---<br>
 ...-Remove-warning-for-dynamically-linked-Bu.patch | 43 +++++++++++++++++++<br>
 ...x-Touch-etc-fstab-in-the-container-rootfs.patch | 30 +++++++++++++<br>
 ...t_symlink-Don-t-SYSERROR-on-something-els.patch | 49 ++++++++++++++++++++++<br>
 recipes-containers/lxc/<a href="http://lxc_1.1.4.bb" rel="noreferrer" target="_blank">lxc_1.1.4.bb</a>                |  3 ++<br>
 4 files changed, 125 insertions(+)<br>
 create mode 100644 recipes-containers/lxc/files/lxc-busybox-Remove-warning-for-dynamically-linked-Bu.patch<br>
 create mode 100644 recipes-containers/lxc/files/lxc-busybox-Touch-etc-fstab-in-the-container-rootfs.patch<br>
 create mode 100644 recipes-containers/lxc/files/open_without_symlink-Don-t-SYSERROR-on-something-els.patch<br>
<br>
diff --git a/recipes-containers/lxc/files/lxc-busybox-Remove-warning-for-dynamically-linked-Bu.patch b/recipes-containers/lxc/files/lxc-busybox-Remove-warning-for-dynamically-linked-Bu.patch<br>
new file mode 100644<br>
index 0000000..c0a810b<br>
--- /dev/null<br>
+++ b/recipes-containers/lxc/files/lxc-busybox-Remove-warning-for-dynamically-linked-Bu.patch<br>
@@ -0,0 +1,43 @@<br>
+From 07e4c41f2963d73b9aedd552c74f17a33e89f020 Mon Sep 17 00:00:00 2001<br>
+From: Bogdan Purcareata <<a href="mailto:bogdan.purcareata@nxp.com">bogdan.purcareata@nxp.com</a>><br>
+Date: Thu, 24 Mar 2016 11:54:27 +0000<br>
+Subject: [PATCH] lxc-busybox: Remove warning for dynamically linked Busybox<br>
+MIME-Version: 1.0<br>
+Content-Type: text/plain; charset=UTF-8<br>
+Content-Transfer-Encoding: 8bit<br>
+<br>
+The warning has been present since commit 32b37181ea (with no purpose stated).<br>
+Support for dynamically linked Busybox has been added since commit bf6cc73696.<br>
+Haven't encountered any issues with dynamically linked Busybox in my last<br>
+2 years' testing.<br>
+<br>
+Upstream-status: Accepted<br>
+[<a href="https://github.com/lxc/lxc/commit/07e4c41f2963d73b9aedd552c74f17a33e89f020" rel="noreferrer" target="_blank">https://github.com/lxc/lxc/commit/07e4c41f2963d73b9aedd552c74f17a33e89f020</a>]<br>
+<br>
+Signed-off-by: Bogdan Purcareata <<a href="mailto:bogdan.purcareata@nxp.com">bogdan.purcareata@nxp.com</a>><br>
+Acked-by: Stéphane Graber <<a href="mailto:stgraber@ubuntu.com">stgraber@ubuntu.com</a>><br>
+---<br>
+ templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a> | 7 -------<br>
+ 1 file changed, 7 deletions(-)<br>
+<br>
+diff --git a/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a> b/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a><br>
+index f547f9e..336fa12 100644<br>
+--- a/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a><br>
++++ b/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a><br>
+@@ -304,13 +304,6 @@ configure_busybox()<br>
+         return 1<br>
+     fi<br>
+<br>
+-    file -L $(which busybox) | grep -q "statically linked"<br>
+-    if [ $? -ne 0 ]; then<br>
+-        echo "warning : busybox is not statically linked."<br>
+-        echo "warning : The template script may not correctly"<br>
+-        echo "warning : setup the container environment."<br>
+-    fi<br>
+-<br>
+     # copy busybox in the rootfs<br>
+     cp $(which busybox) $rootfs/bin<br>
+     if [ $? -ne 0 ]; then<br>
+--<br>
+1.9.1<br>
+<br>
diff --git a/recipes-containers/lxc/files/lxc-busybox-Touch-etc-fstab-in-the-container-rootfs.patch b/recipes-containers/lxc/files/lxc-busybox-Touch-etc-fstab-in-the-container-rootfs.patch<br>
new file mode 100644<br>
index 0000000..33862dd<br>
--- /dev/null<br>
+++ b/recipes-containers/lxc/files/lxc-busybox-Touch-etc-fstab-in-the-container-rootfs.patch<br>
@@ -0,0 +1,30 @@<br>
+From 6ab1ca0375feeb00070f0c0f9186551b08b1ee5e Mon Sep 17 00:00:00 2001<br>
+From: Bogdan Purcareata <<a href="mailto:bogdan.purcareata@nxp.com">bogdan.purcareata@nxp.com</a>><br>
+Date: Tue, 22 Mar 2016 13:33:57 +0000<br>
+Subject: [PATCH] lxc-busybox: Touch /etc/fstab in the container rootfs<br>
+<br>
+Upstream-status: Accepted<br>
+[<a href="https://github.com/lxc/lxc/commit/6ab1ca0375feeb00070f0c0f9186551b08b1ee5e" rel="noreferrer" target="_blank">https://github.com/lxc/lxc/commit/6ab1ca0375feeb00070f0c0f9186551b08b1ee5e</a>]<br>
+<br>
+Signed-off-by: Bogdan Purcareata <<a href="mailto:bogdan.purcareata@nxp.com">bogdan.purcareata@nxp.com</a>><br>
+---<br>
+ templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a> | 3 +++<br>
+ 1 file changed, 3 insertions(+)<br>
+<br>
+diff --git a/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a> b/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a><br>
+index c020e66..f547f9e 100644<br>
+--- a/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a><br>
++++ b/templates/<a href="http://lxc-busybox.in" rel="noreferrer" target="_blank">lxc-busybox.in</a><br>
+@@ -330,6 +330,9 @@ configure_busybox()<br>
+     # relink /sbin/init<br>
+     ln $rootfs/bin/busybox $rootfs/sbin/init<br>
+<br>
++    # /etc/fstab must exist for "mount -a"<br>
++    touch $rootfs/etc/fstab<br>
++<br>
+     # passwd exec must be setuid<br>
+     chmod +s $rootfs/bin/passwd<br>
+     touch $rootfs/etc/shadow<br>
+--<br>
+1.9.1<br>
+<br>
diff --git a/recipes-containers/lxc/files/open_without_symlink-Don-t-SYSERROR-on-something-els.patch b/recipes-containers/lxc/files/open_without_symlink-Don-t-SYSERROR-on-something-els.patch<br>
new file mode 100644<br>
index 0000000..098ead7<br>
--- /dev/null<br>
+++ b/recipes-containers/lxc/files/open_without_symlink-Don-t-SYSERROR-on-something-els.patch<br>
@@ -0,0 +1,49 @@<br>
+From 88e078ba865b675f9a0dc61caa0732d7052593f8 Mon Sep 17 00:00:00 2001<br>
+From: Christian Brauner <<a href="mailto:christian.brauner@mailbox.org">christian.brauner@mailbox.org</a>><br>
+Date: Wed, 23 Mar 2016 16:37:09 +0100<br>
+Subject: [PATCH] open_without_symlink: Don't SYSERROR on something else than<br>
+ ELOOP<br>
+<br>
+The open_without_symlink routine has been specifically created to prevent<br>
+mounts with synlinks as source or destination. Keep SYSERROR'ing in that<br>
+particular scenario, but leave error handling to calling functions for the<br>
+other ones - e.g. optional bind mount when the source dir doesn't exist<br>
+throws a nasty error.<br>
+<br>
+Upstream-status: Accepted<br>
+[<a href="https://github.com/lxc/lxc/commit/88e078ba865b675f9a0dc61caa0732d7052593f8" rel="noreferrer" target="_blank">https://github.com/lxc/lxc/commit/88e078ba865b675f9a0dc61caa0732d7052593f8</a>]<br>
+<br>
+Signed-off-by: Bogdan Purcareata <<a href="mailto:bogdan.purcareata@nxp.com">bogdan.purcareata@nxp.com</a>><br>
+---<br>
+ src/lxc/utils.c | 7 ++++---<br>
+ 1 file changed, 4 insertions(+), 3 deletions(-)<br>
+<br>
+diff --git a/src/lxc/utils.c b/src/lxc/utils.c<br>
+index 6bee698..8e7ebbc 100644<br>
+--- a/src/lxc/utils.c<br>
++++ b/src/lxc/utils.c<br>
+@@ -1621,8 +1621,6 @@ static int open_without_symlink(const char *target, const char *prefix_skip)<br>
+                       errno = saved_errno;<br>
+                       if (errno == ELOOP)<br>
+                               SYSERROR("%s in %s was a symbolic link!", nextpath, target);<br>
+-                      else<br>
+-                              SYSERROR("Error examining %s in %s", nextpath, target);<br>
+                       goto out;<br>
+               }<br>
+       }<br>
+@@ -1667,8 +1665,11 @@ int safe_mount(const char *src, const char *dest, const char *fstype,<br>
+<br>
+       destfd = open_without_symlink(dest, rootfs);<br>
+       if (destfd < 0) {<br>
+-              if (srcfd != -1)<br>
++              if (srcfd != -1) {<br>
++                      saved_errno = errno;<br>
+                       close(srcfd);<br>
++                      errno = saved_errno;<br>
++              }<br>
+               return destfd;<br>
+       }<br>
+<br>
+--<br>
+1.9.1<br>
+<br>
diff --git a/recipes-containers/lxc/<a href="http://lxc_1.1.4.bb" rel="noreferrer" target="_blank">lxc_1.1.4.bb</a> b/recipes-containers/lxc/<a href="http://lxc_1.1.4.bb" rel="noreferrer" target="_blank">lxc_1.1.4.bb</a><br>
index e017dcf..2645f4b 100644<br>
--- a/recipes-containers/lxc/<a href="http://lxc_1.1.4.bb" rel="noreferrer" target="_blank">lxc_1.1.4.bb</a><br>
+++ b/recipes-containers/lxc/<a href="http://lxc_1.1.4.bb" rel="noreferrer" target="_blank">lxc_1.1.4.bb</a><br>
@@ -37,6 +37,9 @@ SRC_URI = "<a href="http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz" rel="noreferrer" target="_blank">http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz</a> \<br>
        file://open_without_symlink-Account-when-prefix-is-empty-st.patch \<br>
        file://lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch \<br>
        file://mount_proc_if_needed-only-safe-mount-when-rootfs-is-.patch \<br>
+       file://open_without_symlink-Don-t-SYSERROR-on-something-els.patch \<br>
+       file://lxc-busybox-Touch-etc-fstab-in-the-container-rootfs.patch \<br>
+       file://lxc-busybox-Remove-warning-for-dynamically-linked-Bu.patch \<br>
        "<br>
<br>
 SRC_URI[md5sum] = "d33c4bd9c57755c0e2b0e2acbc3f171d"<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
</font></span><br>--<br>
_______________________________________________<br>
meta-virtualization mailing list<br>
<a href="mailto:meta-virtualization@yoctoproject.org">meta-virtualization@yoctoproject.org</a><br>
<a href="https://lists.yoctoproject.org/listinfo/meta-virtualization" rel="noreferrer" target="_blank">https://lists.yoctoproject.org/listinfo/meta-virtualization</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"</div>
</div></div>