summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot2014-07-17 15:11:20 +0200
committerroot2014-07-17 15:11:20 +0200
commit9c547a5e5b50813f9441a96f3f8a7bd62d90f0e9 (patch)
tree06abde51e32806f2bd157a1d2d07d0d15820326b
parent[idleaction] Restart cron daemon after creating new crontab (diff)
downloadtm-scripts-9c547a5e5b50813f9441a96f3f8a7bd62d90f0e9.tar.gz
tm-scripts-9c547a5e5b50813f9441a96f3f8a7bd62d90f0e9.tar.xz
tm-scripts-9c547a5e5b50813f9441a96f3f8a7bd62d90f0e9.zip
[pam] reworked how we determine path to PAM-modules
detect the path in remote/helper/paths.inc and use that global path in the build scripts
-rw-r--r--remote/includes/paths.inc10
-rw-r--r--remote/modules/pam/module.build7
-rw-r--r--remote/modules/pam/module.conf.ubuntu4
-rw-r--r--remote/modules/pam/module.conf.ubuntu.145
-rw-r--r--remote/modules/systemd/module.build32
-rw-r--r--remote/modules/systemd/module.conf1
6 files changed, 39 insertions, 20 deletions
diff --git a/remote/includes/paths.inc b/remote/includes/paths.inc
new file mode 100644
index 00000000..ca9c305b
--- /dev/null
+++ b/remote/includes/paths.inc
@@ -0,0 +1,10 @@
+#
+# TODO
+#
+
+for CANDIDATE in $(strings "$(ldd "$(which login)" | grep libpam.so | head -n 1 | awk '{print $3}')" | grep /lib); do
+ [ -f "$CANDIDATE/pam_unix.so" ] && declare -rg SYS_PAM_MODULES_PATH="$CANDIDATE" && break
+done
+
+[ -z "$SYS_PAM_MODULES_PATH" ] && perror "Failed to find pam_unix.so on this system."
+pinfo "PAM Modules are located in '$SYS_PAM_MODULES_PATH'."
diff --git a/remote/modules/pam/module.build b/remote/modules/pam/module.build
index 3f0d8861..067cd431 100644
--- a/remote/modules/pam/module.build
+++ b/remote/modules/pam/module.build
@@ -28,12 +28,13 @@ build() {
tarcopy "$(cat "$COPYLIST")" "${MODULE_BUILD_DIR}"
# build pam-script separatly since we use a source tarball
+
# HACK: find pam_unix.so in MODULE_BUILD_DIR to see where to put pam_script at
- cd "$MODULE_BUILD_DIR"
- local PAM_UNIX_LOCATION=$(find . -name pam_unix.so)
cd "${MODULE_DIR}/src/pam-script-${REQUIRED_PAM_SCRIPT_VERSION}" || perror "Could not cd to ${MODULE_DIR}/src/pam-script-${REQUIRED_PAM_SCRIPT_VERSION}."
- ./configure --prefix=/ --sysconfdir=/etc/pam-script --libdir="$(dirname ${PAM_UNIX_LOCATION:1})" || perror "pam-script: ./configure failed."
+ ./configure --prefix=/ --sysconfdir=/etc/pam-script --libdir="$SYS_PAM_MODULES_PATH" || perror "pam-script: ./configure failed."
make DESTDIR="${MODULE_BUILD_DIR}" install || perror "pam-script: make install to ${MODULE_BUILD_DIR} failed."
+
+
# openSuse 13.1 has no package nss-pam-ldapd. So, we compile it.
if [ -n "$REQUIRED_NSS_LDAPD_URL" ]; then
cd "${MODULE_DIR}/src/$REQUIRED_NSS_LDAPD_VERSION"
diff --git a/remote/modules/pam/module.conf.ubuntu b/remote/modules/pam/module.conf.ubuntu
index 31023197..4a3635fc 100644
--- a/remote/modules/pam/module.conf.ubuntu
+++ b/remote/modules/pam/module.conf.ubuntu
@@ -39,13 +39,11 @@ REQUIRED_BINARIES+="
mount.cifs
"
REQUIRED_DIRECTORIES+="
+ $SYS_PAM_MODULES_PATH
/lib
/usr/lib
"
REQUIRED_SYSTEM_FILES+="
/etc/pam.conf
/etc/default/locale
- /lib/security
- /lib/${ARCH_TRIPLET}/security
- /sbin/mkhomedir_helper
"
diff --git a/remote/modules/pam/module.conf.ubuntu.14 b/remote/modules/pam/module.conf.ubuntu.14
index 2f46770c..26307d84 100644
--- a/remote/modules/pam/module.conf.ubuntu.14
+++ b/remote/modules/pam/module.conf.ubuntu.14
@@ -39,20 +39,19 @@ REQUIRED_BINARIES+="
mount.cifs
"
REQUIRED_DIRECTORIES+="
+ $SYS_PAM_MODULES_PATH
/lib
/usr/lib
"
REQUIRED_SYSTEM_FILES+="
/etc/pam.conf
/etc/default/locale
- /lib/${ARCH_TRIPLET}/security
- /sbin/mkhomedir_helper
"
# For Ubuntu 14.04: Both packages were dropped from official repos. Do not change the
# order, as these packages will be installed via dpkg and depend on each other.
REQUIRED_DOWNLOAD_URLS="
- de.archive.ubuntu.com/ubuntu/pool/universe/n/ncpfs/libncp_2.2.6-9ubuntu1_amd64.deb
+ de.archive.ubuntu.com/ubuntu/pool/universe/n/ncpfs/libncp_2.2.6-9ubuntu1_amd64.deb
de.archive.ubuntu.com/ubuntu/pool/universe/n/ncpfs/libpam-ncp_2.2.6-9ubuntu1_amd64.deb
de.archive.ubuntu.com/ubuntu/pool/universe/n/ncpfs/ncpfs_2.2.6-9ubuntu1_amd64.deb
"
diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build
index 4851f682..6e1cf4c1 100644
--- a/remote/modules/systemd/module.build
+++ b/remote/modules/systemd/module.build
@@ -59,11 +59,28 @@ build () {
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 \
+ ./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 \
+ --with-pamlibdir="$SYS_PAM_MODULES_PATH" \
|| perror "configure failed."
+
pinfo "calling make"
make || perror "make failed."
pinfo "calling make install"
@@ -82,12 +99,5 @@ post_copy() {
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.conf b/remote/modules/systemd/module.conf
index 4ca11365..1bc0165e 100644
--- a/remote/modules/systemd/module.conf
+++ b/remote/modules/systemd/module.conf
@@ -56,6 +56,7 @@ REQUIRED_BINARIES="
scsi_id
v4l_id"
REQUIRED_DIRECTORIES="
+ $SYS_PAM_MODULES_PATH
/etc
/usr/include
/usr/share/dbus-1