diff mbox series

[1/1] Dockerfile: provide kernel for libguestfs-tools

Message ID 20200713220937.433105-1-xypron.glpk@gmx.de
State Superseded
Headers show
Series [1/1] Dockerfile: provide kernel for libguestfs-tools | expand

Commit Message

Heinrich Schuchardt July 13, 2020, 10:09 p.m. UTC
The libguestfs-tools use QEMU to mount an image file. This requires a Linux
kernel.

Install a kernel and make vmlinuz readable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 Dockerfile | 4 ++++
 1 file changed, 4 insertions(+)

--
2.27.0

Comments

Tom Rini July 13, 2020, 10:50 p.m. UTC | #1
On Tue, Jul 14, 2020 at 12:09:37AM +0200, Heinrich Schuchardt wrote:

> The libguestfs-tools use QEMU to mount an image file. This requires a Linux
> kernel.
> 
> Install a kernel and make vmlinuz readable.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  Dockerfile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Dockerfile b/Dockerfile
> index bc3cdee..aac7f01 100644
> --- a/Dockerfile
> +++ b/Dockerfile
> @@ -68,6 +68,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 \
> @@ -94,6 +95,9 @@ RUN apt-get update && apt-get install -y \
>  	zip \
>  	&& rm -rf /var/lib/apt/lists/*
> 
> +# libguestfs-tools runs the kernel via QEMU. Give normal users access.
> +RUN chmod 644 /boot/vmlinu*
> +
>  # Manually install libmpfr4 for the toolchains
>  RUN wget http://mirrors.kernel.org/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb && dpkg -i libmpfr4_3.1.4-1_amd64.deb && rm libmpfr4_3.1.4-1_amd64.deb

I'm not super happy with having to work-around Ubuntu's breakage here.
I assume we can't just write the tools to do sudo ... in the case of
this silliness?

At least we need to reference the Ubuntu bug I posted about the other
day in the commit message.
Heinrich Schuchardt July 13, 2020, 11:08 p.m. UTC | #2
Am 14. Juli 2020 00:50:56 MESZ schrieb Tom Rini <trini at konsulko.com>:
>On Tue, Jul 14, 2020 at 12:09:37AM +0200, Heinrich Schuchardt wrote:
>
>> The libguestfs-tools use QEMU to mount an image file. This requires a
>Linux
>> kernel.
>> 
>> Install a kernel and make vmlinuz readable.
>> 
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>> ---
>>  Dockerfile | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/Dockerfile b/Dockerfile
>> index bc3cdee..aac7f01 100644
>> --- a/Dockerfile
>> +++ b/Dockerfile
>> @@ -68,6 +68,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 \
>> @@ -94,6 +95,9 @@ RUN apt-get update && apt-get install -y \
>>  	zip \
>>  	&& rm -rf /var/lib/apt/lists/*
>> 
>> +# libguestfs-tools runs the kernel via QEMU. Give normal users
>access.
>> +RUN chmod 644 /boot/vmlinu*
>> +
>>  # Manually install libmpfr4 for the toolchains
>>  RUN wget
>http://mirrors.kernel.org/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb
>&& dpkg -i libmpfr4_3.1.4-1_amd64.deb && rm libmpfr4_3.1.4-1_amd64.deb
>
>I'm not super happy with having to work-around Ubuntu's breakage here.
>I assume we can't just write the tools to do sudo ... in the case of
>this silliness?

I do not want any sudo in scripts I run on my personal machine. The very idea of libguestfs-tools is to work in user space.

The kernel is used to run QEMU.

>
>At least we need to reference the Ubuntu bug I posted about the other
>day in the commit message.

It is not a bug, it is a (questionable) feature of Ubuntu. I described the reason for chmod in the code. What are you missing there?

Best regards

Heinrich
Tom Rini July 13, 2020, 11:47 p.m. UTC | #3
On Tue, Jul 14, 2020 at 01:08:24AM +0200, Heinrich Schuchardt wrote:
> Am 14. Juli 2020 00:50:56 MESZ schrieb Tom Rini <trini at konsulko.com>:
> >On Tue, Jul 14, 2020 at 12:09:37AM +0200, Heinrich Schuchardt wrote:
> >
> >> The libguestfs-tools use QEMU to mount an image file. This requires a
> >Linux
> >> kernel.
> >> 
> >> Install a kernel and make vmlinuz readable.
> >> 
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> >> ---
> >>  Dockerfile | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >> 
> >> diff --git a/Dockerfile b/Dockerfile
> >> index bc3cdee..aac7f01 100644
> >> --- a/Dockerfile
> >> +++ b/Dockerfile
> >> @@ -68,6 +68,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 \
> >> @@ -94,6 +95,9 @@ RUN apt-get update && apt-get install -y \
> >>  	zip \
> >>  	&& rm -rf /var/lib/apt/lists/*
> >> 
> >> +# libguestfs-tools runs the kernel via QEMU. Give normal users
> >access.
> >> +RUN chmod 644 /boot/vmlinu*
> >> +
> >>  # Manually install libmpfr4 for the toolchains
> >>  RUN wget
> >http://mirrors.kernel.org/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb
> >&& dpkg -i libmpfr4_3.1.4-1_amd64.deb && rm libmpfr4_3.1.4-1_amd64.deb
> >
> >I'm not super happy with having to work-around Ubuntu's breakage here.
> >I assume we can't just write the tools to do sudo ... in the case of
> >this silliness?
> 
> I do not want any sudo in scripts I run on my personal machine. The very idea of libguestfs-tools is to work in user space.
> 
> The kernel is used to run QEMU.

Right.

> >At least we need to reference the Ubuntu bug I posted about the other
> >day in the commit message.
> 
> It is not a bug, it is a (questionable) feature of Ubuntu. I described the reason for chmod in the code. What are you missing there?

I want a link to
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725 because yes,
it's a WONTFIX bug in Ubuntu, but it's also Wrong, in the commit
message.  Thanks!
diff mbox series

Patch

diff --git a/Dockerfile b/Dockerfile
index bc3cdee..aac7f01 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -68,6 +68,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 \
@@ -94,6 +95,9 @@  RUN apt-get update && apt-get install -y \
 	zip \
 	&& rm -rf /var/lib/apt/lists/*

+# libguestfs-tools runs the kernel via QEMU. Give normal users access.
+RUN chmod 644 /boot/vmlinu*
+
 # Manually install libmpfr4 for the toolchains
 RUN wget http://mirrors.kernel.org/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb && dpkg -i libmpfr4_3.1.4-1_amd64.deb && rm libmpfr4_3.1.4-1_amd64.deb