Skip to content

Commit

Permalink
chore(images/x86_64): try to fix remaining images.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP committed Jan 30, 2024
1 parent 4494fc9 commit cacf3f8
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion images/x86_64/centos/4.18/Dockerfile.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/
RUN dnf groupinstall -y 'Development Tools' && \
cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \
curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-8/-/raw/c8s/drivers/virtio/virtio_mmio.c' && \
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/4.18.0-497.el8.x86_64" make
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8.x86_64" make

FROM initrd-builder:0.0.1 AS stage2
COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/
Expand Down
2 changes: 1 addition & 1 deletion images/x86_64/centos/5.14/Dockerfile.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/
RUN dnf groupinstall -y 'Development Tools' && \
cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \
curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/raw/main/drivers/virtio/virtio_mmio.c' && \
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.14.0-325.el9.x86_64" make
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9.x86_64" make

FROM initrd-builder:0.0.1 AS stage2
COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/
Expand Down
43 changes: 25 additions & 18 deletions images/x86_64/oraclelinux/2.6/Dockerfile.kernel
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM initrd-builder:0.0.1 AS stage1

ARG VERSION=2.6.39-400.330.1
ARG URL='https://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/x86_64'

FROM initrd-builder:0.0.1 AS stage1

ARG VERSION
ARG URL

WORKDIR /home/ubuntu

RUN touch .placeholder && \
Expand All @@ -20,6 +23,9 @@ RUN touch .placeholder && \

FROM oraclelinux:7 as kmod-builder

ARG VERSION
ARG URL

WORKDIR /home/ubuntu
COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/
COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/
Expand All @@ -30,24 +36,25 @@ RUN yum groupinstall -y 'Development Tools' && \
yum install -y gcc && \
mkdir src && \
cd src && \
curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-2.6.39-400.330.1.el6uek.src.rpm' && \
curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-${VERSION}.el6uek.src.rpm' && \
rpm2cpio source.rpm > source.cpio && \
cpio -idmv < ./source.cpio && \
tar -xaf linux-2.6.39.tar.bz2 && \
tar -xaf linux-2.6.*.tar.bz2 && \
cd .. && \
cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \
find src -name virtio_mmio.c -exec cp -v {} . \; && \
sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \
echo KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/2.6.39-400.330.1.el6uek.x86_64/" make > cmd

#FROM initrd-builder:0.0.1 AS stage2
#
#COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/
#COPY --from=kmod-builder /home/ubuntu/virtio_mmio.ko /home/ubuntu/
#RUN cd /home/ubuntu/extracted && \
# /opt/initrd-builder/create.sh
#
#FROM scratch
#
#COPY --from=stage1 /home/ubuntu/extracted/vmlinux /boot/
#COPY --from=stage2 /home/ubuntu/out/initrd /boot/
#COPY --from=stage1 /home/ubuntu/.placeholder /lib/modules/
echo KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el6uek.x86_64/" make

FROM initrd-builder:0.0.1 AS stage2

COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/
COPY --from=kmod-builder /home/ubuntu/virtio_mmio.ko /home/ubuntu/
RUN cd /home/ubuntu/extracted && \
/opt/initrd-builder/create.sh

FROM scratch

COPY --from=stage1 /home/ubuntu/extracted/vmlinux /boot/
COPY --from=stage2 /home/ubuntu/out/initrd /boot/
COPY --from=stage1 /home/ubuntu/.placeholder /lib/modules/
6 changes: 3 additions & 3 deletions images/x86_64/oraclelinux/3.10/Dockerfile.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ RUN yum groupinstall -y 'Development Tools' && \
yum install -y gcc elfutils-libelf-devel && \
mkdir src && \
cd src && \
curl -Lo source.rpm 'https://oss.oracle.com/ol7/SRPMS-updates/kernel-3.10.0-1160.92.1.0.2.el7.src.rpm' && \
curl -Lo source.rpm 'https://oss.oracle.com/ol7/SRPMS-updates/kernel-${VERSION}.el7.src.rpm' && \
rpm2cpio source.rpm > source.cpio && \
cpio -idmv < ./source.cpio && \
tar -xaf linux-3.10.0-1160.92.1.el7.tar.xz && \
tar -xaf linux-3.10.*.tar.xz && \
cd .. && \
cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \
find src -name virtio_mmio.c -exec cp -v {} . \; && \
sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/3.10.0-1160.92.1.0.2.el7.x86_64/" make
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.x86_64/" make

FROM initrd-builder:0.0.1 AS stage2

Expand Down
2 changes: 1 addition & 1 deletion images/x86_64/oraclelinux/4.14/Dockerfile.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN yum groupinstall -y 'Development Tools' && \
cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \
curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v4.14/drivers/virtio/virtio_mmio.c' && \
sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/4.14.35-2047.526.2.el7uek.x86_64/" make
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7uek.x86_64/" make

FROM initrd-builder:0.0.1 AS stage2

Expand Down
2 changes: 1 addition & 1 deletion images/x86_64/oraclelinux/5.15/Dockerfile.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN yum groupinstall -y 'Development Tools' && \
cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \
curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \
sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.15.0-8.91.4.1.el9uek.x86_64/" make
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.x86_64/" make

FROM initrd-builder:0.0.1 AS stage2

Expand Down
2 changes: 1 addition & 1 deletion images/x86_64/oraclelinux/5.4/Dockerfile.kernel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN yum groupinstall -y 'Development Tools' && \
cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \
curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \
sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.4.17-2136.320.7.1.el8uek.x86_64/" make
KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8uek.x86_64/" make

FROM initrd-builder:0.0.1 AS stage2

Expand Down
2 changes: 1 addition & 1 deletion images/x86_64/ubuntu/6.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04

ARG VERSION=6.2.0-41-generic
ARG VERSION=6.2.0-36-generic

WORKDIR /home/ubuntu

Expand Down
2 changes: 1 addition & 1 deletion images/x86_64/ubuntu/6.2/Dockerfile.kernel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM initrd-builder:0.0.1 AS builder

ARG VERSION=6.2.0-41-generic
ARG VERSION=6.2.0-36-generic
ARG URL='http://mirrors.edge.kernel.org/ubuntu/pool/main/l/linux/'

WORKDIR /home/ubuntu
Expand Down

0 comments on commit cacf3f8

Please sign in to comment.