Added klibc-udev-138 template, for the initramfs.
Move initramfs-tools udev hook to this pkg. --HG-- extra : convert_revision : d88915bc50cdf9211fae16f09a3b306814c6ed1f
This commit is contained in:
46
templates/klibc-udev/build.diff
Normal file
46
templates/klibc-udev/build.diff
Normal file
@@ -0,0 +1,46 @@
|
||||
--- udev/udev-util.c 2008-11-06 02:56:15.000000000 +0100
|
||||
+++ udev/udev-util.c 2008-11-09 18:28:30.000000000 +0100
|
||||
@@ -126,6 +126,7 @@
|
||||
|
||||
uid_t util_lookup_user(struct udev *udev, const char *user)
|
||||
{
|
||||
+ /*
|
||||
char *endptr;
|
||||
int buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
|
||||
char buf[buflen];
|
||||
@@ -147,11 +148,13 @@
|
||||
err(udev, "specified user '%s' unknown\n", user);
|
||||
else
|
||||
err(udev, "error resolving user '%s': %m\n", user);
|
||||
+ */
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern gid_t util_lookup_group(struct udev *udev, const char *group)
|
||||
{
|
||||
+ /*
|
||||
char *endptr;
|
||||
int buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||
char buf[buflen];
|
||||
@@ -173,6 +176,7 @@
|
||||
err(udev, "specified group '%s' unknown\n", group);
|
||||
else
|
||||
err(udev, "error resolving group '%s': %m\n", group);
|
||||
+ */
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- Makefile.in.orig 2009-03-08 01:04:54.032608782 +0100
|
||||
+++ Makefile.in 2009-03-08 01:05:10.728461250 +0100
|
||||
@@ -212,10 +212,7 @@ AM_CFLAGS =
|
||||
AM_LDFLAGS = \
|
||||
-Wl,--as-needed
|
||||
|
||||
-SUBDIRS = \
|
||||
- udev \
|
||||
- rules \
|
||||
- extras
|
||||
+SUBDIRS = udev
|
||||
|
||||
udevconfdir = $(sysconfdir)/udev
|
||||
udevconf_DATA = \
|
||||
28
templates/klibc-udev/files/udev.initramfs-bottom
Normal file
28
templates/klibc-udev/files/udev.initramfs-bottom
Normal 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
|
||||
50
templates/klibc-udev/files/udev.initramfs-hook
Normal file
50
templates/klibc-udev/files/udev.initramfs-hook
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/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/bin/udevd /sbin
|
||||
copy_exec /usr/lib/klibc/bin/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
|
||||
29
templates/klibc-udev/files/udev.initramfs-premount
Normal file
29
templates/klibc-udev/files/udev.initramfs-premount
Normal 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
|
||||
44
templates/klibc-udev/template
Normal file
44
templates/klibc-udev/template
Normal file
@@ -0,0 +1,44 @@
|
||||
# Template file for 'klibc-udev'
|
||||
pkgname=klibc-udev
|
||||
version=138
|
||||
wrksrc="udev-${version}"
|
||||
distfiles="
|
||||
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-$version.tar.bz2"
|
||||
build_style=custom-install
|
||||
configure_args="--prefix="
|
||||
configure_env="CC=klcc LD=klcc"
|
||||
short_desc="A Userspace implementation of devfs (for initramfs)"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
checksum=bc525a4d6bdbace1b23433256643cc331e4049e1e2442333707e6d2ba8a173b4
|
||||
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.
|
||||
|
||||
This package has been built with klibc for use on the initramfs."
|
||||
|
||||
Add_dependency build klibc-devel
|
||||
Add_dependency run klibc
|
||||
|
||||
do_install()
|
||||
{
|
||||
local destdir=$XBPS_DESTDIR/$pkgname-$version
|
||||
|
||||
cd $wrksrc
|
||||
CC=klcc LD=klcc CFLAGS="-O2" ./configure --prefix=
|
||||
make || exit 1
|
||||
|
||||
install -d ${destdir}/usr/lib/klibc/bin
|
||||
install -s -m755 udev/udevd ${destdir}/usr/lib/klibc/bin
|
||||
install -s -m755 udev/udevadm ${destdir}/usr/lib/klibc/bin
|
||||
|
||||
# Install the initramfs-tools hook.
|
||||
install -d $destdir/usr/share/initramfs-tools/hooks
|
||||
install -d $destdir/usr/share/initramfs-tools/scripts/init-premount
|
||||
install -d $destdir/usr/share/initramfs-tools/scripts/init-bottom
|
||||
install -m 755 ${FILESDIR}/udev.initramfs-hook \
|
||||
$destdir/usr/share/initramfs-tools/hooks/udev
|
||||
install -m 755 ${FILESDIR}/udev.initramfs-premount \
|
||||
$destdir/usr/share/initramfs-tools/scripts/init-premount/udev
|
||||
install -m 755 ${FILESDIR}/udev.initramfs-bottom \
|
||||
$destdir/usr/share/initramfs-tools/scripts/init-bottom/udev
|
||||
}
|
||||
Reference in New Issue
Block a user