George Prekas
2022-Apr-05 03:13 UTC
[Libguestfs] [supermin PATCH 0/1] Fix for missing /lib/modules.
When running guestfish without a /lib/modules directory, the following
error message appears:
supermin: ext2: populating from base image
supermin: ext2: copying files from host filesystem
supermin: ext2: copying kernel modules
supermin: error: lstat: No such file or directory: /lib/modules
libguestfs: error: /usr/bin/supermin exited with error status 1, see debug
messages above
Even though I set the environment variable $SUPERMIN_MODULES, supermin
expects to find the /lib/modules directory.
Note: I tried to use ext2fs_mkdir, but an error message that I didn't know
how to fix:
File "ext2fs.ml", line 29, characters 24-93:
29 | external ext2fs_mkdir : t -> string -> string -> int ->
int-> int -> int-> int -> int -> unit =
"supermin_ext2fs_mkdir"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: An external function with more than 5 arguments requires a second stub
function
George Prekas (1):
Fix for missing /lib/modules.
src/format_ext2.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.35.1
George Prekas
2022-Apr-05 03:13 UTC
[Libguestfs] [supermin PATCH 1/1] Fix for missing /lib/modules.
Even when supplied with $SUPERMIN_MODULES, supermin tries to access
/lib/modules. This directory does not exist by default in all the
environments.
---
src/format_ext2.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/format_ext2.ml b/src/format_ext2.ml
index e311ea6..2783473 100644
--- a/src/format_ext2.ml
+++ b/src/format_ext2.ml
@@ -95,8 +95,8 @@ let build_ext2 debug basedir files modpath kernel_version
appliance size
printf "supermin: ext2: copying kernel modules\n%!";
(* Import the kernel modules. *)
- ext2fs_copy_file_from_host fs "/lib" "/lib";
- ext2fs_copy_file_from_host fs "/lib/modules"
"/lib/modules";
+ ext2fs_copy_file_from_host fs "/" "/lib";
+ ext2fs_copy_file_from_host fs "/" "/lib/modules";
ext2fs_copy_dir_recursively_from_host fs
modpath ("/lib/modules/" ^ kernel_version);
--
2.35.1