Skip to contentSkip to conversation

3 new patches for the self-hosted-image work

PATCH Applied Dexuan Cui 3 participants 10 messages Dec 1, 2011 – Dec 2, 2011

lore
Share & tools
lore

Dexuan Cui

author
#0 lore raw

cover 3 new patches for the self-hosted-image work

The following changes since commit d7cd934376ae1edaf7055ec635eb3c85fdbf58b3:

squashfs-tools: fix PR, those should start with 'r' (2011-11-30 23:37:44 +0000)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib dcui/self-hosted-v4
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dcui/self-hosted-v4

Dexuan Cui (3):
make: expand MAKEFLAGS before we re-exec after rebuilding makefiles.
task-self-hosted: install sudo, tun.ko, iptables, libgl and libgl-dev
into the target
runqemu-ifup, runqemu-internal: be wiser when locating the network
tools

 meta/recipes-core/tasks/task-self-hosted.bb        |   14 +++++--
 .../make/make-3.82/expand_MAKEFLAGS.patch          |   39 ++++++++++++++++++++
 meta/recipes-devtools/make/make_3.82.bb            |    4 ++-
 scripts/runqemu-ifup                               |    8 +++--
 scripts/runqemu-internal                           |    3 +-
 5 files changed, 59 insertions(+), 9 deletions(-)
 create mode 100644 meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch
Signature · 1 line
1.7.6
author
#1 lore raw

PATCH 1/3 make: expand MAKEFLAGS before we re-exec after rebuilding makefiles.

This patch was got from the upstream cvs repo of make to fix the bug of make-3.82: http://savannah.gnu.org/bugs/?30723

---
 .../make/make-3.82/expand_MAKEFLAGS.patch          |   39 ++++++++++++++++++++
 meta/recipes-devtools/make/make_3.82.bb            |    4 ++-
 2 files changed, 42 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch
meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch new file +39 -0
new file mode 100644
index 0000000..4184937
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [The fix is already in upstream cvs repo, but not in the stable release]
+
+When working on the self-hosted-image work, I found in the target
+"bitbake eglibc-initial -c install" always failed:
+
+make[1]: Entering directory `/raid/pe2/build/tmp/work/i586-poky-linux/eglibc-initial-2.13-r18+svnr14157/eglibc-2_13/libc'
+/usr/bin/install -c -m 644 include/limits.h /usr/include/limits.h
+/usr/bin/install: cannot remove `/usr/include/limits.h': Permission denied
+make[1]: *** [/usr/include/limits.h] Error 1
+make[1]: Leaving directory `/raid/pe2/build/tmp/work/i586-poky-linux/eglibc-initial-2.13-r18+svnr14157/eglibc-2_13/libc'
+make: *** [install-headers] Error 2
+ERROR: oe_runmake faile
+
+Debugging shows the install_root variable in eglibc's makefiles is strangely
+reset at some place.
+
+Further investigation shows this is a bug of make-3.82:
+
+http://savannah.gnu.org/bugs/?30723
+http://cvs.savannah.gnu.org/viewvc/make/main.c?root=make&r1=1.243&r2=1.244
+http://old.nabble.com/-bug--30723--implicit-re-executing-of-subdirs-breaks-$(origin)-with-make-3.82-td29394353.html
+
+The patch was got from the second link above(the upstream cvs repo of make).
+
+Thu Dec  1 16:05:59 CST 2011
+Signed-off-by: Dexuan Cui <[email protected]>
+
+diff -Nru make-3.82.orig//main.c make-3.82/main.c
+--- make-3.82.orig//main.c	2010-07-19 15:10:53.000000000 +0800
++++ make-3.82/main.c	2011-12-01 16:04:11.818522186 +0800
+@@ -2093,7 +2093,7 @@
+             const char *pv = define_makeflags (1, 1);
+             char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
+             sprintf (p, "MAKEFLAGS=%s", pv);
+-            putenv (p);
++            putenv (allocated_variable_expand (p));
+           }
+ 
+ 	  if (ISDB (DB_BASIC))
meta/recipes-devtools/make/make_3.82.bb +3 -1
index 61fbb32..bea3339 100644
@@ -1,8 +1,10 @@
-PR = "r0"
+PR = "r1"
 LICENSE="GPLv3&LGPLv2"
 LIC_FILES_CHKSUM = "file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
                     file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
 require make.inc
 
+SRC_URI += "file://expand_MAKEFLAGS.patch"
+
 SRC_URI[md5sum] = "1a11100f3c63fcf5753818e59d63088f"
 SRC_URI[sha256sum] = "e2c1a73f179c40c71e2fe8abf8a8a0688b8499538512984da4a76958d0402966"
Signature · 1 line
1.7.6
#2 lore raw

Re: [PATCH 1/3] make: expand MAKEFLAGS before we re-exec after rebuilding makefiles.

Op 1 dec. 2011, om 10:21 heeft Dexuan Cui het volgende geschreven:

Quoted 16 lines

This patch was got from the upstream cvs repo of make to fix the bug of make-3.82: http://savannah.gnu.org/bugs/?30723

---
.../make/make-3.82/expand_MAKEFLAGS.patch | 39 ++++++++++++++++++++
meta/recipes-devtools/make/make_3.82.bb | 4 ++-

2 files changed, 42 insertions(+), 1 deletions(-)

create mode 100644 meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch

meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch new file +0 -0
new file mode 100644
index 0000000..4184937

meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch line 1

Quoted 1 line
meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch new file +1 -0
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [The fix is already in upstream cvs repo, but not in the stable release]

Isn't 'backport' a better description than 'inappropriate'?

regards,

Koen

#3 lore raw

Re: [PATCH 1/3] make: expand MAKEFLAGS before we re-exec after rebuilding makefiles.

Quoted 12 lines · Koen Kooi

Op 1 dec. 2011, om 10:21 heeft Dexuan Cui het volgende geschreven:

Quoted 10 lines

This patch was got from the upstream cvs repo of make to fix the bug of make-3.82: http://savannah.gnu.org/bugs/?30723

---
.../make/make-3.82/expand_MAKEFLAGS.patch | 39 ++++++++++++++++++++
meta/recipes-devtools/make/make_3.82.bb | 4 ++-

2 files changed, 42 insertions(+), 1 deletions(-)

create mode 100644 meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch

Quoted 9 lines

meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch line 1

Quoted 7 lines
meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch new file +1 -0
new file mode 100644
index 0000000..4184937
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [The fix is already in upstream cvs repo, but not in the stable release]

Isn't 'backport' a better description than 'inappropriate'?

Agreed, I've taken this patch but changed the patch status to backport.

Cheers,

Richard

#4 lore raw

Re: [PATCH 1/3] make: expand MAKEFLAGS before we re-exec after rebuilding makefiles.

Richard Purdie wrote on 2011-12-01:

Quoted 21 lines · Koen Kooi
Quoted 20 lines

Op 1 dec. 2011, om 10:21 heeft Dexuan Cui het volgende geschreven:

Quoted 17 lines

This patch was got from the upstream cvs repo of make to fix the bug of
make-3.82: http://savannah.gnu.org/bugs/?30723

.../make/make-3.82/expand_MAKEFLAGS.patch | 39
++++++++++++++++++++ meta/recipes-devtools/make/make_3.82.bb
| 4 ++- 2 files changed, 42 insertions(+), 1 deletions(-) create
mode 100644 meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch

diff --git a/meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch b/meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch new file mode 100644 index 0000000..4184937 --- /dev/null +++ b/meta/recipes-devtools/make/make-3.82/expand_MAKEFLAGS.patch @@ -0,0 +1,39 @@ +Upstream-Status: Inappropriate [The fix is already in upstream +cvs repo, but not in the stable release]

Quoted 3 lines
Quoted 1 line

Isn't 'backport' a better description than 'inappropriate'?

Agreed, I've taken this patch but changed the patch status to backport.

Thanks a lot, Richard and Koen!

Thanks,
-- Dexuan

author
#5 lore raw

PATCH 2/3 task-self-hosted: install sudo, tun.ko, iptables, libgl and libgl-dev into the target

In reply to Dexuan Cui

sudo, kernel-module-tun and iptables are needed by runqemu. strace has appeared in RDEPENDS_task-self-hosted-debug, so let's remove it from RDEPENDS_task-self-hosted-extended.
install libglu and libgl-dev rather than mesa-dri and mesa-dri-dev due to the recent commit "mesa: package gl/egl/osmesa to separate packages".

---
 meta/recipes-core/tasks/task-self-hosted.bb |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
meta/recipes-core/tasks/task-self-hosted.bb +10 -4
index c218f43..b3a68b4 100644
@@ -3,7 +3,7 @@
 #
 
 DESCRIPTION = "Create Basic Image Tasks"
-PR = "r0"
+PR = "r1"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
@@ -142,8 +142,8 @@ RDEPENDS_task-self-hosted-extended = "\
     rpm \
     screen \
     setserial \
-    strace \
     subversion \
+    sudo \
     sysstat \
     tar \
     gzip \
@@ -159,13 +159,19 @@ RDEPENDS_task-self-hosted-extended = "\
     zip \
     zlib \
     cpio \
+    iptables \
+    kernel-module-tun \
+    kernel-module-iptable-raw \
+    kernel-module-iptable-nat \
+    kernel-module-iptable-mangle \
+    kernel-module-iptable-filter \
     "
 
 
 RDEPENDS_task-self-hosted-graphics = "\
     python-pygtk \
-    mesa-dri \
-    mesa-dri-dev \
+    libgl \
+    libgl-dev \
     libglu \
     libglu-dev \
     libsdl \
Signature · 1 line
1.7.6
#6 lore raw

Re: [PATCH 2/3] task-self-hosted: install sudo, tun.ko, iptables, libgl and libgl-dev into the target

Quoted 11 lines · Dexuan Cui

sudo, kernel-module-tun and iptables are needed by runqemu. strace has appeared in RDEPENDS_task-self-hosted-debug, so let's remove it from RDEPENDS_task-self-hosted-extended.
install libglu and libgl-dev rather than mesa-dri and mesa-dri-dev due to the recent commit "mesa: package gl/egl/osmesa to separate packages".

---
 meta/recipes-core/tasks/task-self-hosted.bb |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

Merged to master, thanks.

Richard

author
#7 lore raw

PATCH 3/3 runqemu-ifup, runqemu-internal: be wiser when locating the network tools

In reply to Dexuan Cui

When working on the self-hosted-image work, I found the PATH variable in the Level-1 target doesn't have /sbin and /usr/sbin, so "runqemu" can't run properly since the tools are installeld at
/sbin/ifconfig
/sbin/route
/usr/sbin/iptables

The patch is used to fix the issue by setting a temp PATH when running which.

---
 scripts/runqemu-ifup     |    8 +++++---
 scripts/runqemu-internal |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)
scripts/runqemu-ifup +5 -3
index 870cb6b..9e697a8 100755
@@ -64,7 +64,9 @@ if [ $STATUS -ne 0 ]; then
 	exit 1
 fi
 
-IFCONFIG=`which ifconfig 2> /dev/null`
+PATH_TMP="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+
+IFCONFIG=`{ PATH=$PATH:$PATH_TMP; which ifconfig 2> /dev/null; }`
 if [ "x$IFCONFIG" = "x" ]; then
 	# better than nothing...
 	IFCONFIG=/sbin/ifconfig
@@ -74,7 +76,7 @@ if [ ! -x "$IFCONFIG" ]; then
 	exit 1
 fi
 
-ROUTE=`which route`
+ROUTE=`{ PATH=$PATH:$PATH_TMP; which route 2>/dev/null; }`
 if [ "x$ROUTE" = "x" ]; then
 	# better than nothing...
 	ROUTE=/sbin/route
@@ -84,7 +86,7 @@ if [ ! -x "$ROUTE" ]; then
 	exit 1
 fi
 
-IPTABLES=`which iptables 2> /dev/null`
+IPTABLES=`{ PATH=$PATH:$PATH_TMP; which iptables 2> /dev/null; }`
 if [ "x$IPTABLES" = "x" ]; then
 	IPTABLES=/sbin/iptables
 fi
scripts/runqemu-internal +2 -1
index 2968ed9..3214fde 100755
@@ -141,7 +141,8 @@ if [ ! -d "$LOCKDIR" ]; then
     chmod 777 $LOCKDIR
 fi
 
-IFCONFIG=`which ifconfig 2> /dev/null`
+PATH_TMP="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+IFCONFIG=`{ PATH=$PATH:$PATH_TMP; which ifconfig 2> /dev/null; }`
 if [ -z "$IFCONFIG" ]; then
     IFCONFIG=/sbin/ifconfig
 fi
Signature · 1 line
1.7.6
#8 lore raw

Re: [PATCH 3/3] runqemu-ifup, runqemu-internal: be wiser when locating the network tools

Quoted 20 lines · Dexuan Cui

When working on the self-hosted-image work, I found the PATH variable in the Level-1 target doesn't have /sbin and /usr/sbin, so "runqemu" can't run properly since the tools are installeld at
/sbin/ifconfig
/sbin/route
/usr/sbin/iptables

The patch is used to fix the issue by setting a temp PATH when running which.

---
 scripts/runqemu-ifup     |    8 +++++---
 scripts/runqemu-internal |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)
scripts/runqemu-ifup +0 -0
index 870cb6b..9e697a8 100755

scripts/runqemu-ifup if [ $STATUS -ne 0 ]; then · line 72

Quoted 10 lines
scripts/runqemu-ifup +3 -1
@@ -64,7 +64,9 @@ if [ $STATUS -ne 0 ]; then
 	exit 1
 fi
 
-IFCONFIG=`which ifconfig 2> /dev/null`
+PATH_TMP="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+
+IFCONFIG=`{ PATH=$PATH:$PATH_TMP; which ifconfig 2> /dev/null; }`
 if [ "x$IFCONFIG" = "x" ]; then
 	# better than nothing...
 	IFCONFIG=/sbin/ifconfig

I don't really like this, its getting hard to understand whats going on. Can we abstract this to a function which tries PATH, then tries our own PATH_TMP? This would reduce code duplication and makes it clearer what the code is doing...

Cheers,

Richard

#9 lore raw

Re: [PATCH 3/3] runqemu-ifup, runqemu-internal: be wiser when locating the network tools

Richard Purdie wrote on 2011-12-01:

Quoted 26 lines · Dexuan Cui
Quoted 25 lines

When working on the self-hosted-image work, I found the PATH variable in the
Level-1 target doesn't have /sbin and /usr/sbin, so "runqemu" can't run properly since the tools are installeld at /sbin/ifconfig /sbin/route /usr/sbin/iptables

The patch is used to fix the issue by setting a temp PATH when running which.

---
 scripts/runqemu-ifup     |    8 +++++---
 scripts/runqemu-internal |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)
scripts/runqemu-ifup index renamed from scripts/runqemu-ifup +0 -0

870cb6b..9e697a8 100755

scripts/runqemu-ifup +3 -1
@@ -64,7 +64,9 @@ if [ $STATUS -ne 0 ]; then
 	exit 1
 fi
-IFCONFIG=`which ifconfig 2> /dev/null`
+PATH_TMP="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+
+IFCONFIG=`{ PATH=$PATH:$PATH_TMP; which ifconfig 2> /dev/null; }`
Quoted 8 lines

scripts/runqemu-ifup if [ $STATUS -ne 0 ]; then · line 72

Quoted 3 lines
scripts/runqemu-ifup +0 -0
 if [ "x$IFCONFIG" = "x" ]; then
 	# better than nothing...
 	IFCONFIG=/sbin/ifconfig

I don't really like this, its getting hard to understand whats going on. Can we abstract this to a function which tries PATH, then tries our own PATH_TMP? This would reduce code duplication and makes it clearer what the code is doing...

Good suggestion!
I'll re-make the patch and re-send it out.
BTW, since I'll be on leave later today, I might not be able to finish this today. I discussed with Saul and he could kindly help me to finish this. :-)

Thanks,
-- Dexuan