[PATCH 1/2] defaultenv: only try to add partitions when partition description exists

Sascha Hauer s.hauer at pengutronix.de
Thu Jan 20 03:47:51 EST 2011


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 defaultenv/bin/init |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/defaultenv/bin/init b/defaultenv/bin/init
index 96a5716..877b541 100644
--- a/defaultenv/bin/init
+++ b/defaultenv/bin/init
@@ -4,15 +4,15 @@ PATH=/env/bin
 export PATH
 
 . /env/config
-if [ -e /dev/nor0 ]; then
+if [ -e /dev/nor0 -a -n "$nor_parts" ]; then
 	addpart /dev/nor0 $nor_parts
 fi
 
-if [ -e /dev/disk0 ]; then
+if [ -e /dev/disk0 -a -n "$disk_parts" ]; then
 	addpart /dev/disk0 $disk_parts
 fi
 
-if [ -e /dev/nand0 ]; then
+if [ -e /dev/nand0 -a -n "$nand_parts" ]; then
 	addpart /dev/nand0 $nand_parts
 
 	# Uh, oh, hush first expands wildcards and then starts executing
-- 
1.7.2.3




More information about the barebox mailing list