Openembedded Core Discussions
 help / color / mirror / Atom feed
* [dora][PATCH 0/2] populate-extfs.sh: two fixes
@ 2014-06-19  2:11 Chen Qi
  2014-06-19  2:11 ` [dora][PATCH 1/2] populate-extfs.sh: fix to handle /var/lib/opkg/alternatives/[[ correctly Chen Qi
  2014-06-19  2:11 ` [dora][PATCH 2/2] populate-extfs.sh: error out if debugfs encounters some error Chen Qi
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Qi @ 2014-06-19  2:11 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit b7371b49b4b83c2e864126480b65363fe9f2cfd2:

  x264: Update SRCREV to match commit in upstream git repo (2014-06-17 17:59:55 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib ChenQi/dora-populate-extfs
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/dora-populate-extfs

Chen Qi (2):
  populate-extfs.sh: fix to handle /var/lib/opkg/alternatives/[[
    correctly
  populate-extfs.sh: error out if debugfs encounters some error

 .../e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh   |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
1.7.9.5



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

* [dora][PATCH 1/2] populate-extfs.sh: fix to handle /var/lib/opkg/alternatives/[[ correctly
  2014-06-19  2:11 [dora][PATCH 0/2] populate-extfs.sh: two fixes Chen Qi
@ 2014-06-19  2:11 ` Chen Qi
  2014-06-19  2:11 ` [dora][PATCH 2/2] populate-extfs.sh: error out if debugfs encounters some error Chen Qi
  1 sibling, 0 replies; 3+ messages in thread
From: Chen Qi @ 2014-06-19  2:11 UTC (permalink / raw)
  To: openembedded-core

There was a patch trying to fix this problem by using 'dirname', but it
caused some build failures, thus got reverted.

The problem is that $DIR might be empty and we should first do the check
before trying to use $(dirname $DIR).

[YOCTO #5712]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh   |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh b/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
index 7de720b..da3954e 100644
--- a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
@@ -23,12 +23,13 @@ DEBUGFS="debugfs"
 	find $SRCDIR | while read FILE; do
                 TGT="${FILE##*/}"
                 DIR="${FILE#$SRCDIR}"
-                DIR="${DIR%$TGT}"
 
 		# Skip the root dir
 		[ ! -z "$DIR" ] || continue
 		[ ! -z "$TGT" ] || continue
 
+                DIR="$(dirname $DIR)"
+
 		if [ "$DIR" != "$CWD" ]; then
 			echo "cd $DIR"
 			CWD="$DIR"
-- 
1.7.9.5



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

* [dora][PATCH 2/2] populate-extfs.sh: error out if debugfs encounters some error
  2014-06-19  2:11 [dora][PATCH 0/2] populate-extfs.sh: two fixes Chen Qi
  2014-06-19  2:11 ` [dora][PATCH 1/2] populate-extfs.sh: fix to handle /var/lib/opkg/alternatives/[[ correctly Chen Qi
@ 2014-06-19  2:11 ` Chen Qi
  1 sibling, 0 replies; 3+ messages in thread
From: Chen Qi @ 2014-06-19  2:11 UTC (permalink / raw)
  To: openembedded-core

Previously, even if we encounter some error when populating the
ext filesystem, we don't error out and the rootfs process still
succeeds.

However, what's really expected is that the populate-extfs.sh script
should error out if something wrong happens when using `debugfs' to
generate the ext filesystem. For example, if there's not enough block
in the filesystem, and allocating a block for some file fails, the
failure should not be ignored. Otherwise, we will have a successful
build but a corrupted filesystem.

The debugfs returns 0 as long as the command is valid. That is, even
if the command fails, the debugfs still returns 0. That's really a
pain here. That's why this patch checks the error output to see whether
there's any error logged.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh   |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh b/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
index da3954e..23d97d3 100644
--- a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh
@@ -94,4 +94,9 @@ DEBUGFS="debugfs"
 		echo "sif $SRC links_count $LN_CNT"
 	done
 	rm -fr $INODE_DIR
-} | $DEBUGFS -w -f - $DEVICE
+} | $DEBUGFS -w -f - $DEVICE 2>&1 1>/dev/null | grep '.*: .*'
+
+if [ $? = 0 ]; then
+    echo "Some error occured while executing [$DEBUGFS -w -f - $DEVICE]"
+    exit 1
+fi
-- 
1.7.9.5



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

end of thread, other threads:[~2014-06-19  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19  2:11 [dora][PATCH 0/2] populate-extfs.sh: two fixes Chen Qi
2014-06-19  2:11 ` [dora][PATCH 1/2] populate-extfs.sh: fix to handle /var/lib/opkg/alternatives/[[ correctly Chen Qi
2014-06-19  2:11 ` [dora][PATCH 2/2] populate-extfs.sh: error out if debugfs encounters some error Chen Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox