summaryrefslogtreecommitdiffstats
path: root/remote/modules/systemd/module.build
diff options
context:
space:
mode:
authorManuel Schneider2014-04-14 16:23:14 +0200
committerManuel Schneider2014-04-14 16:23:14 +0200
commit857ad8fe0ca8d56b1e2986cb90d1b7a5846f9b22 (patch)
tree65cf23bc23aeb91df29db9318eb844e1806c2d03 /remote/modules/systemd/module.build
parentMore debug stuff (diff)
parent[systemd] remove 'systemd-timestamp' from binary list (diff)
downloadtm-scripts-857ad8fe0ca8d56b1e2986cb90d1b7a5846f9b22.tar.gz
tm-scripts-857ad8fe0ca8d56b1e2986cb90d1b7a5846f9b22.tar.xz
tm-scripts-857ad8fe0ca8d56b1e2986cb90d1b7a5846f9b22.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/systemd/module.build')
-rw-r--r--remote/modules/systemd/module.build29
1 files changed, 24 insertions, 5 deletions
diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build
index 95576548..2c27231e 100644
--- a/remote/modules/systemd/module.build
+++ b/remote/modules/systemd/module.build
@@ -3,11 +3,30 @@
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
+ pinfo "Systemd version 212 detected."
+ pinfo "REQUIRED_XATTR_PATCH is $REQUIRED_XATTR_PATCH"
+ # patch src/core/socket.c if activated in the config file
+ if [ "x$REQUIRED_XATTR_PATCH" = "xyes" ]; then
+ pinfo "Patching 'src/core/socket.c' ..."
+ # patch it
+ if [ -e "src/$REQUIRED_VERSION/src/core/socket.c" ]; then
+ sed -i 's/^#include <attr\/xattr.h>$/#include <sys\/xattr.h>\n#include <attr\/xattr.h>/g' "src/$REQUIRED_VERSION/src/core/socket.c" \
+ || perror "Could not patch 'src/$REQUIRED_VERSION/src/core/socket.c'"
+ else
+ perror "'src/$REQUIRED_VERSION//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/"