2019-12-17 10:50:14 +00:00
|
|
|
#!/bin/bash
|
2022-07-16 15:40:04 +01:00
|
|
|
# shellcheck disable=SC2140 # ugly array, remove later
|
|
|
|
# shellcheck disable=SC2288 # ugly array, remove later
|
|
|
|
# shellcheck disable=SC2086 # we want word splitting
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2020-07-03 09:04:20 +01:00
|
|
|
if [ $DEBIAN_ARCH = arm64 ]; then
|
ci: Build skqp on ARM64 images
This commit makes `kernel+rootfs_arm64` job build and install skqp on
ARM64 devices rootfs.
Skia repository has a tool to prepare skqp models located at
`tools/skqp/cut-release`, which get files from [Skia
Gold](https://skia.org/docs/dev/testing/skiagold/), generate
files.checksum, rendertests.txt and unittests.txt. One gives a range of
commits to let `cut-release` find the right resources to prepare skqp
for the user. However, it is failing, since it fails when trying to get
image packages from a range of commits via HTTPS from the host
https://public-gold.skia.org but it responds with error 404 every time.
I tried a range a thousand of commits, yet it still does not give
results. The workaround employed was to recover the most recent
`files.checksum` and `rendertests.txt` files from the git history and
generate `unittests.txt` from `list_gpu_unit_tests` binary.
`skqp` runs two lists of tests, `rendertests.txt` and `unittests.txt`.
Both must be located inside the `skqp` assets folder. The first list
uses GL and GLES to test rendering scenarios. The second runs some unit
tests that do not render an image per se.
In order to make the first `a630_skqp` to be green, the crashing tests
were removed from the test lists and the expectations of the failing
ones were updated.
It is worth noting that `rendertests.txt` can bring some detail about
each test expectation, so each test can have a max pixel error count, to
tell `skqp` that it is OK to have at most that number of errors for that
test. See also:
https://github.com/google/skia/blob/main/tools/skqp/README_ALGORITHM.md
As each render backend has a different error count, two different
`rendertests.txt` files were created,
`src/freedreno/ci/freedreno-a630-skqp-gl_rendertests.txt`,
`src/freedreno/ci/freedreno-a630-skqp-gles_rendertests.txt` and
, which one refers to GL and GLES tests respectfully.
The unit tests file for a630 is located at
`src/freedreno/ci/freedreno-a630-skqp_unittests.txt`
```
aaclip
domain
formats
highcontrastfilter
rectangle_texture
yuv_make_color_space
```
```
ProcessorOptimizationValidationTest
VkProtectedContext_CreateNonprotectedContext
VkYCbcrSampler_DrawImageWithYcbcrSampler
VkYCbcrSampler_NoYcbcrSurface
```
Each test was updated with the max_error count equal to the first run result.
```
analytic_antialias_inverse
async_rescale_and_read_dog_down
async_rescale_and_read_dog_up
async_rescale_and_read_rose
async_rescale_and_read_text_down
async_rescale_and_read_text_up
async_rescale_and_read_text_up_large
async_rescale_and_read_yuv420_rose
complexclip2_path_bw
encode-platform
imageblur_large
lcdtextsize
onebadarc
onefailarc
scale-pixels
surfaceprops
textfilter_color
textfilter_image
```
Considering all the following tests results as wrong.
```
async_rescale_and_read_no_bleed
backdrop_imagefilter_croprect_persp
complexclip2
imageblurrepeatmode
mixerCF
overdrawcolorfilter
patch_alpha
patch_primitive
rrect_clip_bw
scaledemoji_rendering
yuv_splitter
```
v2:
a) add link to HTML report on job log
b) remove extraneous spaces diff
c) remove unnecessary conditions from build-skqp.sh
d) use fixed skqp source commit SHA
v3:
a) Use only main skia repository to fetch models and build skqp
b) Use list_gpu_unit_tests binary to create a base unittests.txt file
c) Remove crashing tests
d) Set failing tests expectations for the first skqp run
v4:
a) Remove clang dependency
b) Separate each skqp backend result into its folder
c) Regroup a630_skqp in one job
v5:
a) Separate tests files per driver
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5580
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14146>
2021-12-07 14:13:00 +00:00
|
|
|
ARCH_PACKAGES="firmware-qcom-media
|
2021-12-03 00:14:30 +00:00
|
|
|
firmware-linux-nonfree
|
ci: Build skqp on ARM64 images
This commit makes `kernel+rootfs_arm64` job build and install skqp on
ARM64 devices rootfs.
Skia repository has a tool to prepare skqp models located at
`tools/skqp/cut-release`, which get files from [Skia
Gold](https://skia.org/docs/dev/testing/skiagold/), generate
files.checksum, rendertests.txt and unittests.txt. One gives a range of
commits to let `cut-release` find the right resources to prepare skqp
for the user. However, it is failing, since it fails when trying to get
image packages from a range of commits via HTTPS from the host
https://public-gold.skia.org but it responds with error 404 every time.
I tried a range a thousand of commits, yet it still does not give
results. The workaround employed was to recover the most recent
`files.checksum` and `rendertests.txt` files from the git history and
generate `unittests.txt` from `list_gpu_unit_tests` binary.
`skqp` runs two lists of tests, `rendertests.txt` and `unittests.txt`.
Both must be located inside the `skqp` assets folder. The first list
uses GL and GLES to test rendering scenarios. The second runs some unit
tests that do not render an image per se.
In order to make the first `a630_skqp` to be green, the crashing tests
were removed from the test lists and the expectations of the failing
ones were updated.
It is worth noting that `rendertests.txt` can bring some detail about
each test expectation, so each test can have a max pixel error count, to
tell `skqp` that it is OK to have at most that number of errors for that
test. See also:
https://github.com/google/skia/blob/main/tools/skqp/README_ALGORITHM.md
As each render backend has a different error count, two different
`rendertests.txt` files were created,
`src/freedreno/ci/freedreno-a630-skqp-gl_rendertests.txt`,
`src/freedreno/ci/freedreno-a630-skqp-gles_rendertests.txt` and
, which one refers to GL and GLES tests respectfully.
The unit tests file for a630 is located at
`src/freedreno/ci/freedreno-a630-skqp_unittests.txt`
```
aaclip
domain
formats
highcontrastfilter
rectangle_texture
yuv_make_color_space
```
```
ProcessorOptimizationValidationTest
VkProtectedContext_CreateNonprotectedContext
VkYCbcrSampler_DrawImageWithYcbcrSampler
VkYCbcrSampler_NoYcbcrSurface
```
Each test was updated with the max_error count equal to the first run result.
```
analytic_antialias_inverse
async_rescale_and_read_dog_down
async_rescale_and_read_dog_up
async_rescale_and_read_rose
async_rescale_and_read_text_down
async_rescale_and_read_text_up
async_rescale_and_read_text_up_large
async_rescale_and_read_yuv420_rose
complexclip2_path_bw
encode-platform
imageblur_large
lcdtextsize
onebadarc
onefailarc
scale-pixels
surfaceprops
textfilter_color
textfilter_image
```
Considering all the following tests results as wrong.
```
async_rescale_and_read_no_bleed
backdrop_imagefilter_croprect_persp
complexclip2
imageblurrepeatmode
mixerCF
overdrawcolorfilter
patch_alpha
patch_primitive
rrect_clip_bw
scaledemoji_rendering
yuv_splitter
```
v2:
a) add link to HTML report on job log
b) remove extraneous spaces diff
c) remove unnecessary conditions from build-skqp.sh
d) use fixed skqp source commit SHA
v3:
a) Use only main skia repository to fetch models and build skqp
b) Use list_gpu_unit_tests binary to create a base unittests.txt file
c) Remove crashing tests
d) Set failing tests expectations for the first skqp run
v4:
a) Remove clang dependency
b) Separate each skqp backend result into its folder
c) Regroup a630_skqp in one job
v5:
a) Separate tests files per driver
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5580
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14146>
2021-12-07 14:13:00 +00:00
|
|
|
libfontconfig1
|
|
|
|
libgl1
|
|
|
|
libglu1-mesa
|
2022-01-21 05:43:03 +00:00
|
|
|
libvulkan-dev
|
ci: Build skqp on ARM64 images
This commit makes `kernel+rootfs_arm64` job build and install skqp on
ARM64 devices rootfs.
Skia repository has a tool to prepare skqp models located at
`tools/skqp/cut-release`, which get files from [Skia
Gold](https://skia.org/docs/dev/testing/skiagold/), generate
files.checksum, rendertests.txt and unittests.txt. One gives a range of
commits to let `cut-release` find the right resources to prepare skqp
for the user. However, it is failing, since it fails when trying to get
image packages from a range of commits via HTTPS from the host
https://public-gold.skia.org but it responds with error 404 every time.
I tried a range a thousand of commits, yet it still does not give
results. The workaround employed was to recover the most recent
`files.checksum` and `rendertests.txt` files from the git history and
generate `unittests.txt` from `list_gpu_unit_tests` binary.
`skqp` runs two lists of tests, `rendertests.txt` and `unittests.txt`.
Both must be located inside the `skqp` assets folder. The first list
uses GL and GLES to test rendering scenarios. The second runs some unit
tests that do not render an image per se.
In order to make the first `a630_skqp` to be green, the crashing tests
were removed from the test lists and the expectations of the failing
ones were updated.
It is worth noting that `rendertests.txt` can bring some detail about
each test expectation, so each test can have a max pixel error count, to
tell `skqp` that it is OK to have at most that number of errors for that
test. See also:
https://github.com/google/skia/blob/main/tools/skqp/README_ALGORITHM.md
As each render backend has a different error count, two different
`rendertests.txt` files were created,
`src/freedreno/ci/freedreno-a630-skqp-gl_rendertests.txt`,
`src/freedreno/ci/freedreno-a630-skqp-gles_rendertests.txt` and
, which one refers to GL and GLES tests respectfully.
The unit tests file for a630 is located at
`src/freedreno/ci/freedreno-a630-skqp_unittests.txt`
```
aaclip
domain
formats
highcontrastfilter
rectangle_texture
yuv_make_color_space
```
```
ProcessorOptimizationValidationTest
VkProtectedContext_CreateNonprotectedContext
VkYCbcrSampler_DrawImageWithYcbcrSampler
VkYCbcrSampler_NoYcbcrSurface
```
Each test was updated with the max_error count equal to the first run result.
```
analytic_antialias_inverse
async_rescale_and_read_dog_down
async_rescale_and_read_dog_up
async_rescale_and_read_rose
async_rescale_and_read_text_down
async_rescale_and_read_text_up
async_rescale_and_read_text_up_large
async_rescale_and_read_yuv420_rose
complexclip2_path_bw
encode-platform
imageblur_large
lcdtextsize
onebadarc
onefailarc
scale-pixels
surfaceprops
textfilter_color
textfilter_image
```
Considering all the following tests results as wrong.
```
async_rescale_and_read_no_bleed
backdrop_imagefilter_croprect_persp
complexclip2
imageblurrepeatmode
mixerCF
overdrawcolorfilter
patch_alpha
patch_primitive
rrect_clip_bw
scaledemoji_rendering
yuv_splitter
```
v2:
a) add link to HTML report on job log
b) remove extraneous spaces diff
c) remove unnecessary conditions from build-skqp.sh
d) use fixed skqp source commit SHA
v3:
a) Use only main skia repository to fetch models and build skqp
b) Use list_gpu_unit_tests binary to create a base unittests.txt file
c) Remove crashing tests
d) Set failing tests expectations for the first skqp run
v4:
a) Remove clang dependency
b) Separate each skqp backend result into its folder
c) Regroup a630_skqp in one job
v5:
a) Separate tests files per driver
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5580
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14146>
2021-12-07 14:13:00 +00:00
|
|
|
"
|
2020-07-03 09:04:20 +01:00
|
|
|
elif [ $DEBIAN_ARCH = amd64 ]; then
|
2022-06-21 08:37:04 +01:00
|
|
|
# Add llvm 13 to the build image
|
|
|
|
apt-get -y install --no-install-recommends wget gnupg2 software-properties-common
|
|
|
|
apt-key add /llvm-snapshot.gpg.key
|
|
|
|
add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main"
|
2022-07-16 13:11:16 +01:00
|
|
|
# Debian bullseye has older wine 5.0, we want >= 7.0 for traces.
|
|
|
|
apt-key add /winehq.gpg.key
|
|
|
|
apt-add-repository https://dl.winehq.org/wine-builds/debian/
|
|
|
|
|
2022-06-21 08:37:04 +01:00
|
|
|
|
2020-11-11 16:15:25 +00:00
|
|
|
ARCH_PACKAGES="firmware-amd-graphics
|
2021-10-28 20:25:09 +01:00
|
|
|
inetutils-syslogd
|
|
|
|
iptables
|
|
|
|
libcap2
|
2022-04-18 15:15:11 +01:00
|
|
|
libfontconfig1
|
2020-11-11 16:15:25 +00:00
|
|
|
libelf1
|
2021-10-28 20:25:09 +01:00
|
|
|
libfdt1
|
2022-04-18 15:15:11 +01:00
|
|
|
libgl1
|
|
|
|
libglu1-mesa
|
2022-06-21 08:37:04 +01:00
|
|
|
libllvm13
|
2021-03-19 11:25:54 +00:00
|
|
|
libllvm11
|
2021-10-08 21:17:27 +01:00
|
|
|
libva2
|
|
|
|
libva-drm2
|
2022-04-18 15:15:11 +01:00
|
|
|
libvulkan-dev
|
2021-10-28 20:25:09 +01:00
|
|
|
socat
|
|
|
|
spirv-tools
|
|
|
|
sysvinit-core
|
2020-07-03 09:04:20 +01:00
|
|
|
"
|
2022-07-16 13:11:16 +01:00
|
|
|
|
2022-05-17 15:05:36 +01:00
|
|
|
elif [ $DEBIAN_ARCH = armhf ]; then
|
|
|
|
ARCH_PACKAGES="firmware-misc-nonfree
|
|
|
|
"
|
2020-07-03 09:04:20 +01:00
|
|
|
fi
|
|
|
|
|
2021-03-31 08:32:20 +01:00
|
|
|
INSTALL_CI_FAIRY_PACKAGES="git
|
|
|
|
python3-dev
|
|
|
|
python3-pip
|
|
|
|
python3-setuptools
|
|
|
|
python3-wheel
|
|
|
|
"
|
2020-08-27 20:18:17 +01:00
|
|
|
|
2022-06-21 08:37:04 +01:00
|
|
|
apt-get update
|
2019-12-17 10:50:14 +00:00
|
|
|
apt-get -y install --no-install-recommends \
|
2020-11-11 16:15:25 +00:00
|
|
|
$ARCH_PACKAGES \
|
2020-08-27 20:18:17 +01:00
|
|
|
$INSTALL_CI_FAIRY_PACKAGES \
|
2022-03-29 12:47:26 +01:00
|
|
|
$EXTRA_LOCAL_PACKAGES \
|
2022-03-23 15:51:24 +00:00
|
|
|
bash \
|
2020-03-03 22:38:09 +00:00
|
|
|
ca-certificates \
|
2021-03-19 11:52:35 +00:00
|
|
|
firmware-realtek \
|
2019-12-17 10:50:14 +00:00
|
|
|
initramfs-tools \
|
2022-09-14 08:36:48 +01:00
|
|
|
jq \
|
2021-03-19 11:52:35 +00:00
|
|
|
libasan6 \
|
2020-11-11 16:15:25 +00:00
|
|
|
libexpat1 \
|
2019-12-17 10:50:14 +00:00
|
|
|
libpng16-16 \
|
2021-03-19 11:52:35 +00:00
|
|
|
libpython3.9 \
|
2019-12-17 10:50:14 +00:00
|
|
|
libsensors5 \
|
2021-02-09 17:28:17 +00:00
|
|
|
libvulkan1 \
|
2021-03-31 08:32:20 +01:00
|
|
|
libwaffle-1-0 \
|
|
|
|
libx11-6 \
|
|
|
|
libx11-xcb1 \
|
2020-10-17 13:00:45 +01:00
|
|
|
libxcb-dri2-0 \
|
|
|
|
libxcb-dri3-0 \
|
2021-03-31 08:32:20 +01:00
|
|
|
libxcb-glx0 \
|
2020-10-17 13:00:45 +01:00
|
|
|
libxcb-present0 \
|
|
|
|
libxcb-randr0 \
|
2021-03-31 08:32:20 +01:00
|
|
|
libxcb-shm0 \
|
2020-10-17 13:00:45 +01:00
|
|
|
libxcb-sync1 \
|
|
|
|
libxcb-xfixes0 \
|
2021-03-31 08:32:20 +01:00
|
|
|
libxdamage1 \
|
|
|
|
libxext6 \
|
|
|
|
libxfixes3 \
|
|
|
|
libxkbcommon0 \
|
2021-03-29 14:09:06 +01:00
|
|
|
libxrender1 \
|
2020-10-17 13:00:45 +01:00
|
|
|
libxshmfence1 \
|
2021-03-31 08:32:20 +01:00
|
|
|
libxxf86vm1 \
|
2020-05-01 17:57:00 +01:00
|
|
|
netcat-openbsd \
|
2021-03-31 08:32:20 +01:00
|
|
|
python3 \
|
|
|
|
python3-lxml \
|
|
|
|
python3-mako \
|
|
|
|
python3-numpy \
|
|
|
|
python3-packaging \
|
|
|
|
python3-pil \
|
2021-03-20 10:00:05 +00:00
|
|
|
python3-renderdoc \
|
2021-03-31 08:32:20 +01:00
|
|
|
python3-requests \
|
|
|
|
python3-simplejson \
|
|
|
|
python3-yaml \
|
2020-07-31 05:51:47 +01:00
|
|
|
sntp \
|
2020-11-11 16:15:25 +00:00
|
|
|
strace \
|
2021-03-19 11:52:35 +00:00
|
|
|
waffle-utils \
|
ci: Include db410c support in the ARM container.
I'm working on moving the db410c CI from docker to LAVA, which means we
get to boot a custom kernel. To do that, we need to enable ARCH_QCOM in
the kernel, save the dtb around, and include abootimg in our container so
that we can generate combined kernel/dtb/ramdisk images for fastboot.
LAVA's fastboot support is unable to pack the overlay into an abootimg
image, just a cpio rootfs. We could flash the cpio rootfs after overlay
addition, but that takes 2 minutes to do, and causes wear on the devices.
Instead, we'll bring up the network at boot and use wget to fetch the
overlay. We'll want network support anyway, so that we can transfer the
failure xmls back to the gitlab job's artifacts at some point.
Since the msm GPU and realtek network firmware increase our payload by
3MB, add in firmware compression so that it doesn't waste as much RAM on
devices not using it.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3928>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3928>
2020-01-28 20:02:39 +00:00
|
|
|
wget \
|
2021-01-21 23:59:47 +00:00
|
|
|
xinit \
|
2022-07-28 00:19:21 +01:00
|
|
|
xserver-xorg-core \
|
|
|
|
zstd
|
2020-05-28 20:50:51 +01:00
|
|
|
|
2022-07-16 13:11:16 +01:00
|
|
|
|
|
|
|
if [ "$DEBIAN_ARCH" = "amd64" ]; then
|
|
|
|
# workaround wine needing 32-bit
|
|
|
|
# https://bugs.winehq.org/show_bug.cgi?id=53393
|
|
|
|
apt-get install -y --no-remove wine-stable-amd64 # a requirement for wine-stable
|
|
|
|
WINE_PKG="wine-stable"
|
|
|
|
WINE_PKG_DROP="wine-stable-i386"
|
|
|
|
apt download "${WINE_PKG}"
|
|
|
|
dpkg --ignore-depends="${WINE_PKG_DROP}" -i "${WINE_PKG}"*.deb
|
|
|
|
rm "${WINE_PKG}"*.deb
|
|
|
|
sed -i "/${WINE_PKG_DROP}/d" /var/lib/dpkg/status
|
|
|
|
apt-get install -y --no-remove winehq-stable # symlinks-only, depends on wine-stable
|
|
|
|
fi
|
|
|
|
|
2021-03-31 08:32:20 +01:00
|
|
|
# Needed for ci-fairy, this revision is able to upload files to
|
|
|
|
# MinIO and doesn't depend on git
|
2022-10-20 07:03:08 +01:00
|
|
|
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
|
2020-08-27 20:18:17 +01:00
|
|
|
|
2022-09-03 19:54:40 +01:00
|
|
|
# Needed for manipulation with traces yaml files.
|
|
|
|
pip3 install yq
|
|
|
|
|
2021-03-31 08:32:20 +01:00
|
|
|
apt-get purge -y \
|
2020-08-27 20:18:17 +01:00
|
|
|
$INSTALL_CI_FAIRY_PACKAGES
|
2020-05-28 20:50:51 +01:00
|
|
|
|
2019-04-29 17:33:22 +01:00
|
|
|
passwd root -d
|
|
|
|
chsh -s /bin/sh
|
2020-02-19 18:22:02 +00:00
|
|
|
|
|
|
|
cat > /init <<EOF
|
|
|
|
#!/bin/sh
|
|
|
|
export PS1=lava-shell:
|
|
|
|
exec sh
|
|
|
|
EOF
|
|
|
|
chmod +x /init
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Strip the image to a small minimal system without removing the debian
|
|
|
|
# toolchain.
|
|
|
|
|
|
|
|
# Copy timezone file and remove tzdata package
|
|
|
|
rm -rf /etc/localtime
|
|
|
|
cp /usr/share/zoneinfo/Etc/UTC /etc/localtime
|
|
|
|
|
2021-03-19 11:52:35 +00:00
|
|
|
UNNEEDED_PACKAGES="
|
|
|
|
libfdisk1
|
|
|
|
"
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
# Removing unused packages
|
|
|
|
for PACKAGE in ${UNNEEDED_PACKAGES}
|
|
|
|
do
|
|
|
|
echo ${PACKAGE}
|
|
|
|
if ! apt-get remove --purge --yes "${PACKAGE}"
|
|
|
|
then
|
|
|
|
echo "WARNING: ${PACKAGE} isn't installed"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
apt-get autoremove --yes || true
|
|
|
|
|
|
|
|
# Dropping logs
|
|
|
|
rm -rf /var/log/*
|
|
|
|
|
|
|
|
# Dropping documentation, localization, i18n files, etc
|
|
|
|
rm -rf /usr/share/doc/*
|
|
|
|
rm -rf /usr/share/locale/*
|
2020-01-28 14:19:53 +00:00
|
|
|
rm -rf /usr/share/X11/locale/*
|
2019-04-29 17:33:22 +01:00
|
|
|
rm -rf /usr/share/man
|
|
|
|
rm -rf /usr/share/i18n/*
|
|
|
|
rm -rf /usr/share/info/*
|
|
|
|
rm -rf /usr/share/lintian/*
|
|
|
|
rm -rf /usr/share/common-licenses/*
|
|
|
|
rm -rf /usr/share/mime/*
|
|
|
|
|
|
|
|
# Dropping reportbug scripts
|
|
|
|
rm -rf /usr/share/bug
|
|
|
|
|
|
|
|
# Drop udev hwdb not required on a stripped system
|
|
|
|
rm -rf /lib/udev/hwdb.bin /lib/udev/hwdb.d/*
|
|
|
|
|
|
|
|
# Drop all gconv conversions && binaries
|
|
|
|
rm -rf usr/bin/iconv
|
|
|
|
rm -rf usr/sbin/iconvconfig
|
|
|
|
rm -rf usr/lib/*/gconv/
|
|
|
|
|
|
|
|
# Remove libusb database
|
|
|
|
rm -rf usr/sbin/update-usbids
|
|
|
|
rm -rf var/lib/usbutils/usb.ids
|
|
|
|
rm -rf usr/share/misc/usb.ids
|
|
|
|
|
2022-01-07 17:44:43 +00:00
|
|
|
rm -rf /root/.pip
|
|
|
|
|
2019-04-29 17:33:22 +01:00
|
|
|
#######################################################################
|
|
|
|
# Crush into a minimal production image to be deployed via some type of image
|
|
|
|
# updating system.
|
|
|
|
# IMPORTANT: The Debian system is not longer functional at this point,
|
|
|
|
# for example, apt and dpkg will stop working
|
|
|
|
|
2020-05-14 00:58:26 +01:00
|
|
|
UNNEEDED_PACKAGES="apt libapt-pkg6.0 "\
|
|
|
|
"ncurses-bin ncurses-base libncursesw6 libncurses6 "\
|
2019-04-29 17:33:22 +01:00
|
|
|
"perl-base "\
|
|
|
|
"debconf libdebconfclient0 "\
|
|
|
|
"e2fsprogs e2fslibs libfdisk1 "\
|
|
|
|
"insserv "\
|
|
|
|
"udev "\
|
|
|
|
"init-system-helpers "\
|
|
|
|
"cpio "\
|
|
|
|
"passwd "\
|
|
|
|
"libsemanage1 libsemanage-common "\
|
|
|
|
"libsepol1 "\
|
|
|
|
"gpgv "\
|
|
|
|
"hostname "\
|
|
|
|
"adduser "\
|
|
|
|
"debian-archive-keyring "\
|
2020-01-28 14:19:53 +00:00
|
|
|
"libegl1-mesa-dev "\
|
|
|
|
"libegl-mesa0 "\
|
|
|
|
"libgl1-mesa-dev "\
|
|
|
|
"libgl1-mesa-dri "\
|
|
|
|
"libglapi-mesa "\
|
|
|
|
"libgles2-mesa-dev "\
|
|
|
|
"libglx-mesa0 "\
|
|
|
|
"mesa-common-dev "\
|
2022-06-21 08:37:04 +01:00
|
|
|
"gnupg2 "\
|
|
|
|
"software-properties-common " \
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
# Removing unneeded packages
|
|
|
|
for PACKAGE in ${UNNEEDED_PACKAGES}
|
|
|
|
do
|
|
|
|
echo "Forcing removal of ${PACKAGE}"
|
|
|
|
if ! dpkg --purge --force-remove-essential --force-depends "${PACKAGE}"
|
|
|
|
then
|
|
|
|
echo "WARNING: ${PACKAGE} isn't installed"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Show what's left package-wise before dropping dpkg itself
|
|
|
|
COLUMNS=300 dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1,1n
|
|
|
|
|
|
|
|
# Drop dpkg
|
|
|
|
dpkg --purge --force-remove-essential --force-depends dpkg
|
|
|
|
|
|
|
|
# No apt or dpkg, no need for its configuration archives
|
|
|
|
rm -rf etc/apt
|
|
|
|
rm -rf etc/dpkg
|
|
|
|
|
|
|
|
# Drop directories not part of ostree
|
|
|
|
# Note that /var needs to exist as ostree bind mounts the deployment /var over
|
|
|
|
# it
|
2022-07-16 13:11:16 +01:00
|
|
|
rm -rf var/* srv share
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
# ca-certificates are in /etc drop the source
|
|
|
|
rm -rf usr/share/ca-certificates
|
|
|
|
|
2022-03-23 15:51:24 +00:00
|
|
|
# No need for completions
|
2019-04-29 17:33:22 +01:00
|
|
|
rm -rf usr/share/bash-completion
|
|
|
|
|
|
|
|
# No zsh, no need for comletions
|
|
|
|
rm -rf usr/share/zsh/vendor-completions
|
|
|
|
|
2021-03-19 11:52:35 +00:00
|
|
|
# drop gcc python helpers
|
|
|
|
rm -rf usr/share/gcc
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
# Drop sysvinit leftovers
|
|
|
|
rm -rf etc/init.d
|
|
|
|
rm -rf etc/rc[0-6S].d
|
|
|
|
|
|
|
|
# Drop upstart helpers
|
|
|
|
rm -rf etc/init
|
|
|
|
|
|
|
|
# Various xtables helpers
|
|
|
|
rm -rf usr/lib/xtables
|
|
|
|
|
|
|
|
# Drop all locales
|
|
|
|
# TODO: only remaining locale is actually "C". Should we really remove it?
|
|
|
|
rm -rf usr/lib/locale/*
|
|
|
|
|
|
|
|
# partition helpers
|
2020-05-13 22:36:36 +01:00
|
|
|
rm -rf usr/sbin/*fdisk
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
# local compiler
|
2020-05-13 22:36:36 +01:00
|
|
|
rm -rf usr/bin/localedef
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
# Systemd dns resolver
|
|
|
|
find usr etc -name '*systemd-resolve*' -prune -exec rm -r {} \;
|
|
|
|
|
|
|
|
# Systemd network configuration
|
|
|
|
find usr etc -name '*networkd*' -prune -exec rm -r {} \;
|
|
|
|
|
|
|
|
# systemd ntp client
|
|
|
|
find usr etc -name '*timesyncd*' -prune -exec rm -r {} \;
|
|
|
|
|
|
|
|
# systemd hw database manager
|
|
|
|
find usr etc -name '*systemd-hwdb*' -prune -exec rm -r {} \;
|
|
|
|
|
|
|
|
# No need for fuse
|
|
|
|
find usr etc -name '*fuse*' -prune -exec rm -r {} \;
|
|
|
|
|
|
|
|
# lsb init function leftovers
|
|
|
|
rm -rf usr/lib/lsb
|
|
|
|
|
|
|
|
# Only needed when adding libraries
|
2020-05-13 22:36:36 +01:00
|
|
|
rm -rf usr/sbin/ldconfig*
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
# Games, unused
|
|
|
|
rmdir usr/games
|
|
|
|
|
|
|
|
# Remove pam module to authenticate against a DB
|
|
|
|
# plus libdb-5.3.so that is only used by this pam module
|
2020-05-13 22:36:36 +01:00
|
|
|
rm -rf usr/lib/*/security/pam_userdb.so
|
|
|
|
rm -rf usr/lib/*/libdb-5.3.so
|
2019-04-29 17:33:22 +01:00
|
|
|
|
|
|
|
# remove NSS support for nis, nisplus and hesiod
|
2020-05-13 22:36:36 +01:00
|
|
|
rm -rf usr/lib/*/libnss_hesiod*
|
|
|
|
rm -rf usr/lib/*/libnss_nis*
|