summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Jones <cretin@gentoo.org>2006-04-11 21:33:09 +0000
committerStefan Jones <cretin@gentoo.org>2006-04-11 21:33:09 +0000
commitb192338e072ad3316e60f53503484e151124ae54 (patch)
tree08c6128c0bda5f8db8d193b6c2580eb895ce5501 /sys-devel/prelink/files
parentWe've got no isdn... (diff)
downloadgentoo-2-b192338e072ad3316e60f53503484e151124ae54.tar.gz
gentoo-2-b192338e072ad3316e60f53503484e151124ae54.tar.bz2
gentoo-2-b192338e072ad3316e60f53503484e151124ae54.zip
New version from FC5 plus cronjob
(Portage version: 2.1_pre7-r5)
Diffstat (limited to 'sys-devel/prelink/files')
-rw-r--r--sys-devel/prelink/files/digest-prelink-200602133
-rw-r--r--sys-devel/prelink/files/prelink-20060213-symloop.patch13
-rw-r--r--sys-devel/prelink/files/prelink.confd37
-rw-r--r--sys-devel/prelink/files/prelink.cron51
4 files changed, 104 insertions, 0 deletions
diff --git a/sys-devel/prelink/files/digest-prelink-20060213 b/sys-devel/prelink/files/digest-prelink-20060213
new file mode 100644
index 000000000000..4575a3bb7fc9
--- /dev/null
+++ b/sys-devel/prelink/files/digest-prelink-20060213
@@ -0,0 +1,3 @@
+MD5 a3ee7d324ecdf2f1a7b8b95c01ee75fa prelink-20060213.tar.bz2 905983
+RMD160 7b33340b3bdfc9d03ce9e72f548dbe926fff47b4 prelink-20060213.tar.bz2 905983
+SHA256 6ec4473d238fa20341adf4bc9d2402a429f9f06f896e94048ccfbede8fe835a8 prelink-20060213.tar.bz2 905983
diff --git a/sys-devel/prelink/files/prelink-20060213-symloop.patch b/sys-devel/prelink/files/prelink-20060213-symloop.patch
new file mode 100644
index 000000000000..0345cebbc6fa
--- /dev/null
+++ b/sys-devel/prelink/files/prelink-20060213-symloop.patch
@@ -0,0 +1,13 @@
+--- prelink/src/gather.c.jj 2005-06-10 06:21:09.000000000 -0700
++++ prelink/src/gather.c 2006-04-10 19:42:15.000000000 -0700
+@@ -1003,6 +1003,10 @@
+ return 0;
+ ++implicit;
+ ret = nftw64 (name, gather_func, 20, flags | FTW_ACTIONRETVAL);
++ if(ret)
++ {
++ error (0, errno, "Can't walk directory tree %s", name);
++ }
+ --implicit;
+ #ifndef HAVE_FTW_ACTIONRETVAL
+ free (blacklist_dir);
diff --git a/sys-devel/prelink/files/prelink.confd b/sys-devel/prelink/files/prelink.confd
new file mode 100644
index 000000000000..cfe65aa83417
--- /dev/null
+++ b/sys-devel/prelink/files/prelink.confd
@@ -0,0 +1,37 @@
+# Set this to no to disable prelinking altogether
+# (if you change this from yes to no prelink -ua
+# will be run next night to undo prelinking)
+PRELINKING=no
+
+# Options to pass to prelink
+# -m Try to conserve virtual memory by allowing overlapping
+# assigned virtual memory slots for libraries which
+# never appear together in one binary
+# -R Randomize virtual memory slot assignments for libraries.
+# This makes it slightly harder for various buffer overflow
+# attacks, since library addresses will be different on each
+# host using -R.
+PRELINK_OPTS=-mR
+
+# How often should full prelink be run (in days)
+# Normally, prelink will be run in quick mode, every
+# $PRELINK_FULL_TIME_INTERVAL days it will be run
+# in normal mode. Comment it out if it should be run
+# in normal mode always.
+PRELINK_FULL_TIME_INTERVAL=14
+
+# How often should prelink run (in days) even if
+# no packages have been upgraded via portage.
+# If $PRELINK_FULL_TIME_INTERVAL days have not elapsed
+# yet since last normal mode prelinking, last
+# quick mode prelinking happened less than
+# $PRELINK_NOEMER_CHECK_INTERVAL days ago
+# and no packages have been upgraded by portage
+# since last quick mode prelinking, prelink
+# will not do anything.
+# Change to
+# PRELINK_NOEMER_CHECK_INTERVAL=0
+# if you want to disable the portage database timestamp
+# check (especially if you don't use portage
+# exclusively to upgrade system libraries and/or binaries).
+PRELINK_NOEMER_CHECK_INTERVAL=7
diff --git a/sys-devel/prelink/files/prelink.cron b/sys-devel/prelink/files/prelink.cron
new file mode 100644
index 000000000000..9ad52dff9bb7
--- /dev/null
+++ b/sys-devel/prelink/files/prelink.cron
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+. /etc/conf.d/prelink
+
+renice +19 -p $$ >/dev/null 2>&1
+
+if [ "$PRELINKING" != yes ]; then
+ if [ -f /etc/prelink.cache ]; then
+ echo /usr/sbin/prelink -uav > /var/log/prelink.log
+ /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1 \
+ || echo Prelink failed with return value $? >> /var/log/prelink.log
+ rm -f /etc/prelink.cache
+ # Restart init if needed
+ [ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+ fi
+ exit 0
+fi
+
+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \
+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
+ # If cache does not exist or is from older prelink versions or
+ # if we were asked to explicitely, force full prelinking
+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force
+ PRELINK_OPTS="$PRELINK_OPTS -f"
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.{full,quick}
+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
+ = /var/lib/misc/prelink.full ]; then
+ # If no more than PRELINK_NOEMER_CHECK_INTERVAL days elapsed from last prelink
+ # (be it full or quick) and no packages have been upgraded via rpm since then,
+ # don't do anything.
+ [ "`find /var/lib/misc/prelink.quick -mtime -${PRELINK_NOEMER_CHECK_INTERVAL:-7} 2>/dev/null`" \
+ -a -f /var/cache/edb/counter \
+ -a /var/cache/edb/counter -ot /var/lib/misc/prelink.quick ] && exit 0
+ date > /var/lib/misc/prelink.quick
+ # If prelink without -q has been run in the last
+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode
+ PRELINK_OPTS="$PRELINK_OPTS -q"
+else
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.{full,quick}
+fi
+
+echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log
+/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1 \
+ || echo Prelink failed with return value $? >> /var/log/prelink.log
+# Restart init if needed
+[ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+
+exit 0