On 6/21/21 8:12 PM, Alper Nebi Yasak wrote:
On 14/06/2021 20:29, Heinrich Schuchardt wrote:
On 6/13/21 4:07 PM, Alper Nebi Yasak wrote:
supermin: failed to find a suitable kernel (host_cpu=x86_64).
I looked for kernels in /boot and modules in /lib/modules.
[...]
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index d2f0074ee8a6..563b16639e54 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -71,6 +71,7 @@ RUN apt-get update && apt-get install -y \
libssl-dev \
libudev-dev \
libusb-1.0-0-dev \
+ linux-image-kvm \
lzma-alone \
lzop \
mount \
@@ -99,6 +100,9 @@ RUN apt-get update && apt-get install -y \
zip \
&& rm -rf /var/lib/apt/lists/*
+# Make kernels readable for libguestfs tools to work correctly
+RUN chmod +r /boot/vmlinu* /lib/modules/*/vmlinu* || true
/lib/modules/4.15.0-1092-kvm# find . -name 'vm*'
does not find any file.
We don't need '|| true' if you do not refer to non-existent files.
I included both dirs as libguestfs checks both of them. If that doesn't
convince you, I can send a v3 with just `chmod +r /boot/vmlinu*`.
We are on Ubuntu. We only need to consider files that Ubuntu actually
provides.
Best regards
Heinrich
I actually misread the error message above as mentioning both dirs for
kernel so I didn't explicitly write it in the commit message, but the
source code [1] confirms that both are checked.
[1]
https://github.com/libguestfs/supermin/blob/master/src/format_ext2_kernel.ml#L28-L49
(sorry for the late reply)