Richard W.M. Jones
2016-Sep-14 14:50 UTC
[Libguestfs] [PATCH 1/2] filearch: Add RISC-V architecture.
--- src/filearch.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/filearch.c b/src/filearch.c index 5985b73..cbc8372 100644 --- a/src/filearch.c +++ b/src/filearch.c @@ -56,14 +56,16 @@ cleanup_magic_t_free (void *ptr) # endif COMPILE_REGEXP (re_file_elf, - "ELF.*(MSB|LSB).*(?:executable|shared object|relocatable), (.+?),", 0) + "ELF (\\d+)-bit (MSB|LSB).*(?:executable|shared object|relocatable), (.+?),", 0) COMPILE_REGEXP (re_elf_ppc64, ".*64.*PowerPC", 0) /* Convert output from 'file' command on ELF files to the canonical * architecture string. Caller must free the result. */ static char * -canonical_elf_arch (guestfs_h *g, const char *endianness, const char *elf_arch) +canonical_elf_arch (guestfs_h *g, + const char *bits, const char *endianness, + const char *elf_arch) { const char *r; char *ret; @@ -98,10 +100,15 @@ canonical_elf_arch (guestfs_h *g, const char *endianness, const char *elf_arch) r = "aarch64"; else if (strstr (elf_arch, "ARM")) r = "arm"; + else if (strstr (elf_arch, "UCB RISC-V")) { + ret = safe_asprintf (g, "riscv%s", bits); + goto no_strdup; + } else r = elf_arch; ret = safe_strdup (g, r); + no_strdup: return ret; } @@ -120,6 +127,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok, int flags; CLEANUP_MAGIC_T_FREE magic_t m = NULL; const char *line; + CLEANUP_FREE char *bits = NULL; CLEANUP_FREE char *elf_arch = NULL; CLEANUP_FREE char *endianness = NULL; @@ -151,7 +159,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok, if (loading_ok) *loading_ok = true; - if (!match2 (g, line, re_file_elf, &endianness, &elf_arch)) { + if (!match3 (g, line, re_file_elf, &bits, &endianness, &elf_arch)) { error (g, "no re_file_elf match in '%s'", line); return NULL; } @@ -159,7 +167,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok, if (matched) *matched = true; - return canonical_elf_arch (g, endianness, elf_arch); + return canonical_elf_arch (g, bits, endianness, elf_arch); } /* Download and uncompress the cpio file to find binaries within. */ @@ -319,6 +327,7 @@ char * guestfs_impl_file_architecture (guestfs_h *g, const char *path) { CLEANUP_FREE char *file = NULL; + CLEANUP_FREE char *bits = NULL; CLEANUP_FREE char *elf_arch = NULL; CLEANUP_FREE char *endianness = NULL; char *ret = NULL; @@ -330,8 +339,8 @@ guestfs_impl_file_architecture (guestfs_h *g, const char *path) if (file == NULL) return NULL; - if ((match2 (g, file, re_file_elf, &endianness, &elf_arch)) != 0) - ret = canonical_elf_arch (g, endianness, elf_arch); + if ((match3 (g, file, re_file_elf, &bits, &endianness, &elf_arch)) != 0) + ret = canonical_elf_arch (g, bits, endianness, elf_arch); else if (strstr (file, "PE32 executable")) ret = safe_strdup (g, "i386"); else if (strstr (file, "PE32+ executable")) -- 2.9.3
Richard W.M. Jones
2016-Sep-14 14:50 UTC
[Libguestfs] [PATCH 2/2] Add riscv64 test binaries, and new tests of guestfs_file_architecture.
--- generator/actions.ml | 4 ++++ test-data/Makefile.am | 2 ++ test-data/binaries/Makefile.am | 2 ++ test-data/binaries/bin-riscv64-dynamic | Bin 0 -> 10728 bytes test-data/binaries/lib-riscv64.so | Bin 0 -> 7208 bytes 5 files changed, 8 insertions(+) create mode 100755 test-data/binaries/bin-riscv64-dynamic create mode 100755 test-data/binaries/lib-riscv64.so diff --git a/generator/actions.ml b/generator/actions.ml index 179902e..9053180 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -796,6 +796,8 @@ to specify the QEMU interface emulation to use at run time." }; InitISOFS, Always, TestResultString ( [["file_architecture"; "/bin-ppc64le-dynamic"]], "ppc64le"), []; InitISOFS, Always, TestResultString ( + [["file_architecture"; "/bin-riscv64-dynamic"]], "riscv64"), []; + InitISOFS, Always, TestResultString ( [["file_architecture"; "/bin-sparc-dynamic"]], "sparc"), []; InitISOFS, Always, TestResultString ( [["file_architecture"; "/bin-win32.exe"]], "i386"), []; @@ -814,6 +816,8 @@ to specify the QEMU interface emulation to use at run time." }; InitISOFS, Always, TestResultString ( [["file_architecture"; "/lib-ppc64le.so"]], "ppc64le"), []; InitISOFS, Always, TestResultString ( + [["file_architecture"; "/lib-riscv64.so"]], "riscv64"), []; + InitISOFS, Always, TestResultString ( [["file_architecture"; "/lib-sparc.so"]], "sparc"), []; InitISOFS, Always, TestResultString ( [["file_architecture"; "/lib-win32.dll"]], "i386"), []; diff --git a/test-data/Makefile.am b/test-data/Makefile.am index 93d094a..86cd5a2 100644 --- a/test-data/Makefile.am +++ b/test-data/Makefile.am @@ -41,6 +41,7 @@ image_files = \ $(srcdir)/binaries/bin-mipsel-dynamic \ $(srcdir)/binaries/bin-ppc64-dynamic \ $(srcdir)/binaries/bin-ppc64le-dynamic \ + $(srcdir)/binaries/bin-riscv64-dynamic \ $(srcdir)/binaries/bin-sparc-dynamic \ $(srcdir)/binaries/bin-win32.exe \ $(srcdir)/binaries/bin-win64.exe \ @@ -52,6 +53,7 @@ image_files = \ $(srcdir)/binaries/lib-mipsel.so \ $(srcdir)/binaries/lib-ppc64.so \ $(srcdir)/binaries/lib-ppc64le.so \ + $(srcdir)/binaries/lib-riscv64.so \ $(srcdir)/binaries/lib-sparc.so \ $(srcdir)/binaries/lib-win32.dll \ $(srcdir)/binaries/lib-win64.dll \ diff --git a/test-data/binaries/Makefile.am b/test-data/binaries/Makefile.am index 094cb35..ccc7d00 100644 --- a/test-data/binaries/Makefile.am +++ b/test-data/binaries/Makefile.am @@ -26,6 +26,7 @@ EXTRA_DIST = \ bin-mipsel-dynamic \ bin-ppc64-dynamic \ bin-ppc64le-dynamic \ + bin-riscv64-dynamic \ bin-sparc-dynamic \ bin-win32.exe \ bin-win64.exe \ @@ -37,6 +38,7 @@ EXTRA_DIST = \ lib-ppc64.so \ lib-ppc64le.so \ lib-mipsel.so \ + lib-riscv64.so \ lib-sparc.so \ lib-win32.dll \ lib-win64.dll \ diff --git a/test-data/binaries/bin-riscv64-dynamic b/test-data/binaries/bin-riscv64-dynamic new file mode 100755 index 0000000000000000000000000000000000000000..a8b4baa0ec221868ab0282eac96ff76c8c7b40ab GIT binary patch literal 10728 zcmeHNYiwM_6+W}q>vtTlH^E8M!Ul%|6}w&>+u1-uHhv^=8<Jo`3jyh}-o0Kg-G|v- zhd71e#DoOs55T-CMM_jrwf%!o`4QTxs1gDywLee`f=Yd$0)l_#As$sB?sw+SS?^wN zN?VD48R_2hK6B>WxwB{H?%kuicleYdX+HXpn0h(r^5RDD?t0N6ic^eQaSzegs1a;G zuDB7$wKdbOebna)1U4Hz3$Ov#w2@EyTz!EnjGjPOO4=*;xzws9L{A%k&l*Ubt|n`7 zoWg&$%e51D3kQTIu-cCMi*;x*#Uieqz;{je0>zHIXS;pIZlAFe__VPTD0$(W@HJ=R zpEG$87=nyjNZ(yuM#b)2<J(~L1+qT3eQ%djj8AiN7_N2$6Daxu#ctf#ohvWDHRBU# zNb1dICVI1}NU0FHlKW$S{D@e-bI%R96G`quz?G($Tie)f6)t{kY&Ww07oR`y!Vm9w z^r;u8Ui<aNzpM=$>1GS|#lHEf%$qn>W_<6Stsg^l&ejG=7p~u!_o1SQaU^*ZgJj!` z+of`%ShjPCOrCb`9vd3A`yzc&sJjnRAp(xUOh=k~=rM%j!yDwb&L~UWIqG6A|M4E8 zjn?zqt>>&4gVylp3r7L357PY4k5ZaCs5^ojT+{JF+UlSnOdfxKadF{@$}KecsT<EU z=s&h{en3&M@dyQPSBsCM*M)mu?C5TStZ8R=uvt;zy}$h{cwEgb9KU_;nd9%ogH3Nx z^3G3a6OtRWEJ`+76g;Np(#Upt4)(wop#RMAGx3GjHpLfS{lt3a*hjSR>gss%2mW)~ z1(jOti5{W(m(-D-{s1MPXrh0-ck0uHrcUZP@&4RAWL7_7RZ4L`XEp&pcKogRO@2x~ z(u6oqeR>9QFC1^8H}7vctNp>xJ9ACMwrp2;&;B@wakD+>&w64<d_B?iRyQVau%Y46 z?#lsNS{~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E+RX=5+>bEW*-<u-v2f~>Ze-@BKM{b^6aBp>4MF=H>|m!k*y-;F$f(f8Uv z>9Lo3{0YBnai<s>D9>NmPXWOpTxI@C-7f#%@#+gL@RzV%S!FMEQk<QliJnU>(ZYWb z0#1=hSEZia^#%6g?{`4>*@?aE7v%p{Pn-Npe*)$Cy#m|n{ww<mqY#3;x{1BOKS9X$ z(P|~&A!C2Bhi}5sHZ1x(F5y+H4jKD>)yz7&@7Lk6$-~B;kBh6DhosLT^zvALUzckY z_6R*Bj+5)#--XjoZVz}2JS24+`>3m4xi_1w+$MQ3j701OUTo|uh6dSYwsym!=&=`l z9-l`=i;kLw!yA`ZHvny!d*YMfPeLwrwa36i>b^Zg)P~QR{@0j==^}79;*xnM>l%MY Ss@MO^e0q%bnx{h#N&g1rIN~P& literal 0 HcmV?d00001 diff --git a/test-data/binaries/lib-riscv64.so b/test-data/binaries/lib-riscv64.so new file mode 100755 index 0000000000000000000000000000000000000000..764965cc798237e00835617d2fca52dda763b516 GIT binary patch literal 7208 zcmeHMU2GIp6h7N&+47^5Kf(VAV8lem@=x$(+htpdZ84=JXf(rgciOJ*kM2yNB}A(P z+wg>zAc;hHz(@><CKw?StM$bvABh@CBq0VLNGy?`_#pM1nfq;LXSb3VUrhEiv*(=e zo^$S*d+*HLd-`Ugy`?4+A&^FYkZ6;dkHl2NZx1MeS&TMQ9se$&g`REQbW@phrPhbQ zslnH!k6C<;-tX(9kCpNZDy46bn)0hrey5b*Ddh*gN7;kd`(a7akZZSU5A&7E4qR-7 zx_)(2BF~iPpo#~Mbj4>eUowoXox5o4#JA&TouAL%Jo=3LMdOvHw;Z`V#7$nijDz@j z;}O$EtQQ%%HzzJ#zj*b%13$gK`w@m`B#k{VZ!nTzI+Ot4#Pafh4zYy=9ZG;dIs=|! zyn*IZOb-~dxX;5IXj=$>RpDWKGTXX4%#>ZQ`_hhU7rHy*nS9Rfwt6zQ-&VQBOb%LR zZ#rjX()-zP`(Cq4MTloC$FUvCq<fNvl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N^SP$hgxTHH+@27tl#@66tz1gVT3cV}Z0cx>Gs@*I#A$8c(cIK-?r3S* zndmP1{Zn-eWvyT-EEWq?wY(}<N!hDHoy;r1RV=cR;S6P6tB1K;@OeL^T;8>fzTAM( zGmy@tR;N?sY5kVdPey7e$DTfS3x3O9yWphrxe~?Xwt}6p#DNUg9(2jD`~A5fV|p6M zn4Uc{UP-bWdsx|Yk_9R48GU(n<?<dGycn`P!KJJ6-)r(7lW#q0a`;|>uMC9_z3xcf zcenXl4*y|(4urt*oy2z@`v~8P>v=55-UI&FpMd|U45eSOfj{;sF~%e|{PCRx$Nq** zJW}aFrEM(n2BDZgzNg>|l_l~=Kj6E#UG_fE@!bX2mA~XKeItJbQ;G%Ln_&1pgP&1` z=pX*L{~WhVT<q`g9tOXz{K2HJAjv`!f8>wvJ$TqYtiQp&{Fe9TfLU>0fd4BXUuhG9 z4t|)i`F!F2uzxrrL78CZYtuULW85J5!yo&M<M;4KyboBAv4cOpOZY#`9tqBb`$oU0 zm!IagVE?3xHIp)cy$??35B(Dsg8taw)GL2^K7xdJ;Gc4%$jCpY`_{1;`j@_f^f@bn zH3mVJ;lDhD!yjCBSm--wx>EgL?W-WjGW-CGj<p9&c)!YDR|CJ8F)r~J*8|qSoI@)0 OKPnDPCqf;DRQenE*7olJ literal 0 HcmV?d00001 -- 2.9.3
Pino Toscano
2016-Sep-15 14:11 UTC
Re: [Libguestfs] [PATCH 1/2] filearch: Add RISC-V architecture.
On Wednesday, 14 September 2016 15:50:20 CEST Richard W.M. Jones wrote:> ---LGTM, just one question below.> + else if (strstr (elf_arch, "UCB RISC-V")) { > + ret = safe_asprintf (g, "riscv%s", bits); > + goto no_strdup; > + }Is this bit of output from `file` reliable at this point, or can it change in the future? I recall the RISC-V is a "new" architecture, so potential changes are not rare at this stage. Thanks, -- Pino Toscano
Richard W.M. Jones
2016-Sep-15 14:16 UTC
Re: [Libguestfs] [PATCH 1/2] filearch: Add RISC-V architecture.
On Thu, Sep 15, 2016 at 04:11:35PM +0200, Pino Toscano wrote:> On Wednesday, 14 September 2016 15:50:20 CEST Richard W.M. Jones wrote: > > --- > > LGTM, just one question below. > > > + else if (strstr (elf_arch, "UCB RISC-V")) { > > + ret = safe_asprintf (g, "riscv%s", bits); > > + goto no_strdup; > > + } > > Is this bit of output from `file` reliable at this point, or can it > change in the future? I recall the RISC-V is a "new" architecture, > so potential changes are not rare at this stage.It is the output of file, and I don't know if it could change in future. I suppose it's possible, but I don't have specific information. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Pino Toscano
2016-Sep-15 14:20 UTC
Re: [Libguestfs] [PATCH 1/2] filearch: Add RISC-V architecture.
On Wednesday, 14 September 2016 15:50:20 CEST Richard W.M. Jones wrote:> ---Ah, I forgot one thing:> + else if (strstr (elf_arch, "UCB RISC-V")) { > + ret = safe_asprintf (g, "riscv%s", bits); > + goto no_strdup; > + }I guess the "riscv16", "riscv32", and "riscv64" should be documented for the "file_architecture" API. Thanks, -- Pino Toscano
Richard W.M. Jones
2016-Sep-15 15:08 UTC
Re: [Libguestfs] [PATCH 1/2] filearch: Add RISC-V architecture.
On Thu, Sep 15, 2016 at 04:20:32PM +0200, Pino Toscano wrote:> On Wednesday, 14 September 2016 15:50:20 CEST Richard W.M. Jones wrote: > > --- > > Ah, I forgot one thing: > > > + else if (strstr (elf_arch, "UCB RISC-V")) { > > + ret = safe_asprintf (g, "riscv%s", bits); > > + goto no_strdup; > > + } > > I guess the "riscv16", "riscv32", and "riscv64" should be documented > for the "file_architecture" API.I pushed a few fixes upstream. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Maybe Matching Threads
- [PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
- [PATCH 12/27] daemon: Reimplement ‘file_architecture’ API in OCaml.
- [PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
- [PATCH v4 0/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
- [PATCH v4 1/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)