mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
Merge pull request #32154 from DaanDeMeyer/mkosi
mkosi: Make scripts more generic
This commit is contained in:
commit
aef47ec274
2
.github/workflows/mkosi.yml
vendored
2
.github/workflows/mkosi.yml
vendored
|
@ -74,7 +74,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
||||||
- uses: systemd/mkosi@4dfdf98ed2877a1e40f37234e0b8fbba0fec3584
|
- uses: systemd/mkosi@1099ead1ccaa11b62b7a16ee312193bd0e6b6404
|
||||||
|
|
||||||
# Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
|
# Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
|
||||||
# immediately, we remove the files in the background. However, we first move them to a different location
|
# immediately, we remove the files in the background. However, we first move them to a different location
|
||||||
|
|
7
mkosi.images/system/mkosi.conf.d/10-opensuse/initrd/mkosi.postinst → mkosi.images/system/initrd/mkosi.postinst
Executable file → Normal file
7
mkosi.images/system/mkosi.conf.d/10-opensuse/initrd/mkosi.postinst → mkosi.images/system/initrd/mkosi.postinst
Executable file → Normal file
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
mkosi-install $INITRD_PACKAGES
|
||||||
|
|
||||||
# OpenSUSE insists on blacklisting erofs by default because its supposedly a legacy filesystem.
|
# OpenSUSE insists on blacklisting erofs by default because its supposedly a legacy filesystem.
|
||||||
# See https://github.com/openSUSE/suse-module-tools/pull/71
|
# See https://github.com/openSUSE/suse-module-tools/pull/71
|
||||||
rm -f "$BUILDROOT/usr/lib/modprobe.d/60-blacklist_fs-erofs.conf"
|
rm -f "$BUILDROOT/usr/lib/modprobe.d/60-blacklist_fs-erofs.conf"
|
||||||
|
|
||||||
mkosi-install systemd udev systemd-experimental
|
|
|
@ -1,5 +1,8 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
|
||||||
|
[Config]
|
||||||
|
InitrdInclude=initrd/
|
||||||
|
|
||||||
[Output]
|
[Output]
|
||||||
@Format=directory
|
@Format=directory
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
set -e
|
|
||||||
|
|
||||||
mkosi-install systemd systemd-sysvcompat
|
|
|
@ -2,17 +2,20 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
if [ ! -f "pkg/$PKG_SUBDIR/PKGBUILD" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "PKGBUILD not found at pkg/$PKG_SUBDIR/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
|
. /usr/lib/os-release
|
||||||
|
|
||||||
|
if [ ! -f "pkg/$ID/PKGBUILD" ]; then
|
||||||
|
echo "PKGBUILD not found at pkg/$ID/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We can't configure the source or build directory so we use bind mounts instead to make sure they are in the
|
# We can't configure the source or build directory so we use bind mounts instead to make sure they are in the
|
||||||
# expected locations.
|
# expected locations.
|
||||||
mount --mkdir --bind "$SRCDIR" "pkg/$PKG_SUBDIR/systemd-stable/"
|
mount --mkdir --bind "$SRCDIR" "pkg/$ID/systemd-stable/"
|
||||||
mount --mkdir --bind "$BUILDDIR" "pkg/$PKG_SUBDIR/build/"
|
mount --mkdir --bind "$BUILDDIR" "pkg/$ID/build/"
|
||||||
# Because we run with --noextract we are responsible for making sure the source files appear in src/.
|
# Because we run with --noextract we are responsible for making sure the source files appear in src/.
|
||||||
mount --mkdir --rbind "$PWD/pkg/$PKG_SUBDIR" "pkg/$PKG_SUBDIR/src/"
|
mount --mkdir --rbind "$PWD/pkg/$ID" "pkg/$ID/src/"
|
||||||
|
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. /etc/makepkg.conf
|
. /etc/makepkg.conf
|
||||||
|
@ -35,13 +38,13 @@ else
|
||||||
TS="${SOURCE_DATE_EPOCH:-$(date +%s)}"
|
TS="${SOURCE_DATE_EPOCH:-$(date +%s)}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed --in-place "pkg/$PKG_SUBDIR/PKGBUILD" \
|
sed --in-place "pkg/$ID/PKGBUILD" \
|
||||||
--expression "s/^_tag=.*/_tag=$(cat meson.version)/" \
|
--expression "s/^_tag=.*/_tag=$(cat meson.version)/" \
|
||||||
--expression "s/^pkgrel=.*/pkgrel=$(date "+%Y%m%d%H%M%S" --date "@$TS")/"
|
--expression "s/^pkgrel=.*/pkgrel=$(date "+%Y%m%d%H%M%S" --date "@$TS")/"
|
||||||
|
|
||||||
# We get around makepkg's root check by setting EUID to something else.
|
# We get around makepkg's root check by setting EUID to something else.
|
||||||
# shellcheck disable=SC2046
|
# shellcheck disable=SC2046
|
||||||
env --chdir="pkg/$PKG_SUBDIR" \
|
env --chdir="pkg/$ID" \
|
||||||
EUID=123 \
|
EUID=123 \
|
||||||
makepkg \
|
makepkg \
|
||||||
--noextract \
|
--noextract \
|
||||||
|
@ -49,7 +52,7 @@ env --chdir="pkg/$PKG_SUBDIR" \
|
||||||
--force \
|
--force \
|
||||||
_systemd_UPSTREAM=1 \
|
_systemd_UPSTREAM=1 \
|
||||||
_systemd_QUIET=1 \
|
_systemd_QUIET=1 \
|
||||||
BUILDDIR="$PWD/pkg/$PKG_SUBDIR" \
|
BUILDDIR="$PWD/pkg/$ID" \
|
||||||
PKGDEST="$OUTPUTDIR" \
|
PKGDEST="$OUTPUTDIR" \
|
||||||
PKGEXT=".pkg.tar" \
|
PKGEXT=".pkg.tar" \
|
||||||
MESON_EXTRA_CONFIGURE_OPTIONS="-D mode=developer -D b_sanitize=${SANITIZERS:-none}"
|
MESON_EXTRA_CONFIGURE_OPTIONS="-D mode=developer -D b_sanitize=${SANITIZERS:-none}"
|
||||||
|
|
|
@ -3,15 +3,10 @@
|
||||||
[Match]
|
[Match]
|
||||||
Distribution=arch
|
Distribution=arch
|
||||||
|
|
||||||
[Config]
|
|
||||||
InitrdInclude=initrd/
|
|
||||||
|
|
||||||
# TODO: Switch to https://gitlab.archlinux.org/archlinux/packaging/packages/systemd once
|
|
||||||
# https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/merge_requests/8 is merged.
|
|
||||||
[Content]
|
[Content]
|
||||||
Environment=
|
Environment=
|
||||||
PKG_SUBDIR="arch"
|
|
||||||
SYSTEMD_PACKAGES="systemd systemd-ukify systemd-sysvcompat systemd-resolvconf systemd-tests"
|
SYSTEMD_PACKAGES="systemd systemd-ukify systemd-sysvcompat systemd-resolvconf systemd-tests"
|
||||||
|
INITRD_PACKAGES="systemd systemd-sysvcompat"
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
bpf
|
bpf
|
||||||
|
|
|
@ -6,13 +6,16 @@ if [ "$1" = "build" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "pkg/$PKG_SUBDIR/PKGBUILD" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "PKGBUILD not found at pkg/$PKG_SUBDIR/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
|
. "$BUILDROOT/usr/lib/os-release"
|
||||||
|
|
||||||
|
if [ ! -f "pkg/$ID/PKGBUILD" ]; then
|
||||||
|
echo "PKGBUILD not found at pkg/$ID/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We get depends and optdepends from .SRCINFO as getting them from the PKGBUILD is rather complex.
|
# We get depends and optdepends from .SRCINFO as getting them from the PKGBUILD is rather complex.
|
||||||
sed --expression 's/^[ \t]*//' "pkg/$PKG_SUBDIR/.SRCINFO" |
|
sed --expression 's/^[ \t]*//' "pkg/$ID/.SRCINFO" |
|
||||||
grep --regexp '^depends =' --regexp '^optdepends =' |
|
grep --regexp '^depends =' --regexp '^optdepends =' |
|
||||||
sed --expression 's/^depends = //' --expression 's/^optdepends = //' --expression 's/:.*//' |
|
sed --expression 's/^depends = //' --expression 's/^optdepends = //' --expression 's/:.*//' |
|
||||||
xargs --delimiter '\n' mkosi-install
|
xargs --delimiter '\n' mkosi-install
|
||||||
|
@ -20,7 +23,7 @@ sed --expression 's/^[ \t]*//' "pkg/$PKG_SUBDIR/.SRCINFO" |
|
||||||
# We get makedepends from the PKGBUILD as .SRCINFO can't encode conditional dependencies depending on
|
# We get makedepends from the PKGBUILD as .SRCINFO can't encode conditional dependencies depending on
|
||||||
# whether some environment variable is set or not.
|
# whether some environment variable is set or not.
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
_systemd_UPSTREAM=1 . "pkg/$PKG_SUBDIR/PKGBUILD"
|
_systemd_UPSTREAM=1 . "pkg/$ID/PKGBUILD"
|
||||||
|
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
mkosi-install "${makedepends[@]}"
|
mkosi-install "${makedepends[@]}"
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
set -e
|
|
||||||
|
|
||||||
mkosi-install systemd systemd-udev
|
|
|
@ -2,8 +2,11 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
|
. /usr/lib/os-release
|
||||||
|
|
||||||
|
if [ ! -f "pkg/$ID/systemd.spec" ]; then
|
||||||
|
echo "spec not found at pkg/$ID/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -23,7 +26,7 @@ rpmbuild \
|
||||||
$( ((WITH_TESTS)) || echo "--nocheck") \
|
$( ((WITH_TESTS)) || echo "--nocheck") \
|
||||||
$( ((WITH_DOCS)) || echo "--without docs") \
|
$( ((WITH_DOCS)) || echo "--without docs") \
|
||||||
--define "_topdir /var/tmp" \
|
--define "_topdir /var/tmp" \
|
||||||
--define "_sourcedir pkg/$PKG_SUBDIR" \
|
--define "_sourcedir pkg/$ID" \
|
||||||
--define "_rpmdir $OUTPUTDIR" \
|
--define "_rpmdir $OUTPUTDIR" \
|
||||||
${BUILDDIR:+--define} \
|
${BUILDDIR:+--define} \
|
||||||
${BUILDDIR:+"_vpath_builddir $BUILDDIR"} \
|
${BUILDDIR:+"_vpath_builddir $BUILDDIR"} \
|
||||||
|
@ -45,6 +48,6 @@ rpmbuild \
|
||||||
--define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \
|
--define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \
|
||||||
--define "__script_requires %{nil}" \
|
--define "__script_requires %{nil}" \
|
||||||
--undefine _lto_cflags \
|
--undefine _lto_cflags \
|
||||||
"pkg/$PKG_SUBDIR/systemd.spec"
|
"pkg/$ID/systemd.spec"
|
||||||
|
|
||||||
cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
|
cp "$OUTPUTDIR"/*.rpm "$PACKAGEDIR"
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
Distribution=|centos
|
Distribution=|centos
|
||||||
Distribution=|fedora
|
Distribution=|fedora
|
||||||
|
|
||||||
[Config]
|
|
||||||
InitrdInclude=initrd/
|
|
||||||
|
|
||||||
[Content]
|
[Content]
|
||||||
Environment=
|
Environment=
|
||||||
SYSTEMD_PACKAGES="systemd
|
SYSTEMD_PACKAGES="systemd
|
||||||
|
@ -22,6 +19,8 @@ Environment=
|
||||||
systemd-oomd-defaults
|
systemd-oomd-defaults
|
||||||
systemd-journal-remote
|
systemd-journal-remote
|
||||||
systemd-networkd-defaults"
|
systemd-networkd-defaults"
|
||||||
|
INITRD_PACKAGES="systemd systemd-udev"
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
bpftool
|
bpftool
|
||||||
cryptsetup
|
cryptsetup
|
||||||
|
|
|
@ -6,8 +6,11 @@ if [ "$1" = "build" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi with -ff to make sure the spec is cloned" >&2
|
. "$BUILDROOT/usr/lib/os-release"
|
||||||
|
|
||||||
|
if [ ! -f "pkg/$ID/systemd.spec" ]; then
|
||||||
|
echo "spec not found at pkg/$ID/systemd.spec, run mkosi with -ff to make sure the spec is cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,8 +21,8 @@ for DEPS in --requires --buildrequires; do
|
||||||
--query \
|
--query \
|
||||||
"$DEPS" \
|
"$DEPS" \
|
||||||
--define "_topdir /var/tmp" \
|
--define "_topdir /var/tmp" \
|
||||||
--define "_sourcedir pkg/$PKG_SUBDIR" \
|
--define "_sourcedir pkg/$ID" \
|
||||||
"pkg/$PKG_SUBDIR/systemd.spec" |
|
"pkg/$ID/systemd.spec" |
|
||||||
grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev |
|
grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev |
|
||||||
sort --unique |
|
sort --unique |
|
||||||
tee /tmp/buildrequires |
|
tee /tmp/buildrequires |
|
||||||
|
@ -29,7 +32,7 @@ done
|
||||||
# rpmbuild -br tries to build a source package which means all source files have to exist which isn't the
|
# rpmbuild -br tries to build a source package which means all source files have to exist which isn't the
|
||||||
# case when using --build-in-place so we get rid of the source file that doesn't exist to make it happy.
|
# case when using --build-in-place so we get rid of the source file that doesn't exist to make it happy.
|
||||||
# TODO: Use -bd instead of -br and get rid of this once we don't need to build on CentOS Stream 9 anymore.
|
# TODO: Use -bd instead of -br and get rid of this once we don't need to build on CentOS Stream 9 anymore.
|
||||||
sed '/Source0/d' --in-place "pkg/$PKG_SUBDIR/systemd.spec"
|
sed '/Source0/d' --in-place "pkg/$ID/systemd.spec"
|
||||||
|
|
||||||
until mkosi-chroot \
|
until mkosi-chroot \
|
||||||
rpmbuild \
|
rpmbuild \
|
||||||
|
@ -37,9 +40,9 @@ until mkosi-chroot \
|
||||||
--build-in-place \
|
--build-in-place \
|
||||||
--with upstream \
|
--with upstream \
|
||||||
--define "_topdir /var/tmp" \
|
--define "_topdir /var/tmp" \
|
||||||
--define "_sourcedir pkg/$PKG_SUBDIR" \
|
--define "_sourcedir pkg/$ID" \
|
||||||
--define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
|
--define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
|
||||||
"pkg/$PKG_SUBDIR/systemd.spec"
|
"pkg/$ID/systemd.spec"
|
||||||
do
|
do
|
||||||
EXIT_STATUS=$?
|
EXIT_STATUS=$?
|
||||||
if [ $EXIT_STATUS -ne 11 ]; then
|
if [ $EXIT_STATUS -ne 11 ]; then
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
Distribution=centos
|
Distribution=centos
|
||||||
|
|
||||||
[Content]
|
[Content]
|
||||||
Environment=
|
|
||||||
PKG_SUBDIR="centos"
|
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
kernel-modules # For squashfs support
|
kernel-modules # For squashfs support
|
||||||
rpmautospec-rpm-macros
|
rpmautospec-rpm-macros
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
set -e
|
|
||||||
|
|
||||||
mkosi-install systemd udev
|
|
|
@ -2,13 +2,16 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ ! -d "pkg/$PKG_SUBDIR/debian" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "deb rules not found at pkg/$PKG_SUBDIR/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
|
. /usr/lib/os-release
|
||||||
|
|
||||||
|
if [ ! -d "pkg/$ID/debian" ]; then
|
||||||
|
echo "deb rules not found at pkg/$ID/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We transplant the debian/ folder from the deb package sources into the upstream sources.
|
# We transplant the debian/ folder from the deb package sources into the upstream sources.
|
||||||
mount --mkdir --bind "$SRCDIR/pkg/$PKG_SUBDIR/debian" "$SRCDIR"/debian
|
mount --mkdir --bind "$SRCDIR/pkg/$ID/debian" "$SRCDIR"/debian
|
||||||
|
|
||||||
# We hide the patches/ directory by mounting an empty directory on top so they don't get applied.
|
# We hide the patches/ directory by mounting an empty directory on top so they don't get applied.
|
||||||
TMP=$(mktemp -d)
|
TMP=$(mktemp -d)
|
||||||
|
|
|
@ -4,12 +4,8 @@
|
||||||
Distribution=|debian
|
Distribution=|debian
|
||||||
Distribution=|ubuntu
|
Distribution=|ubuntu
|
||||||
|
|
||||||
[Config]
|
|
||||||
InitrdInclude=initrd/
|
|
||||||
|
|
||||||
[Content]
|
[Content]
|
||||||
Environment=
|
Environment=
|
||||||
PKG_SUBDIR="debian"
|
|
||||||
SYSTEMD_PACKAGES="systemd
|
SYSTEMD_PACKAGES="systemd
|
||||||
systemd-userdbd
|
systemd-userdbd
|
||||||
systemd-oomd
|
systemd-oomd
|
||||||
|
@ -24,6 +20,7 @@ Environment=
|
||||||
systemd-boot
|
systemd-boot
|
||||||
systemd-ukify
|
systemd-ukify
|
||||||
udev"
|
udev"
|
||||||
|
INITRD_PACKAGES="systemd udev"
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
^libasan[0-9]+$
|
^libasan[0-9]+$
|
||||||
|
|
|
@ -6,10 +6,13 @@ if [ "$1" = "build" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "pkg/$PKG_SUBDIR/debian" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "deb rules not found at pkg/$PKG_SUBDIR/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
|
. "$BUILDROOT/usr/lib/os-release"
|
||||||
|
|
||||||
|
if [ ! -d "pkg/$ID/debian" ]; then
|
||||||
|
echo "deb rules not found at pkg/$ID/debian, run mkosi once with -ff to make sure the rules are cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "pkg/$PKG_SUBDIR"
|
cd "pkg/$ID"
|
||||||
DEB_BUILD_PROFILES="pkg.systemd.upstream" apt-get build-dep .
|
DEB_BUILD_PROFILES="pkg.systemd.upstream" apt-get build-dep .
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
Distribution=fedora
|
Distribution=fedora
|
||||||
|
|
||||||
[Content]
|
[Content]
|
||||||
Environment=
|
|
||||||
PKG_SUBDIR="fedora"
|
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
btrfs-progs
|
btrfs-progs
|
||||||
compsize
|
compsize
|
||||||
|
|
|
@ -2,8 +2,12 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
|
. /usr/lib/os-release
|
||||||
|
ID="${ID%-*}"
|
||||||
|
|
||||||
|
if [ ! -f "pkg/$ID/systemd.spec" ]; then
|
||||||
|
echo "spec not found at pkg/$ID/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -16,7 +20,7 @@ fi
|
||||||
# The openSUSE filelists hardcode the manpage compression extension. This causes rpmbuild errors since we
|
# The openSUSE filelists hardcode the manpage compression extension. This causes rpmbuild errors since we
|
||||||
# disable manpage compression as the files cannot be found. Fix the issue by removing the compression
|
# disable manpage compression as the files cannot be found. Fix the issue by removing the compression
|
||||||
# extension.
|
# extension.
|
||||||
find "pkg/$PKG_SUBDIR" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \;
|
find "pkg/$ID" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \;
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
# TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once
|
# TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once
|
||||||
|
@ -28,7 +32,7 @@ build() {
|
||||||
--with upstream \
|
--with upstream \
|
||||||
$( ((WITH_TESTS)) || echo --nocheck) \
|
$( ((WITH_TESTS)) || echo --nocheck) \
|
||||||
--define "_topdir /var/tmp" \
|
--define "_topdir /var/tmp" \
|
||||||
--define "_sourcedir pkg/$PKG_SUBDIR" \
|
--define "_sourcedir pkg/$ID" \
|
||||||
--define "_rpmdir $OUTPUTDIR" \
|
--define "_rpmdir $OUTPUTDIR" \
|
||||||
${BUILDDIR:+--define} \
|
${BUILDDIR:+--define} \
|
||||||
${BUILDDIR:+"_vpath_builddir $BUILDDIR"} \
|
${BUILDDIR:+"_vpath_builddir $BUILDDIR"} \
|
||||||
|
@ -46,7 +50,7 @@ build() {
|
||||||
--define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \
|
--define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \
|
||||||
--define "__script_requires %{nil}" \
|
--define "__script_requires %{nil}" \
|
||||||
"$@" \
|
"$@" \
|
||||||
"pkg/$PKG_SUBDIR/systemd.spec"
|
"pkg/$ID/systemd.spec"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! build; then
|
if ! build; then
|
||||||
|
@ -58,7 +62,7 @@ if ! build; then
|
||||||
# warnings.
|
# warnings.
|
||||||
rm systemd.lang
|
rm systemd.lang
|
||||||
|
|
||||||
cat /tmp/unpackaged-files >>"pkg/$PKG_SUBDIR/files.systemd"
|
cat /tmp/unpackaged-files >>"pkg/$ID/files.systemd"
|
||||||
build --noprep --nocheck
|
build --noprep --nocheck
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,8 @@
|
||||||
[Match]
|
[Match]
|
||||||
Distribution=opensuse
|
Distribution=opensuse
|
||||||
|
|
||||||
[Config]
|
|
||||||
InitrdInclude=initrd/
|
|
||||||
|
|
||||||
[Content]
|
[Content]
|
||||||
Environment=
|
Environment=
|
||||||
PKG_SUBDIR="opensuse"
|
|
||||||
SYSTEMD_PACKAGES="systemd
|
SYSTEMD_PACKAGES="systemd
|
||||||
udev
|
udev
|
||||||
systemd-experimental
|
systemd-experimental
|
||||||
|
@ -19,6 +15,7 @@ Environment=
|
||||||
systemd-portable
|
systemd-portable
|
||||||
systemd-sysvcompat
|
systemd-sysvcompat
|
||||||
systemd-testsuite"
|
systemd-testsuite"
|
||||||
|
INITRD_PACKAGES="systemd udev systemd-experimental"
|
||||||
|
|
||||||
# We install gawk, gzip, grep, xz, sed, rsync and docbook-xsl-stylesheets here explicitly so that the busybox
|
# We install gawk, gzip, grep, xz, sed, rsync and docbook-xsl-stylesheets here explicitly so that the busybox
|
||||||
# versions don't get installed instead.
|
# versions don't get installed instead.
|
||||||
|
@ -28,7 +25,6 @@ Packages=
|
||||||
cryptsetup
|
cryptsetup
|
||||||
dbus-broker
|
dbus-broker
|
||||||
device-mapper
|
device-mapper
|
||||||
distribution-release
|
|
||||||
docbook-xsl-stylesheets
|
docbook-xsl-stylesheets
|
||||||
f2fs-tools
|
f2fs-tools
|
||||||
gawk
|
gawk
|
||||||
|
@ -44,6 +40,7 @@ Packages=
|
||||||
openssh-clients
|
openssh-clients
|
||||||
openssh-server
|
openssh-server
|
||||||
pam
|
pam
|
||||||
|
patterns-base-minimal_base
|
||||||
python3-pefile
|
python3-pefile
|
||||||
quota
|
quota
|
||||||
rpm-build
|
rpm-build
|
||||||
|
|
|
@ -6,8 +6,12 @@ if [ "$1" = "build" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]; then
|
# shellcheck source=/dev/null
|
||||||
echo "spec not found at pkg/$PKG_SUBDIR/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
|
. "$BUILDROOT/usr/lib/os-release"
|
||||||
|
ID="${ID%-*}"
|
||||||
|
|
||||||
|
if [ ! -f "pkg/$ID/systemd.spec" ]; then
|
||||||
|
echo "spec not found at pkg/$ID/systemd.spec, run mkosi once with -ff to make sure the spec is cloned" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,8 +22,8 @@ for DEPS in --requires --buildrequires; do
|
||||||
--query \
|
--query \
|
||||||
"$DEPS" \
|
"$DEPS" \
|
||||||
--define "_topdir /var/tmp" \
|
--define "_topdir /var/tmp" \
|
||||||
--define "_sourcedir pkg/$PKG_SUBDIR" \
|
--define "_sourcedir pkg/$ID" \
|
||||||
"pkg/$PKG_SUBDIR/systemd.spec" |
|
"pkg/$ID/systemd.spec" |
|
||||||
grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev |
|
grep --invert-match --regexp systemd --regexp /bin/sh --regexp "rpmlib(" --regexp udev |
|
||||||
sort --unique |
|
sort --unique |
|
||||||
tee /tmp/buildrequires |
|
tee /tmp/buildrequires |
|
||||||
|
@ -32,9 +36,9 @@ until mkosi-chroot \
|
||||||
--build-in-place \
|
--build-in-place \
|
||||||
--with upstream \
|
--with upstream \
|
||||||
--define "_topdir /var/tmp" \
|
--define "_topdir /var/tmp" \
|
||||||
--define "_sourcedir pkg/$PKG_SUBDIR" \
|
--define "_sourcedir pkg/$ID" \
|
||||||
--define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
|
--define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
|
||||||
"pkg/$PKG_SUBDIR/systemd.spec"
|
"pkg/$ID/systemd.spec"
|
||||||
do
|
do
|
||||||
EXIT_STATUS=$?
|
EXIT_STATUS=$?
|
||||||
if [ $EXIT_STATUS -ne 11 ]; then
|
if [ $EXIT_STATUS -ne 11 ]; then
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -z "$(ls --almost-all "pkg/$PKG_SUBDIR")" ] || [ -f "pkg/$PKG_SUBDIR/.git" ]; then
|
if [ -z "$(ls --almost-all "pkg/$DISTRIBUTION")" ] || [ -f "pkg/$DISTRIBUTION/.git" ]; then
|
||||||
git submodule sync "pkg/$PKG_SUBDIR"
|
PKG_SUBDIR="$(realpath "pkg/$DISTRIBUTION" --relative-to "$PWD")"
|
||||||
git submodule update --init "pkg/$PKG_SUBDIR"
|
git submodule sync "$PKG_SUBDIR"
|
||||||
|
git submodule update --init "$PKG_SUBDIR"
|
||||||
fi
|
fi
|
||||||
|
|
1
pkg/ubuntu
Symbolic link
1
pkg/ubuntu
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
debian
|
Loading…
Reference in a new issue