void-packages/templates/klibc-udev/files/udev.initramfs-hook
Juan RP 514be496a4 klibc-udev: make this work on the initramfs.
--HG--
extra : convert_revision : 591f7c765141990665b9ee57e02d931bfa7b2a60
2009-03-08 04:14:24 +01:00

50 lines
1.1 KiB
Bash

#!/bin/sh -e
# initramfs hook for udev
MINKVER="2.6.24"
PREREQ=""
# Output pre-requisites
prereqs()
{
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
# We use pkill and rm
copy_exec /usr/bin/pkill /sbin
copy_exec /bin/rm /bin
# Copy across the udev binaries
copy_exec /usr/lib/klibc/udev/udevd /sbin
copy_exec /usr/lib/klibc/udev/udevadm /sbin
# Copy udev configuration
mkdir -p ${DESTDIR}/etc/udev
cp -p /etc/udev/udev.conf ${DESTDIR}/etc/udev
# Only copy across relevant rules
mkdir -p ${DESTDIR}/lib/udev/rules.d
for rules in 50-udev-default.rules 60-persistent-storage.rules \
61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules; do
cp -p /lib/udev/rules.d/$rules ${DESTDIR}/lib/udev/rules.d
done
# Copy across helpers the rules need
mkdir -p ${DESTDIR}/lib/udev
# 50-udev-default.rules
# 60-persistent-storage.rules
#copy_exec /lib/udev/ata_id /lib/udev
#copy_exec /lib/udev/usb_id /lib/udev
copy_exec /usr/lib/klibc/udev/vol_id /lib/udev
#copy_exec /lib/udev/scsi_id /lib/udev
copy_exec /usr/lib/klibc/udev/path_id /lib/udev