udev: add initramfs-tools, update depends.

--HG--
extra : convert_revision : 2450b2c23182dd801dedb579b86ae3e40c3abdb9
This commit is contained in:
Juan RP 2009-02-19 16:10:13 +01:00
parent b8b01d0e77
commit a392f5f9f4
4 changed files with 127 additions and 1 deletions

View file

@ -13,4 +13,22 @@ long_desc="
udev is a implementation of devfs in userspace using sysfs and
/sbin/hotplug. It requires a 2.5/2.6 kernel to run properly."
run_depends="glibc-2.8"
build_depends="initramfs-tools-0.92 procps-3.2.7"
run_depends="glibc-2.8 $build_depends"
post_install()
{
local destdir=$XBPS_DESTDIR/$pkgname-$version
# Install the initramfs-tools udev scripts.
mkdir -p $destdir/usr/share/initramfs-tools/hooks
mkdir -p $destdir/usr/share/initramfs-tools/scripts/init-premount
mkdir -p $destdir/usr/share/initramfs-tools/scripts/init-bottom
install -m 755 $XBPS_TEMPLATESDIR/udev/udev.initramfs-hook \
$destdir/usr/share/initramfs-tools/hooks/udev
install -m 755 $XBPS_TEMPLATESDIR/udev/udev.initramfs-premount \
$destdir/usr/share/initramfs-tools/scripts/init-premount/udev
install -m 755 $XBPS_TEMPLATESDIR/udev/udev.initramfs-bottom \
$destdir/usr/share/initramfs-tools/scripts/init-bottom/udev
}

View file

@ -0,0 +1,28 @@
#!/bin/sh -e
# initramfs premount script for udev
PREREQ=""
# Output pre-requisites
prereqs()
{
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
# Stop udevd, we'll miss a few events while we run init, but we catch up
pkill udevd
# udevd might have been in the middle of something when we killed it,
# but it doesn't matter because we'll do everything again in userspace
rm -rf /dev/.udev/queue
# Move /dev to the real filesystem
mount -n -o move /dev ${rootmnt}/dev

View file

@ -0,0 +1,51 @@
#!/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
copy_exec /usr/bin/pkill /sbin
# Copy across the udev binaries
copy_exec /sbin/udevd /sbin
copy_exec /sbin/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 /lib/udev/vol_id /lib/udev
copy_exec /lib/udev/scsi_id /lib/udev
copy_exec /lib/udev/path_id /lib/udev
# 61-persistent-storage-edd.rules
#copy_exec /lib/udev/edd_id /lib/udev

View file

@ -0,0 +1,29 @@
#!/bin/sh -e
# initramfs premount script for udev
PREREQ=""
# Output pre-requisites
prereqs()
{
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
# It's all over netlink now
echo "" > /proc/sys/kernel/hotplug
# Start the udev daemon to process events
/sbin/udevd --daemon --resolve-names=never
# Iterate sysfs and fire off everything; if we include a rule for it then
# it'll get handled; otherwise it'll get handled later when we do this again
# in the main boot sequence.
/sbin/udevadm trigger