File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6767 mkosi --directory " $SELF " --force --extra-tree=" $stage " " ${devargs[@]} " \
6868 --format=directory --output-directory=" $work " --output=rootfs \
6969 --compress-output=no --bootable=no build
70+ if [[ $flavor == prod ]]; then
71+ " $SELF /scripts/prune-rootfs.sh" " $tree "
72+ fi
7073 # ldconfig's binary auxiliary cache records traversal-dependent ordering.
7174 # /var is volatile at runtime, so ship no host-generated cache.
7275 rm -f " $tree /var/cache/ldconfig/aux-cache"
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ Packages=
5050 parted
5151 busybox-static
5252 cryptsetup-bin
53- ovmf
5453 systemd-boot-efi
5554 acpid
5655 numactl
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # SPDX-License-Identifier: Apache-2.0
3+ set -euo pipefail
4+
5+ ROOTFS=$( realpath -m " ${1:? rootfs tree required} " )
6+
7+ # Match Yocto's production packaging policy: development inputs, translated
8+ # messages and package-manager metadata are not part of the immutable guest.
9+ # /var/cache and /var/lib are hidden by volatile bind mounts at runtime.
10+ for path in \
11+ usr/include \
12+ usr/share/OVMF \
13+ usr/share/ovmf \
14+ usr/share/doc \
15+ usr/share/info \
16+ usr/share/locale \
17+ usr/share/man \
18+ var/cache/debconf \
19+ var/lib/dpkg \
20+ var/lib/ucf; do
21+ rm -rf " ${ROOTFS:? } /$path "
22+ done
23+
24+ # Static archives and libtool metadata are build inputs. All production
25+ # consumers use the corresponding shared objects.
26+ find " $ROOTFS /usr" -type f \( -name ' *.a' -o -name ' *.la' \) -delete
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ grep -q 'build-ovmf.sh' "$D/scripts/build-components.sh"
2525grep -q ' fbe0805b2091393406952e84724188f8c1941837' " $D /scripts/build-ovmf.sh"
2626grep -q ' AmdSev/AmdSevX64.dsc' " $D /scripts/build-ovmf.sh"
2727grep -q ' objcopy --strip-debug' " $D /build.sh"
28+ grep -q ' prune-rootfs.sh' " $D /build.sh"
29+ ! grep -q ' ^[[:space:]]*ovmf$' " $D /mkosi.conf"
2830grep -q ' "firmware_sev":"files/ovmf-sev.fd"' " $D /scripts/make-release-artifacts.sh"
2931grep -q ' measurement.snp.cbor' " $D /tests/check-output.sh"
3032grep -q ' 0001-validate-ocsp-response-freshness.patch' " $D /scripts/build-nvattest.sh"
You can’t perform that action at this time.
0 commit comments