update-kernel/Dockerfile

54 lines
1.6 KiB
Docker
Raw Normal View History

FROM alt:sisyphus
# Trace execution.
SHELL ["/bin/bash", "-xec"]
ENV UPDATE_KERNEL_SYS_FLAVOUR=std-def
ARG branch=sisyphus
ARG repo=http://ftp.altlinux.org/pub/distributions/archive/$branch/date
Dockerfile: Update dates to make tests work again Date earlier than 2022/05/19 produce an error: + update-kernel -v -f --headers Running kernel: 5.17.15-un-def-alt1 is not from package Checking for available std-def kernel packages... Latest kernel is kernel-image-std-def-5.15.40-alt1 ATTENTION: Selected kernel is 1 months old. Kernel std-def version 5.15.40-alt1 has 43 external modules. Use -i to select what to install. Try to install new kernel kernel-image-std-def-5.15.40-alt1 and update its modules [Y/n]? yes + apt-get install -o APT::Install::Virtual=true -y kernel-image-std-def#2:5.15.40-alt1:sisyphus+300020.100.1.1@1652646109 kernel-headers-std-def kernel-headers-modules-std-def Reading Package Lists... Building Dependency Tree... Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: kernel-headers-modules-std-def: Depends: gcc11 E: Broken packages update-kernel: failed to install kernel-image-std-def-2:5.15.40-alt1:sisyphus+300020.100.1.1@1652646109 with modules The command '/bin/bash -xec toilet -w 150 First install && update-kernel -v -f --headers && ls -l /boot/vmlinuz /boot/vmlinuz-std-def /boot/initrd.img /boot/initrd-std-def.img && ls -l /boot/$(readlink /boot/vmlinuz)' returned a non-zero code: 1 make: *** [Makefile:8: docker-build] Error 1 Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2022-06-19 21:17:59 +03:00
ARG a=2022/05/19
ARG b=2022/06/12
# Initialize the system and start from some arbitrary date.
# update-kernel is installed just for dependencies.
RUN \
echo "rpm $repo/$a/ x86_64 classic" > /etc/apt/sources.list && \
echo "rpm $repo/$a/ noarch classic" >> /etc/apt/sources.list && \
rm /etc/apt/sources.list.d/*.list && \
apt-get update && \
apt-get install -y update-kernel toilet dkms
# Overwrite update-kernel with the local copy.
# Docker will notice and rebuild if files are changed.
COPY update-kernel remove-old-kernels /usr/sbin/
# Install base kernel for upgrading later.
# Check if the kernel appeared.
RUN toilet -w 150 First install && \
update-kernel -v -f --headers -A lkrg && \
ls -l /boot/vmlinuz /boot/vmlinuz-std-def /boot/initrd.img /boot/initrd-std-def.img && \
ls -l /boot/$(readlink /boot/vmlinuz)
# Second call should succeed not installing anything, thus
# no -f for it to fail if it will try to install something.
RUN update-kernel -v -t std-def
# Forward to some future.
RUN \
echo "rpm $repo/$b/ x86_64 classic" > /etc/apt/sources.list && \
echo "rpm $repo/$b/ noarch classic" >> /etc/apt/sources.list && \
apt-get update
# Update kernel.
RUN toilet Upgrading && \
update-kernel -v -f && \
update-kernel -v -l && \
ls -la /boot
RUN remove-old-kernels --all --verbose --force
COPY analyze-kmodules /usr/sbin/
# There now should be two kernels.