[yocto] [PATCH] oeqa/controllers/beaglebonetarget.py: fix deploy when kernel file is a broken link

Corneliu Stoicescu corneliux.stoicescu at intel.com
Fri Jul 11 09:03:24 PDT 2014


Sometimes the uncompressed rootfs image contains boot/uImage but if it's a symlink, it seems broken from the master image's point of view.
Because [ -e /mnt/testrootfs/boot/uImage ] will return 1, it will proceed to copy the backup kernel file over it but cp ~/test-kernel /mnt/testrootfs/boot/uImage will also fail with:
cp: not writing through dangling symlink

Adding a new check here, if the boot/uImage is a link, leave it as is.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu at intel.com>
---
 meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py b/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
index b2e9050..0f1aeb3 100644
--- a/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
+++ b/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
@@ -45,7 +45,7 @@ class BeagleBoneTarget(MasterImageHardwareTarget):
                 'mount -L testrootfs /mnt/testrootfs',
                 'rm -rf /mnt/testrootfs/*',
                 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
-                '[ -e /mnt/testrootfs/boot/uImage ] || cp ~/test-kernel /mnt/testrootfs/boot/uImage',
+                '[ -e /mnt/testrootfs/boot/uImage ] || [ -L /mnt/testrootfs/boot/uImage ] || cp ~/test-kernel /mnt/testrootfs/boot/uImage',
                 ]
 
         for _, dtbfn in self.dtbs.iteritems():
-- 
1.8.3.2




More information about the yocto mailing list