[Libguestfs] [PATCH] inspect: Get architecture of Alpine Linux from /bin/busybox.

Richard W.M. Jones rjones at redhat.com
Tue Jan 26 15:54:46 UTC 2016


All the files in /bin are links to busybox.  guestfs_file_architecture
doesn't follow symlinks so it fails.  Therefore check /bin/busybox
(not a symlink) to find the architecture.
---
 src/inspect-fs-unix.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index f915e86..6aaf5a1 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -1077,7 +1077,8 @@ static void
 check_architecture (guestfs_h *g, struct inspect_fs *fs)
 {
   const char *binaries[] =
-    { "/bin/bash", "/bin/ls", "/bin/echo", "/bin/rm", "/bin/sh" };
+    { "/bin/bash", "/bin/ls", "/bin/echo", "/bin/rm", "/bin/sh",
+      "/bin/busybox" };
   size_t i;
   char *arch;
 
-- 
2.5.0




More information about the Libguestfs mailing list