diff options
Diffstat (limited to 'remote/modules/systemd')
-rw-r--r-- | remote/modules/systemd/module.build | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build index 3b11c5ee..86ad7388 100644 --- a/remote/modules/systemd/module.build +++ b/remote/modules/systemd/module.build @@ -3,11 +3,27 @@ fetch_source () { # systemd download_untar "$REQUIRED_URL" "src/" - # Patch PATH, HOME, USER environment - # TODO: Newer systemd versions support DefaultEnvironment=xxx in /etc/systemd/system.conf - # However, there were lots of changes after systemd 204, so we didn't update yet - # See http://cgit.freedesktop.org/systemd/systemd/tree/NEWS for changes. - patch -p0 src/systemd-*/src/core/main.c < systemd-openslx.patch || perror "Failed to apply openslx systemd patch." + + # starting with systemd 212 a new way of setting global environment is supported + # meaning we don't have to apply the patch needed til that version. + if [ "x${REQUIRED_VERSION#systemd-}" = "x212" ]; then + # patch src/core/socket.c if activated in the config file + if [ "$REQUIRED_XATTR_PATCH" = "xyes" ]; then + # patch it + if [ -e "src/core/socket.c" ]; then + sed 's/^#include <attr\/xattr.h>$/#include <sys\/xattr.h>\n#include <attr\/xattr.h>/g' src/core/socket.c \ + || perror "Could not patch '$(pwd)/src/core/socket.c'" + else + perror "'$(pwd)/src/core/socket.c' does not exist." + fi + fi + else + # Patch PATH, HOME, USER environment + # TODO: Newer systemd versions support DefaultEnvironment=xxx in /etc/systemd/system.conf + # However, there were lots of changes after systemd 204, so we didn't update yet + # See http://cgit.freedesktop.org/systemd/systemd/tree/NEWS for changes. + patch -p0 src/systemd-*/src/core/main.c < systemd-openslx.patch || perror "Failed to apply openslx systemd patch." + fi # libkmod download_untar "$REQUIRED_LIBKMOD_URL" "src/" @@ -27,17 +43,6 @@ build () { cd "${MODULE_DIR}/src/$REQUIRED_VERSION" pinfo "calling configure" - # patch src/core/socket.c if activated in the config file - if [ "$REQUIRED_XATTR_PATCH" == "xyes" ]; then - # patch it - if [ -e "src/core/socket.c" ]; then - sed 's/^#include <attr\/xattr.h>$/#include <sys\/xattr.h>\n#include <attr\/xattr.h>/g' src/core/socket.c \ - || perror "Could not patch '$(pwd)/src/core/socket.c'" - else - perror "'$(pwd)/src/core/socket.c' does not exist." - fi - fi - # Save potentially pre-used paths/flages OLDLDFLAGS="$LDFLAGS" OLDCPPFLAGS="$CPPFLAGS" |