diff options
author | Jonathan Bauer | 2014-03-25 15:24:04 +0100 |
---|---|---|
committer | Jonathan Bauer | 2014-03-25 15:24:04 +0100 |
commit | 3d1235af060955e271be68240c0ca46bc6d81b03 (patch) | |
tree | ef02dcc4bb8476cfeef07e2df6a38b4c29d350df /remote/modules/systemd | |
parent | [rootfs-stage32] /var/log/openslx in tmpfiles.d (diff) | |
download | tm-scripts-3d1235af060955e271be68240c0ca46bc6d81b03.tar.gz tm-scripts-3d1235af060955e271be68240c0ca46bc6d81b03.tar.xz tm-scripts-3d1235af060955e271be68240c0ca46bc6d81b03.zip |
[modules] new module naming convention
rename $MODULE.{conf,build} to module.{conf,build}
Diffstat (limited to 'remote/modules/systemd')
-rw-r--r-- | remote/modules/systemd/module.build | 72 | ||||
-rw-r--r-- | remote/modules/systemd/module.build.scientific | 178 | ||||
-rw-r--r-- | remote/modules/systemd/module.build.scientific.README | 11 | ||||
-rw-r--r-- | remote/modules/systemd/module.conf | 65 | ||||
-rw-r--r-- | remote/modules/systemd/module.conf.debian | 13 | ||||
-rw-r--r-- | remote/modules/systemd/module.conf.opensuse | 11 | ||||
-rw-r--r-- | remote/modules/systemd/module.conf.scientific | 37 | ||||
-rw-r--r-- | remote/modules/systemd/module.conf.ubuntu | 13 |
8 files changed, 400 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 +} + diff --git a/remote/modules/systemd/module.build.scientific b/remote/modules/systemd/module.build.scientific new file mode 100644 index 00000000..12170d81 --- /dev/null +++ b/remote/modules/systemd/module.build.scientific @@ -0,0 +1,178 @@ +#tool/distro specific functions for fetching, building and installing dependencies + +# Please read systemd.build.scientific.README before using this script! + +fetch_source () { + download_untar "$REQUIRED_URL" "src/" + download_untar "$REQUIRED_LIBKMOD_URL" "src/" + + # Another nice hack for Scientific Linux - experimental. + if [ "$SYS_DISTRIBUTION" == "scientific" ]; then + download_untar "$REQUIRED_UTILLINUX_URL" "src/" || perror "Cannot download util-linux!" + download_untar "$REQUIRED_M4_URL" "src/" || perror "Cannot download m4 version $REQUIRED_AUTOMAKE_VERSION!" + download_untar "$REQUIRED_AUTOCONF_URL" "src/" || perror "Cannot download autoconf version $REQUIRED_AUTOCONF_VERSION!" + download_untar "$REQUIRED_AUTOMAKE_URL" "src/" || perror "Cannot download automake version $REQUIRED_AUTOMAKE_VERSION!" + download_untar "$REQUIRED_DBUS_URL" "src/" || perror "Cannot download dbus version $REQUIRED_DBUS_VERSION!" + fi + + # Patch PATH environment + sed -s -i -r 's#"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin(:/sbin:/bin)?"#& ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin"#g' src/systemd-*/src/core/main.c + sed -s -i -r 's#"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"#& ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin"#g' src/systemd-*/src/nspawn/nspawn.c +} + +build () { + + config_systemd () { + pinfo "Building systemd" + cd "${MODULE_DIR}/src/$REQUIRED_VERSION" + pinfo "calling configure" + ./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 \ + || perror "configure systemd failed." + } + + #build libkmod + pinfo "Building libkmod" + cd "${MODULE_DIR}/src/$REQUIRED_LIBKMOD_VERSION" + ./configure || perror "./configure kmod failed." + make || perror "kmod make failed." + make install || perror "kmod make install failed." + cd - &> /dev/null + + # Scientific Linux specials + if [ "$SYS_DISTRIBUTION" == "scientific" ]; then + pinfo "Scientific Linux detected ..." # Freude, schöner Götterfunke! + + # Some path mainpulations for following utilities, save some envvars for later restituting + OLDPATH=$PATH + export PATH="${MODULE_BUILD_DIR}/sbin:${MODULE_BUILD_DIR}/usr/local/bin/:$PATH" # for stuff installed at BUILD_DIR. + OLDPKG_CONFIG_PATH="$PKG_CONFIG_PATH" + OLDCPPFLAGS="$CPPFLAGS" + OLDLDFLAGS="$LDFLAGS" + + # Utillinux stuff + pinfo "Building util-linux" + cd "${MODULE_DIR}/src/$REQUIRED_UTILLINUX_VERSION" + ./configure --disable-libuuid --disable-libmount --without-ncurses \ + --disable-mount --disable-losetup --disable-cytune --disable-fsck --disable-partx --disable-uuidd \ + --disable-mountpoint --disable-fallocate --disable-unshare --disable-nsenter --disable-setpriv \ + --disable-eject --disable-agetty --disable-cramfs --disable-bfs --disable-fdformat --disable-hwclock \ + --disable-wdctl --disable-switch_root --disable-pivot_root --disable-kill --disable-utmpdump --disable-raw \ + --disable-rename --disable-login --disable-sulogin --disable-su --disable-runuser --disable-ul --disable-more \ + --disable-pg --disable-schedutils --disable-wall --disable-bash-completion \ + || perror "./configure util-linux failed." + make || perror "util-linux make failed." + DESTDIR="${MODULE_BUILD_DIR}" make install || perror "util-linux make install failed." + cd - &> /dev/null + + # Let's have some starting fun with m4, as we want systemd, which wants automake 1.13, which wants autoconf, + # which wants m4 ... + pinfo "Building m4 Version $REQUIRED_M4_VERSION." + cd "${MODULE_DIR}/src/$REQUIRED_M4_VERSION" + ./configure || perror "./configure m4 failed." + make || perror "m4 make failed." + DESTDIR="${MODULE_BUILD_DIR}" make install || perror "m4 make install failed." + cd - &> /dev/null + + # And have some more fun with autoconf, chain see above: + pinfo "Building autoconf Version $REQUIRED_AUTOCONF_VERSION." + cd "${MODULE_DIR}/src/$REQUIRED_AUTOCONF_VERSION" + ./configure || perror "./configure autoconf failed." + make || perror "autoconf make failed." + DESTDIR="${MODULE_BUILD_DIR}" make install || perror "autoconf make install failed." + cd - &> /dev/null + + # Now let's have some fun with automake, as config.log/automake will whine later about SL's automake 1.11: + # AUTOMAKE='${SHELL} [...] missing automake-1.13'. We use a newer automake than 1.11, if we are at it. + # Link fun, as configure searches in /usr/local/bin, ignores PATH above, also 'share': + ln -s "${MODULE_BUILD_DIR}/usr/local/bin/autom4te" /usr/local/bin/autom4te + ln -s "${MODULE_BUILD_DIR}/usr/local/share/autoconf" /usr/local/share/autoconf + # ... and manipulate perl library path, as else the libs will not be found by (system) perl: + OLDPERL5LIB="$PERL5LIB" + export PERL5LIB="${MODULE_BUILD_DIR}/usr/local/share/autoconf/:$PERL5LIB" + + pinfo "Building automake Version $REQUIRED_AUTOMAKE_VERSION." + cd "${MODULE_DIR}/src/$REQUIRED_AUTOMAKE_VERSION" + ./configure || perror "./configure automake failed." + make || perror "automake make failed." + DESTDIR="${MODULE_BUILD_DIR}" make install || perror "automake make install failed." + cd - &> /dev/null + + # We are having so much compiling fun, why leave out dbus, then? + pinfo "Building dbus Version $REQUIRED_AUTOMAKE_VERSION." + cd "${MODULE_DIR}/src/$REQUIRED_DBUS_VERSION" + ./configure || perror "./configure dbus failed." + make || perror "dbus make failed." + DESTDIR="${MODULE_BUILD_DIR}" make install || perror "automake make install failed." + cd - &> /dev/null + + # patching configure for Scientific Linux - cave - ugly hack! + # pinfo "Scientific Linux detected; patching systemd/configure..." + # cd "${MODULE_DIR}/src/$REQUIRED_VERSION" + # sed 's/dbus-1 >= 1.3.2/dbus-1 >= 1.2.24/g' configure > configure.patched + # mv configure configure.orig + # mv configure.patched configure + # chmod +x configure + + # For compiling systemd later + export PKG_CONFIG_PATH="${MODULE_BUILD_DIR}/usr/lib/pkgconfig/:${MODULE_BUILD_DIR}/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + export CPPFLAGS="$CPPFLAGS -I${MODULE_BUILD_DIR}/usr/include/ -I${MODULE_BUILD_DIR}/usr/local/include/ -I${MODULE_BUILD_DIR}/usr/local/include/dbus-1.0 -I${MODULE_BUILD_DIR}/usr/local/lib/dbus-1.0/include/" + export LDFLAGS="$LDFLAGS -L${MODULE_BUILD_DIR}/usr/lib/ -L${MODULE_BUILD_DIR}/usr/local/lib/ -ldl" + ln -s ${MODULE_BUILD_DIR}/usr/local/include/dbus-1.0 /usr/local/include/dbus-1.0 + ln -s ${MODULE_BUILD_DIR}/usr/local/lib/dbus-1.0 /usr/local/lib/dbus-1.0 + cd - &> /dev/null + + config_systemd + + # ... and tidy our manipulations with path, perllib, links etc. + export PERL5LIB="$OLDPERL5LIB" + export PATH="$OLDPATH" + unlink /usr/local/bin/autom4te + unlink /usr/local/share/autoconf + unlink /usr/local/lib/dbus-1.0 + unlink /usr/local/include/dbus-1.0 + else + config_systemd # Non-Scientific-Linux branch + fi + + pinfo "calling make" + make || perror "systemd make failed." + pinfo "calling make install" + DESTDIR="${MODULE_BUILD_DIR}" make install || perror "systemd make install failed." + cd - &> /dev/null + + + # Delete unneeded services + pinfo "Deleting unneeded services" + local SERVICE= + local OTHER= + for SERVICE in $REQUIRED_DISABLED_SERVICES; do + find "${MODULE_BUILD_DIR}" -name "$SERVICE" -exec rm -r {} \; + for OTHER in $(grep -l -r "$SERVICE" "$MODULE_BUILD_DIR/usr/lib/systemd/system"); do + sed -i -r "s#\s*$SERVICE\s*# #g" "$OTHER" + done + done +} + +post_copy() { + # dont clear systemd log at startup + sed -i "s/TTYVTDisallocate=yes/TTYVTDisallocate=no/g" "${TARGET_BUILD_DIR}/usr/lib/systemd/system/getty@.service" + + #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.bak "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 nfs to modules-load list + echo "nfs" > "${TARGET_BUILD_DIR}/etc/modules-load.d/nfs.conf" + + # 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 +} + diff --git a/remote/modules/systemd/module.build.scientific.README b/remote/modules/systemd/module.build.scientific.README new file mode 100644 index 00000000..bad5a2d4 --- /dev/null +++ b/remote/modules/systemd/module.build.scientific.README @@ -0,0 +1,11 @@ +Building systemd under Scientific Linux 6.4 + +Unfortunately this is not possible, as, at the end of a long chain +of prerequisites (compiling autoconf, automake, m4, utillinux (blkid), +dbus the last requisite cannot be met: +udev-builtin-input_id.c:166: error: 'BTN_TRIGGER_HAPPY' undeclared. + +This 'BTN_TRIGGER_HAPPY' should be provided by kernel headers, but seems +to be intruduced in the headers of kernel 2.6.34 (linux/input.h). + +Scientific Linux uses 2.6.32. diff --git a/remote/modules/systemd/module.conf b/remote/modules/systemd/module.conf new file mode 100644 index 00000000..4ca11365 --- /dev/null +++ b/remote/modules/systemd/module.conf @@ -0,0 +1,65 @@ +REQUIRED_VERSION="systemd-204" +REQUIRED_URL="http://www.freedesktop.org/software/systemd/${REQUIRED_VERSION}.tar.xz" +REQUIRED_LIBKMOD_VERSION="kmod-14" +REQUIRED_LIBKMOD_URL="http://www.kernel.org/pub/linux/utils/kernel/kmod/${REQUIRED_LIBKMOD_VERSION}.tar.gz" +REQUIRED_BINARIES=" + journalctl + loginctl + systemctl + systemd-analyze + systemd-ask-password + systemd-cat + systemd-cgls + systemd-cgtop + systemd-delta + systemd-detect-virt + systemd-inhibit + systemd-machine-id-setup + systemd-notify + systemd-nspawn + systemd-stdio-bridge + systemd-tmpfiles + systemd-tty-ask-password-agent + udevadm + systemd + systemd-ac-power + systemd-binfmt + systemd-cgroups-agent + systemd-fsck + systemd-initctl + systemd-journald + systemd-logind + systemd-modules-load + systemd-multi-seat-x + systemd-random-seed + systemd-readahead + systemd-remount-fs + systemd-reply-password + systemd-shutdown + systemd-shutdownd + systemd-sleep + systemd-sysctl + systemd-timestamp + systemd-udevd + systemd-update-utmp + systemd-user-sessions + systemd-vconsole-setup + systemd-fstab-generator + systemd-getty-generator + systemd-rc-local-generator + systemd-system-update-generator + accelerometer + ata_id + cdrom_id + collect + mtd_probe + scsi_id + v4l_id" +REQUIRED_DIRECTORIES=" + /etc + /usr/include + /usr/share/dbus-1 + /usr/share/polkit-1 + /usr/lib/udev + /usr/lib/tmpfiles.d +" diff --git a/remote/modules/systemd/module.conf.debian b/remote/modules/systemd/module.conf.debian new file mode 100644 index 00000000..2768b51c --- /dev/null +++ b/remote/modules/systemd/module.conf.debian @@ -0,0 +1,13 @@ +REQUIRED_INSTALLED_PACKAGES=" + intltool + gperf + dbus + pkg-config + libcap-dev + libudev-dev + libdbus-1-dev + xsltproc + libblkid-dev + libacl1-dev + libpam-dev +" diff --git a/remote/modules/systemd/module.conf.opensuse b/remote/modules/systemd/module.conf.opensuse new file mode 100644 index 00000000..9326a7dc --- /dev/null +++ b/remote/modules/systemd/module.conf.opensuse @@ -0,0 +1,11 @@ +REQUIRED_INSTALLED_PACKAGES=" + intltool + gperf + pkg-config + libcap-devel + libudev-devel + dbus-1-devel + libxslt-tools + libblkid-devel + libacl-devel +" diff --git a/remote/modules/systemd/module.conf.scientific b/remote/modules/systemd/module.conf.scientific new file mode 100644 index 00000000..54e62b96 --- /dev/null +++ b/remote/modules/systemd/module.conf.scientific @@ -0,0 +1,37 @@ +REQUIRED_VERSION="systemd-204" +REQUIRED_URL="http://www.freedesktop.org/software/systemd/${REQUIRED_VERSION}.tar.xz" + +REQUIRED_LIBKMOD_VERSION="kmod-12" +REQUIRED_LIBKMOD_URL="http://www.kernel.org/pub/linux/utils/kernel/kmod/${REQUIRED_LIBKMOD_VERSION}.tar.gz" + +REQUIRED_UTILLINUX_VERSION="util-linux-2.23" +REQUIRED_UTILLINUX_URL="ftp://ftp.kernel.org/pub/linux/utils/util-linux/v${REQUIRED_UTILLINUX_VERSION}/util-linux-${REQUIRED_UTILLINUX_VERSION}.tar.xz" + +REQUIRED_M4_VERSION="m4-1.4.16" +REQUIRED_M4_URL="ftp://ftp.gnu.org/gnu/m4/${REQUIRED_M4_VERSION}.tar.xz" + +REQUIRED_AUTOCONF_VERSION="autoconf-2.69" +REQUIRED_AUTOCONF_URL="ftp://ftp.gnu.org/gnu/autoconf/${REQUIRED_AUTOCONF_VERSION}.tar.xz" + +REQUIRED_AUTOMAKE_VERSION="automake-1.13" +REQUIRED_AUTOMAKE_URL="ftp://ftp.gnu.org/gnu/automake/${REQUIRED_AUTOMAKE_VERSION}.tar.xz" + +REQUIRED_DBUS_VERSION="dbus-1.6.8" +REQUIRED_DBUS_URL="http://dbus.freedesktop.org/releases/dbus/${REQUIRED_DBUS_VERSION}.tar.gz" + + + +REQUIRED_INSTALLED_PACKAGES=" + intltool + gperf + pkgconfig + libcap-devel + libudev-devel + dbus-devel + libxslt + libblkid-devel + libacl-devel + pam-devel + glib2-devel + expat-devel +" diff --git a/remote/modules/systemd/module.conf.ubuntu b/remote/modules/systemd/module.conf.ubuntu new file mode 100644 index 00000000..2768b51c --- /dev/null +++ b/remote/modules/systemd/module.conf.ubuntu @@ -0,0 +1,13 @@ +REQUIRED_INSTALLED_PACKAGES=" + intltool + gperf + dbus + pkg-config + libcap-dev + libudev-dev + libdbus-1-dev + xsltproc + libblkid-dev + libacl1-dev + libpam-dev +" |