On Mon, May 21, 2018 at 02:56:53PM +0200, Pino Toscano wrote:
- (* Get/construct the version. XXX Read this from kernel file. *) + (* Get/construct the version from the vmlinuz file. + * XXX Read this from kernel file. + *) let version = - let prefix_len = String.length "/lib/modules/" in - String.sub modpath prefix_len (String.length modpath - prefix_len) in + String.sub vmlinuz 14 (String.length vmlinuz - 14) in
The assumption we can just chop up the vmlinuz filename at a particular point and get a version seems dubious. Does something else support this? 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/