Skip to content

Commit c77dad7

Browse files
DaanDeMeyerrichardmaw-codethinksam-leonard-ct
committed
mkosi: Build minimal images and enable related integration tests
This commit adds definitions to build the minimal_0 and minimal_1 images with mkosi and includes them into the system image. We also move the building of the various app-xxx and similar images that are extremely minimal into the tests itself by moving the related logic from install_verity_minimal() into a new function install_extension_images() in util.sh. Because the mkosi /usr is read-only, we now place the extension images in /tmp instead of /usr/share. Co-authored-by: Richard Maw <[email protected]> Co-authored-by: sam-leonard-ct <[email protected]>
1 parent 69dc36f commit c77dad7

File tree

26 files changed

+353
-152
lines changed

26 files changed

+353
-152
lines changed

mkosi.images/minimal-0/mkosi.conf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Config]
4+
Dependencies=minimal-base
5+
6+
[Distribution]
7+
CacheOnly=always
8+
9+
[Output]
10+
Format=portable
11+
SplitArtifacts=yes
12+
13+
[Content]
14+
BaseTrees=%O/minimal-base
15+
Environment=SYSTEMD_REPART_OVERRIDE_FSTYPE=squashfs
16+
Bootable=no
17+
18+
BuildSources=
19+
Packages=
20+
BuildPackages=
21+
VolatilePackages=
22+
23+
[Host]
24+
Incremental=no
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Service]
4+
ExecStartPre=cat /usr/lib/os-release
5+
ExecStart=sleep 120
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: LGPL-2.1-or-later
3+
set -eux
4+
5+
mkdir -p "$BUILDROOT/var/lib/app1"
6+
7+
cat >>"$BUILDROOT/usr/lib/os-release" <<EOF
8+
MARKER=1
9+
PORTABLE_PREFIXES=app0 minimal minimal-app0
10+
EOF
11+
cp "$BUILDROOT/usr/lib/systemd/system/minimal-app0.service" "$BUILDROOT/usr/lib/systemd/system/minimal-app0-foo.service"

mkosi.images/minimal-1/mkosi.conf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Config]
4+
Dependencies=minimal-base
5+
6+
[Distribution]
7+
CacheOnly=always
8+
9+
[Output]
10+
Format=portable
11+
SplitArtifacts=yes
12+
13+
[Content]
14+
BaseTrees=%O/minimal-base
15+
Environment=SYSTEMD_REPART_OVERRIDE_FSTYPE=squashfs
16+
Bootable=no
17+
18+
BuildSources=
19+
Packages=
20+
BuildPackages=
21+
VolatilePackages=
22+
23+
[Host]
24+
Incremental=no
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Service]
4+
ExecStartPre=cat /usr/lib/os-release
5+
ExecStart=sleep 120
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: LGPL-2.1-or-later
3+
set -eux
4+
5+
mkdir -p "$BUILDROOT/var/lib/app1"
6+
7+
cat >>"$BUILDROOT/usr/lib/os-release" <<EOF
8+
MARKER=2
9+
PORTABLE_PREFIXES=app0 minimal minimal-app0
10+
EOF
11+
cp "$BUILDROOT/usr/lib/systemd/system/minimal-app0.service" "$BUILDROOT/usr/lib/systemd/system/minimal-app0-bar.service"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Output]
4+
Format=directory
5+
6+
[Content]
7+
Bootable=no
8+
@Locale=C.UTF-8
9+
WithDocs=no
10+
11+
BuildSources=
12+
Packages=
13+
BuildPackages=
14+
VolatilePackages=
15+
16+
Packages=
17+
bash
18+
coreutils
19+
grep
20+
util-linux
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Match]
4+
Distribution=arch
5+
6+
[Content]
7+
Packages=
8+
inetutils
9+
iproute
10+
openbsd-netcat

0 commit comments

Comments
 (0)