Skip to content

Commit ae5349e

Browse files
authoredNov 25, 2024
🐧 Enable boot assesment for UKI (#3034)
1 parent ab7b23f commit ae5349e

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed
 

‎images/Dockerfile.kairos-ubuntu

+10-11
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,23 @@ RUN rm -rf /tmp/nohang.deb
105105

106106
# This target is aimed at UKI images and avoids to install GRUB and any other unnecesary packages
107107
# to the image because there are limitations on the total size
108+
# systemd-boot is neccesary as it brings the /usr/lib/systemd/systemd-bless-boot for boot assesment
108109
FROM common AS systemd-boot
109110
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
110111
RUN apt-get update && apt-get install -y --no-install-recommends \
111112
iucode-tool \
112113
kmod \
113114
linux-base \
115+
systemd-boot \
114116
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
115117
# for UKI, install the linux-modules pkg if no modules are found
116118
RUN [ -z "$(ls -A /lib/modules/)" ] && apt-get update && apt-get install -y --no-install-recommends \
117119
"$(apt-cache search linux-modules | grep -oP 'linux-modules-\d+.\d+.\d+-\d+-generic' | sort -V | tail -1)" \
118-
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
120+
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/* || true
119121
# for UKI, install the linux-image pkg if no kernel is found
120122
RUN [ -z "$(ls -A /boot/vmlinuz*)" ] && apt-get update && apt-get install -y --no-install-recommends \
121123
"$(apt-cache search linux-image | grep -oP 'linux-image-\d+.\d+.\d+-\d+-generic' | sort -V | tail -1)" \
122-
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
124+
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/* || true
123125

124126
# This target is aimed at non-UKI images where size is not a concern
125127
FROM common AS grub
@@ -141,17 +143,14 @@ RUN apt-get update \
141143

142144
FROM systemd-boot AS systemd-boot-amd64
143145
RUN apt-get update \
144-
&& apt-get install -y --no-install-recommends \
145-
shared-mime-info \
146-
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
146+
&& apt-get install -y --no-install-recommends shared-mime-info \
147+
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
147148
RUN [ -z "$(ls -A /lib/firmware/amd/)" ] && apt-get update && apt-get install -y --no-install-recommends \
148-
&& apt-get install -y --no-install-recommends \
149-
amd64-microcode \
150-
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
149+
&& apt-get install -y --no-install-recommends amd64-microcode \
150+
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/* || true
151151
RUN [ -z "$(ls -A /lib/firmware/intel-ucode/)" ] && apt-get update && apt-get install -y --no-install-recommends \
152-
&& apt-get install -y --no-install-recommends \
153-
intel-microcode \
154-
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
152+
&& apt-get install -y --no-install-recommends intel-microcode \
153+
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/* || true
155154

156155
FROM systemd-boot AS systemd-boot-arm64
157156

‎images/Dockerfile.ubuntu

+2
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@ RUN rm -rf /tmp/nohang.deb
106106

107107
# This target is aimed at UKI images and avoids to install GRUB and any other unnecesary packages
108108
# to the image because there are limitations on the total size
109+
# systemd-boot is neccesary as it brings the /usr/lib/systemd/systemd-bless-boot for boot assesment
109110
FROM common AS systemd-boot
110111
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
111112
RUN apt-get update && apt-get install -y --no-install-recommends \
112113
iucode-tool \
113114
kmod \
114115
linux-base \
116+
systemd-boot \
115117
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*
116118
# for UKI, install the linux-modules pkg if no modules are found
117119
RUN [ -z "$(ls -A /lib/modules/)" ] && apt-get update && apt-get install -y --no-install-recommends \

0 commit comments

Comments
 (0)