mirror of
https://github.com/systemd/systemd.git
synced 2025-01-31 05:47:30 +03:00
mkosi: Build a sysext if SYSEXT=1 is specified
This commit is contained in:
parent
ece66c01cf
commit
612a98a065
1
.github/workflows/mkosi.yml
vendored
1
.github/workflows/mkosi.yml
vendored
@ -140,6 +140,7 @@ jobs:
|
|||||||
SANITIZERS=${{ matrix.sanitizers }}
|
SANITIZERS=${{ matrix.sanitizers }}
|
||||||
MESON_OPTIONS=--werror
|
MESON_OPTIONS=--werror
|
||||||
LLVM=${{ matrix.llvm }}
|
LLVM=${{ matrix.llvm }}
|
||||||
|
SYSEXT=1
|
||||||
|
|
||||||
[Host]
|
[Host]
|
||||||
QemuMem=4G
|
QemuMem=4G
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
set -e
|
set -e
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
rm -f "$OUTPUTDIR"/*.{rpm,deb,pkg.tar}
|
rm -f "$OUTPUTDIR"/*.{rpm,deb,pkg.tar} "$OUTPUTDIR"/systemd.raw
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
. mkosi.functions
|
||||||
|
|
||||||
if ((NO_BUILD)); then
|
if ((NO_BUILD)); then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -120,3 +122,5 @@ CXX_LD="$( ((LLVM)) && echo lld)" \
|
|||||||
|
|
||||||
cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
|
cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
|
||||||
cp "$OUTPUTDIR"/*.rpm "$BUILDDIR"
|
cp "$OUTPUTDIR"/*.rpm "$BUILDDIR"
|
||||||
|
|
||||||
|
make_sysext_unsigned /var/tmp/BUILD/*/BUILDROOT
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
. mkosi.functions
|
||||||
|
|
||||||
if ((NO_BUILD)); then
|
if ((NO_BUILD)); then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -139,3 +141,5 @@ fi
|
|||||||
|
|
||||||
cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
|
cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
|
||||||
cp "$OUTPUTDIR"/*.rpm "$BUILDDIR"
|
cp "$OUTPUTDIR"/*.rpm "$BUILDDIR"
|
||||||
|
|
||||||
|
make_sysext_unsigned /var/tmp/BUILD/*/BUILDROOT
|
||||||
|
49
mkosi.functions
Normal file
49
mkosi.functions
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
|
||||||
|
make_sysext_unsigned() {
|
||||||
|
if ! ((SYSEXT)); then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p /usr/lib/systemd/repart/definitions/sysext-unsigned.repart.d
|
||||||
|
cat >/usr/lib/systemd/repart/definitions/sysext-unsigned.repart.d/10-root.conf <<EOF
|
||||||
|
[Partition]
|
||||||
|
Type=root
|
||||||
|
Format=erofs
|
||||||
|
CopyFiles=/usr/
|
||||||
|
Minimize=best
|
||||||
|
EOF
|
||||||
|
|
||||||
|
. /usr/lib/os-release
|
||||||
|
|
||||||
|
mkdir -p "$1"/usr/lib/extension-release.d
|
||||||
|
cat >"$1"/usr/lib/extension-release.d/extension-release.systemd <<EOF
|
||||||
|
ID=$ID
|
||||||
|
SYSEXT_ID=systemd
|
||||||
|
SYSEXT_SCOPE=system
|
||||||
|
ARCHITECTURE=$ARCHITECTURE
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [[ -n "$VERSION_ID" ]]; then
|
||||||
|
cat >>"$1"/usr/lib/extension-release.d/extension-release.systemd <<EOF
|
||||||
|
VERSION_ID=$VERSION_ID
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$SYSEXT_LEVEL" ]]; then
|
||||||
|
cat >>"$1"/usr/lib/extension-release.d/extension-release.systemd <<EOF
|
||||||
|
SYSEXT_LEVEL=$SYSEXT_LEVEL
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f "$BUILDDIR"/systemd.raw
|
||||||
|
|
||||||
|
env --unset=SYSTEMD_REPART_OVERRIDE_FSTYPE_ROOT \
|
||||||
|
"$BUILDDIR"/systemd-repart \
|
||||||
|
--make-ddi=sysext-unsigned \
|
||||||
|
--copy-source="$1" \
|
||||||
|
--pretty=no \
|
||||||
|
"$BUILDDIR"/systemd.raw
|
||||||
|
|
||||||
|
cp "$BUILDDIR"/systemd.raw "$OUTPUTDIR"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user