update-kernel: Allow to define system flavour for testing purposes

For Docker CI test.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Виталий Чикунов 2022-04-09 10:57:03 +03:00
parent 240e64218c
commit 3c97a575dd
2 changed files with 11 additions and 5 deletions

View File

@ -3,6 +3,8 @@ 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
ARG a=2022/01/01
@ -24,7 +26,7 @@ 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 -t std-def -f --headers && \
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)
@ -40,7 +42,7 @@ RUN \
# Update kernel.
RUN toilet Upgrading && \
update-kernel -v -t std-def -f && \
update-kernel -v -f && \
update-kernel -v -l && \
ls -la /boot

View File

@ -303,9 +303,13 @@ elif [[ "$release" =~ ^(kernel-image-)?.*[-=#][0-9:]+\.[0-9.]+-[^-]+$ ]]; then
fi
# set kernel flavour. if not defined with -t option, use current
current_kernel_flavour=$uname_r
current_kernel_flavour="${current_kernel_flavour#*-}"
current_kernel_flavour="${current_kernel_flavour%-*}"
if [ -n "$UPDATE_KERNEL_SYS_FLAVOUR" ]; then
current_kernel_flavour=$UPDATE_KERNEL_SYS_FLAVOUR
else
current_kernel_flavour=$uname_r
current_kernel_flavour="${current_kernel_flavour#*-}"
current_kernel_flavour="${current_kernel_flavour%-*}"
fi
kernel_flavour="${kernel_flavour:-$current_kernel_flavour}"
###################################################################