Skip to content

Commit

Permalink
Have different compression depending on the ubuntu release (#2270)
Browse files Browse the repository at this point in the history
* Have different compression depending on the ubuntu release

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add kairos file

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
  • Loading branch information
mauromorales committed Feb 20, 2024
1 parent deb4ade commit cd1f5c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions images/Dockerfile.kairos-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ RUN apt-get update \
systemd-hwe-hwdb \
systemd-resolved \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# compress firmware (from 23.10, fw files come compressed)
# for some reason \+ is breaking. Using \; instead despite being slower
RUN find /usr/lib/firmware -type f ! -name "*.zst" -execdir zstd --rm -9 {} \;

FROM ubuntu-latest AS ubuntu-24.04
RUN apt-get update \
Expand All @@ -244,24 +247,24 @@ RUN apt-get update \

FROM ubuntu-latest AS ubuntu-23.10

FROM ${TARGETARCH}-${FLAVOR}-${FLAVOR_RELEASE}-${MODEL} AS ubuntu-22.04
FROM ${TARGETARCH}-${FLAVOR}-${FLAVOR_RELEASE}-${MODEL} AS ubuntu-legacy
RUN find /usr/lib/firmware -type f ! -name "*.zst" -execdir zstd --rm -9 {} \+

FROM ubuntu-legacy AS ubuntu-22.04
RUN apt-get update
# If the generic kernel is installed we don't want to install HWE related packages
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-cache search linux-image-generic | grep hwe &> /dev/null && apt-get install -y --no-install-recommends \
systemd-hwe-hwdb
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

FROM ${TARGETARCH}-${FLAVOR}-${FLAVOR_RELEASE}-${MODEL} AS ubuntu-20.04
FROM ubuntu-legacy AS ubuntu-20.04

###############################################################
#### Post-Process Common to All ####
###############################################################
FROM ${FLAVOR}-${FLAVOR_RELEASE} AS all

# compress firmware (from 23.10, fw files come compressed)
# for some reason \+ is breaking. Using \; instead despite being slower
RUN find /usr/lib/firmware -type f ! -name "*.zst" -execdir zstd --rm -9 {} \;
# compress modules
RUN find /usr/lib/modules -type f -name "*.ko" -execdir zstd --rm -9 {} \+

Expand Down
13 changes: 8 additions & 5 deletions images/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ RUN apt-get update \
systemd-hwe-hwdb \
systemd-resolved \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# compress firmware (from 23.10, fw files come compressed)
# for some reason \+ is breaking. Using \; instead despite being slower
RUN find /usr/lib/firmware -type f ! -name "*.zst" -execdir zstd --rm -9 {} \;

FROM ubuntu-latest AS ubuntu-24.04
RUN apt-get update \
Expand All @@ -245,24 +248,24 @@ RUN apt-get update \

FROM ubuntu-latest AS ubuntu-23.10

FROM ${TARGETARCH}-${FLAVOR}-${FLAVOR_RELEASE}-${MODEL} AS ubuntu-22.04
FROM ${TARGETARCH}-${FLAVOR}-${FLAVOR_RELEASE}-${MODEL} AS ubuntu-legacy
RUN find /usr/lib/firmware -type f ! -name "*.zst" -execdir zstd --rm -9 {} \+

FROM ubuntu-legacy AS ubuntu-22.04
RUN apt-get update
# If the generic kernel is installed we don't want to install HWE related packages
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-cache search linux-image-generic | grep hwe &> /dev/null && apt-get install -y --no-install-recommends \
systemd-hwe-hwdb
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

FROM ${TARGETARCH}-${FLAVOR}-${FLAVOR_RELEASE}-${MODEL} AS ubuntu-20.04
FROM ubuntu-legacy AS ubuntu-20.04

###############################################################
#### Post-Process Common to All ####
###############################################################
FROM ${FLAVOR}-${FLAVOR_RELEASE} AS all

# compress firmware (from 23.10, fw files come compressed)
# for some reason \+ is breaking. Using \; instead despite being slower
RUN find /usr/lib/firmware -type f ! -name "*.zst" -execdir zstd --rm -9 {} \;
# compress modules
RUN find /usr/lib/modules -type f -name "*.ko" -execdir zstd --rm -9 {} \+

Expand Down

0 comments on commit cd1f5c8

Please sign in to comment.