public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta: image: detect broken symlinks
@ 2018-02-27 17:23 Henning Schild
  2018-03-02 12:20 ` Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Henning Schild @ 2018-02-27 17:23 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild

Switch get_image_name from os.path.lexists to os.path.exists because the
latter detects broken symlinks correctly.

Issue:
If you build a kernel without CONFIG_BLK_DEV_INITRD the postinst hook will
still call "linux-update-symlinks" and create a broken symlink. After
that os.path.lexists will return True and "sudo cp" in do_copy_boot_files
will fail.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 2c255f4..46d3560 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -8,7 +8,7 @@ IMAGE_ROOTFS   = "${WORKDIR}/rootfs"
 def get_image_name(d, name_link):
     S = d.getVar("IMAGE_ROOTFS", True)
     path_link = os.path.join(S, name_link)
-    if os.path.lexists(path_link):
+    if os.path.exists(path_link):
         return os.path.basename(os.path.realpath(path_link))
     return ""
 
-- 
2.16.1


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

end of thread, other threads:[~2018-03-27 13:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 17:23 [PATCH] meta: image: detect broken symlinks Henning Schild
2018-03-02 12:20 ` Jan Kiszka
2018-03-02 16:30 ` Alexander Smirnov
2018-03-04 19:28   ` Alexander Smirnov
2018-03-04 19:49     ` Jan Kiszka
2018-03-05 18:49     ` Henning Schild
2018-03-09 15:26 ` [PATCH v3] " Henning Schild
2018-03-20 13:42   ` Henning Schild
2018-03-27 13:50     ` Alexander Smirnov

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