X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=inline;f=uname%2Fvirt_uname.ml;h=fff6d7fa0c2ba71b1e80d375ed2191292b466d8d;hb=06dc66931d11cb362dc17b5a20164f79950f55cf;hp=14a8bccabf79fa2b2b389cd0ae953bb2b54d62a7;hpb=4d9710538cd03554cf343f67bea4b0470561e1d0;p=virt-mem.git diff --git a/uname/virt_uname.ml b/uname/virt_uname.ml index 14a8bcc..fff6d7f 100644 --- a/uname/virt_uname.ml +++ b/uname/virt_uname.ml @@ -49,16 +49,20 @@ let () = with Not_found -> str in + (* Expect the first (sysname) field to always be "Linux", which is + * also a good way to tell if we're synchronized to the right bit of + * memory. + *) bitmatch bs with - | { sysname : 65*8 : string; + | { "Linux\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" : 65*8 : string; nodename : 65*8 : string; release : 65*8 : string; version : 65*8 : string; machine : 65*8 : string; domainname : 65*8 : string } -> - printf "%s: %s %s %s %s %s %s\n" + printf "%s: Linux %s %s %s %s %s\n" name - (truncate sysname) (truncate nodename) (truncate release) + (truncate nodename) (truncate release) (truncate version) (truncate machine) (truncate domainname) | { _ } -> eprintf (f_"%s: unexpected system_utsname in kernel image\n")