#!/bin/sh PREREQS="udev" EXEC="/usr/bin/decrypt /bin/bash /sbin/cryptsetup /sbin/dmsetup /bin/mount /bin/egrep /bin/lsblk /bin/sed /usr/bin/tput" RULES="55-dm.rules" FILES='/usr/share/terminfo/l/linux-16color:/lib/terminfo/l/linux' prereqs() { echo "${PREREQ}" } case $1 in prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/hook-functions for exec in ${EXEC}; do if [ -e ${exec} ]; then copy_exec "${exec}" else echo "${exec} not found" fi done mkdir -p ${DESTDIR}/lib/udev/rules.d/; do for rules in ${RULES}; do if [ -e /etc/udev/rules.d/${rules} ]; then cp -p "/etc/udev/rules.d/${rules}" "${DESTDIR}/etc/udev/rules.d/" elif [ -e /lib/udev/rules.d/${rules} ]; then cp -p "/lib/udev/rules.d/${rules}" "${DESTDIR}/lib/udev/rules.d/" else echo "${rules} not found" fi done for files in ${FILES}; do FILES_SRC=$(echo ${files} | sed 's/:.*//') FILES_DST=$(echo ${files} | sed 's/.*://') FILES_NAME=$(echo ${files} | sed 's|.*/||') FILES_PATH=$(echo ${FILES_DST} | sed "s|${FILES_NAME}||") mkdir -p ${DESTDIR}${FILES_PATH} if [ -e ${FILES_SRC} ]; then cp -p "${FILES_SRC}" "${DESTDIR}${FILES_DST}" else echo "${FILES_SRC} not found" fi done exit 0