summaryrefslogtreecommitdiffstats
path: root/remote/modules/systemd/module.build
diff options
context:
space:
mode:
authorSimon Rettberg2014-04-01 15:35:26 +0200
committerSimon Rettberg2014-04-01 15:35:26 +0200
commitc189f9ce049cbae19aaad06ae74a642b1e0733d4 (patch)
treea1db240f7adba119bc7469474bed73d3cd23bb58 /remote/modules/systemd/module.build
parent[vmware/vmchooser] Generalize string cleaning function (diff)
parent[config curitiba] add curitiba config (diff)
downloadtm-scripts-c189f9ce049cbae19aaad06ae74a642b1e0733d4.tar.gz
tm-scripts-c189f9ce049cbae19aaad06ae74a642b1e0733d4.tar.xz
tm-scripts-c189f9ce049cbae19aaad06ae74a642b1e0733d4.zip
Merge branch 'master' of simonslx:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/systemd/module.build')
-rw-r--r--remote/modules/systemd/module.build72
1 files changed, 72 insertions, 0 deletions
diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build
new file mode 100644
index 00000000..95576548
--- /dev/null
+++ b/remote/modules/systemd/module.build
@@ -0,0 +1,72 @@
+#tool/distro specific functions for fetching, building and installing dependencies
+
+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."
+
+ # libkmod
+ download_untar "$REQUIRED_LIBKMOD_URL" "src/"
+}
+
+build () {
+ #build libkmod
+ pinfo "Building libkmod"
+ cd "${MODULE_DIR}/src/$REQUIRED_LIBKMOD_VERSION"
+ ./configure || perror "./configure kmod failed."
+ make || perror "kmod make failed."
+ DESTDIR="${MODULE_BUILD_DIR}" make install || perror "kmod make install failed."
+ cd - &> /dev/null
+
+ #build systemd
+ pinfo "Building systemd"
+ cd "${MODULE_DIR}/src/$REQUIRED_VERSION"
+ pinfo "calling configure"
+
+ # Save potentially pre-used paths/flages
+ OLDLDFLAGS="$LDFLAGS"
+ OLDCPPFLAGS="$CPPFLAGS"
+ OLDPKG_CONFIG_PATH="$PKG_CONFIG_PATH"
+ OLDLD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+
+ export LDFLAGS="$LDFLAGS -L${MODULE_BUILD_DIR}/usr/lib"
+ export CPPFLAGS="-I${MODULE_BUILD_DIR}/usr/include"
+ export PKG_CONFIG_PATH="${MODULE_BUILD_DIR}/usr/lib64/pkgconfig:${MODULE_BUILD_DIR}/usr/lib/pkgconfig"
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${MODULE_BUILD_DIR}/usr/lib:${MODULE_BUILD_DIR}/usr/lib64"
+
+ ./configure --disable-manpages --enable-split-usr --sysconfdir="/etc" --enable-gtk-doc-html=no --disable-nls \
+ --disable-microhttpd --disable-bootchart --disable-quotacheck --disable-hostnamed --disable-timedated \
+ --disable-localed --disable-coredump --disable-keymap --without-python --enable-blkid --enable-acl --enable-pam \
+ --enable-kmod \
+ || perror "configure failed."
+ pinfo "calling make"
+ make || perror "make failed."
+ pinfo "calling make install"
+ DESTDIR="${MODULE_BUILD_DIR}" make install || perror "make install failed."
+ cd - &> /dev/null
+
+ # Restore used flags/paths:
+ export LDFLAGS="$OLDLDFLAGS"
+ export CPPFLAGS="$OLDCPPFLAGS"
+ export PKG_CONFIG_PATH="$OLDPKG_CONFIG_PATH"
+ export LD_LIBRARY_PATH="$OLDLD_LIBRARY_PATH"
+}
+
+post_copy() {
+ #old agetty version doesn't support --noclear option in getty service
+ if [ "x$(dpkg -s util-linux | grep Version: | cut -d' ' -f2)" == "x2.19.1-2ubuntu3" ]; then
+ sed -i "s/ExecStart=-\/sbin\/agetty --noclear %I 38400 linux/ExecStart=-\/sbin\/agetty %I 38400 linux/g" "${TARGET_BUILD_DIR}/usr/lib/systemd/system/getty@.service"
+ fi
+
+ # add pam_systemd.so to pam modules directory
+ if [ -e "${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so" ]; then
+ cp "${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so" "${TARGET_BUILD_DIR}/lib/security/"
+ else
+ pdebug "No such file: ${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so"
+ fi
+}
+