diff options
| -rw-r--r-- | debian/changelog | 8 | ||||
| -rw-r--r-- | debian/control | 2 | ||||
| -rw-r--r-- | hook-functions | 30 | ||||
| -rwxr-xr-x | hooks/evms | 4 | ||||
| -rwxr-xr-x | hooks/lvm | 2 | ||||
| -rwxr-xr-x | hooks/md | 4 | ||||
| -rwxr-xr-x | mkinitramfs | 37 |
7 files changed, 60 insertions, 27 deletions
diff --git a/debian/changelog b/debian/changelog index 05a67bb..637e896 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +initramfs-tools (0.39) unstable; urgency=low + + * Revert the mklibs-small usage patch - reduces needed dependencies: + hook-fuctions: Readds copy_exec. + mkinitramfs, hooks/{evms,lvm,md}: Use copy_exec. + + -- maximilian attems <maks@sternwelten.at> Thu, 17 Nov 2005 18:43:19 +0100 + initramfs-tools (0.38) unstable; urgency=low [ dann frazier ] diff --git a/debian/control b/debian/control index 2ff1be9..de0181f 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.6.2.0 Package: initramfs-tools Architecture: all -Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.070-3), mklibs-copy +Depends: klibc-utils (>= 1.0.14-1ubuntu2), busybox (>= 1:1.01-3), cpio, udev (>= 0.070-3) Provides: linux-initramfs-tool Description: tools for generating an initramfs This package contains tools to create and boot an initramfs for prepackaged diff --git a/hook-functions b/hook-functions index d222d97..c715df5 100644 --- a/hook-functions +++ b/hook-functions @@ -51,6 +51,36 @@ manual_add_modules() done } +# $1 is source +# $2 is relative destination +copy_exec() { + ln -s ${1} ${DESTDIR}/${2} + + # Copy the dependant libraries + for x in $(ldd ${1} 2>/dev/null | sed -e ' + /\//!d; + /linux-gate/d; + /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/}; + s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do + + # Try to use non-optimised libraries where possible. + # We assume that all HWCAP libraries will be in tls. + nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#') + + if [ -e ${nonoptlib} ]; then + x=${nonoptlib} + fi + + libname=$(basename ${x}) + dirname=$(dirname ${x}) + + mkdir -p ${DESTDIR}/${dirname} + if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then + ln -s ${x} ${DESTDIR}/${dirname} + fi + done +} + # Copy entire subtrees to the initramfs copy_modules_dir() { @@ -20,14 +20,14 @@ if [ ! -x /sbin/evms_activate ]; then exit 0 fi -cp /sbin/evms_activate ${DESTDIR}/sbin +copy_exec /sbin/evms_activate /sbin EVMS_VERSION=$(/usr/sbin/evms_query info | grep "EVMS Version" | awk '{ print $3; }') mkdir -p ${DESTDIR}/lib/evms/${EVMS_VERSION} for x in disk lvm2 dos multipath; do - cp /lib/evms/${EVMS_VERSION}/${x}* ${DESTDIR}/lib/evms/${EVMS_VERSION} + copy_exec /lib/evms/${EVMS_VERSION}/${x}* /lib/evms/${EVMS_VERSION} done for x in dm_mod; do @@ -20,7 +20,7 @@ fi . /usr/share/initramfs-tools/hook-functions -cp /lib/lvm-200/vgchange "${DESTDIR}/sbin" +copy_exec /lib/lvm-200/vgchange /sbin for x in dm_mod; do manual_add_modules ${x} @@ -20,8 +20,8 @@ fi . /usr/share/initramfs-tools/hook-functions -cp /sbin/mdadm "${DESTDIR}/sbin" -cp /sbin/mdrun "${DESTDIR}/sbin" +copy_exec /sbin/mdadm /sbin +copy_exec /sbin/mdrun /sbin for x in md raid0 raid1 raid5 raid6; do manual_add_modules ${x} diff --git a/mkinitramfs b/mkinitramfs index 41f45a7..d7bc38b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -158,7 +158,9 @@ fi # Have to do each file, because cpio --dereference doesn't recurse down # symlinks. -cp /usr/share/initramfs-tools/init "${DESTDIR}/init" +ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin +ln -s /usr/lib/klibc/lib/* ${DESTDIR}/lib +copy_exec /usr/share/initramfs-tools/init /init cp -a /usr/share/initramfs-tools/scripts/* "${DESTDIR}/scripts" for f in $(cd /etc/mkinitramfs/scripts && \ find . \( -name '*.dpkg*' -prune -o -name '*~' -prune \) \ @@ -166,39 +168,32 @@ for f in $(cd /etc/mkinitramfs/scripts && \ mkdir --parents "${DESTDIR}/scripts/$(dirname "${f}")" cp -p "/etc/mkinitramfs/scripts/${f}" "${DESTDIR}/scripts/$(dirname "${f}")" done -cp "${CONFDIR}/initramfs.conf" "${DESTDIR}/conf" +copy_exec "${CONFDIR}/initramfs.conf" /conf cp -a /etc/udev "${DESTDIR}/etc" -# udev -cp /sbin/udev "${DESTDIR}/sbin" -cp /sbin/udevd "${DESTDIR}/sbin" -cp /sbin/udevsynthesize "${DESTDIR}/sbin" -cp -a /lib/hotplug "${DESTDIR}/lib" +# Hack until udev is built with klibc +copy_exec /sbin/udev /sbin +copy_exec /sbin/udevd /sbin +copy_exec /sbin/udevsynthesize /sbin # Busybox -cp "${BUSYBOXDIR}/busybox" "${DESTDIR}/bin/busybox" +rm ${DESTDIR}/bin/sh +copy_exec ${BUSYBOXDIR}/busybox /bin/busybox +ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh # Modutils -cp /sbin/modprobe "${DESTDIR}/sbin" -cp /sbin/depmod "${DESTDIR}/sbin" -cp /sbin/rmmod "${DESTDIR}/sbin" +copy_exec /sbin/modprobe /sbin +copy_exec /sbin/depmod /sbin +copy_exec /sbin/rmmod /sbin mkdir -p "${DESTDIR}/etc/modprobe.d" -cp /etc/modprobe.d/aliases "${DESTDIR}/etc/modprobe.d" +copy_exec /etc/modprobe.d/aliases /etc/modprobe.d run_scripts /usr/share/initramfs-tools/hooks run_scripts /etc/mkinitramfs/hooks -mklibs-copy -d "${DESTDIR}/lib" --root="${DESTDIR}" $(find "${DESTDIR}" -type f -perm +0111 -o -name '*.so') - -ln -s /usr/lib/klibc/bin/* "${DESTDIR}/bin" -ln -s /usr/lib/klibc/lib/* "${DESTDIR}/lib" - -rm "${DESTDIR}/bin/sh" -ln -s busybox "${DESTDIR}/bin/sh" - # Apply DSDT to initramfs if [ -e "${CONFDIR}/DSDT.aml" ]; then - cp "${CONFDIR}/DSDT.aml" "${DESTDIR}" + copy_exec "${CONFDIR}/DSDT.aml" / fi (cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip -9 >"${outfile}") |
