From 213b6b01171b608ab2c3e57a75969063878b3f05 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 14 Apr 2014 15:08:29 +0200 Subject: [systemd] patch src/core/socket.c for ubuntu 14 --- remote/modules/systemd/module.build | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'remote/modules/systemd/module.build') diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build index 95576548..3b11c5ee 100644 --- a/remote/modules/systemd/module.build +++ b/remote/modules/systemd/module.build @@ -27,6 +27,17 @@ 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 $/#include \n#include /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" -- cgit v1.2.3-55-g7522 From 0d31c1cfaa3572af0166a43d9147416d857588e6 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 14 Apr 2014 15:32:22 +0200 Subject: [systemd] apply openslx patch only in systemd<212 for systemd 212 we use an alternative way using the option "set-environment" of systemctl. Corresponding services are in the static data folder --- remote/modules/systemd/module.build | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'remote/modules/systemd/module.build') 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 $/#include \n#include /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 $/#include \n#include /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" -- cgit v1.2.3-55-g7522 From 89e6665daafb7fe796d59fbc262d07334ced59a7 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 14 Apr 2014 15:41:41 +0200 Subject: [systemd] forgot '-i' for sed --- remote/modules/systemd/module.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote/modules/systemd/module.build') diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build index 86ad7388..70ddfcc5 100644 --- a/remote/modules/systemd/module.build +++ b/remote/modules/systemd/module.build @@ -11,7 +11,7 @@ fetch_source () { if [ "$REQUIRED_XATTR_PATCH" = "xyes" ]; then # patch it if [ -e "src/core/socket.c" ]; then - sed 's/^#include $/#include \n#include /g' src/core/socket.c \ + sed -i 's/^#include $/#include \n#include /g' src/core/socket.c \ || perror "Could not patch '$(pwd)/src/core/socket.c'" else perror "'$(pwd)/src/core/socket.c' does not exist." -- cgit v1.2.3-55-g7522 From 6d8ae90844e2c82226e895fc767078f2beeaefd1 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 14 Apr 2014 16:11:26 +0200 Subject: [systemd] fixes for the patch apply logic... --- remote/modules/systemd/module.build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'remote/modules/systemd/module.build') diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build index 70ddfcc5..2c27231e 100644 --- a/remote/modules/systemd/module.build +++ b/remote/modules/systemd/module.build @@ -7,14 +7,17 @@ fetch_source () { # 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 [ "$REQUIRED_XATTR_PATCH" = "xyes" ]; then + if [ "x$REQUIRED_XATTR_PATCH" = "xyes" ]; then + pinfo "Patching 'src/core/socket.c' ..." # patch it - if [ -e "src/core/socket.c" ]; then - sed -i 's/^#include $/#include \n#include /g' src/core/socket.c \ - || perror "Could not patch '$(pwd)/src/core/socket.c'" + if [ -e "src/$REQUIRED_VERSION/src/core/socket.c" ]; then + sed -i 's/^#include $/#include \n#include /g' "src/$REQUIRED_VERSION/src/core/socket.c" \ + || perror "Could not patch 'src/$REQUIRED_VERSION/src/core/socket.c'" else - perror "'$(pwd)/src/core/socket.c' does not exist." + perror "'src/$REQUIRED_VERSION//src/core/socket.c' does not exist." fi fi else -- cgit v1.2.3-55-g7522