Skip to contentSkip to conversation

oeqa/controllers/beaglebonetarget.py: fix conditions for files copied to /boot

PATCH Superseded Corneliu Stoicescu 2 participants 2 messages May 28, 2014 – May 29, 2014

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 oeqa/controllers/beaglebonetarget.py: fix conditions for files copied to /boot

We need to check if the uImage file exists before copying it to /mnt/testrootfs/boot/.
Using '[ ! -e /mnt/testrootfs/boot/uImage ] && cp ~/test-kernel /mnt/testrootfs/boot/uImage' would result in exit code 1 if the first condition is not met. Changing the code to return exit status 0 if /mnt/testrootfs/boot/uImage exists.

Without this if the file /mnt/testrootfs/boot/uImage exists then the image deploy task would stop and do_testimage would fail.

Also adding this change to dtb files check.

---
 meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py +2 -2
index 53f454b..0d148d7 100644
@@ -41,12 +41,12 @@ class BeagleBoneTarget(MasterImageHardwareTarget):
                 'mount -L testrootfs /mnt/testrootfs',
                 'rm -rf /mnt/testrootfs/*',
                 'tar xzvf ~/test-rootfs.tar.gz -C /mnt/testrootfs',
-                '[ ! -e /mnt/testrootfs/boot/uImage ] && cp ~/test-kernel /mnt/testrootfs/boot/uImage',
+                '[ -e /mnt/testrootfs/boot/uImage ] || cp ~/test-kernel /mnt/testrootfs/boot/uImage',
                 ]
 
         for _, dtbfn in self.dtbs:
             # Kernel and dtb files may not be in the image, so copy them if not
-            self.deploy_cmds.append('[ ! -e /mnt/testrootfs/boot/{0} ] && cp ~/{0} /mnt/testrootfs/boot/'.format(dtbfn))
+            self.deploy_cmds.append('[ -e /mnt/testrootfs/boot/{0} ] || cp ~/{0} /mnt/testrootfs/boot/'.format(dtbfn))
 
         if not self.serialcontrol_cmd:
             bb.fatal("This TEST_TARGET needs a TEST_SERIALCONTROL_CMD defined in local.conf.")
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 5 lines · Corneliu Stoicescu

We need to check if the uImage file exists before copying it to /mnt/testrootfs/boot/.
Using '[ ! -e /mnt/testrootfs/boot/uImage ] && cp ~/test-kernel /mnt/testrootfs/boot/uImage' would result in exit code 1 if the first condition is not met. Changing the code to return exit status 0 if /mnt/testrootfs/boot/uImage exists.

Without this if the file /mnt/testrootfs/boot/uImage exists then the image deploy task would stop and do_testimage would fail.

Nitpicking, could you please wrap the commit log to about 72 characters or so?

Thanks,
Kevin