|
#!/bin/bash
|
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/package/base/udev/udev.conf
|
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version. A copy of the GNU General Public
|
|
# License can be found at Documentation/COPYING.
|
|
#
|
|
# Many people helped and are helping developing ROCK Linux. Please
|
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
|
|
# file for details.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
udev_pm() {
|
|
# the deletion and re-creation is needed for stage 9 rebuilds
|
|
rm -rf $root/lib/{firmware,udev/devices/{pts,shm,bus/usb}}
|
|
mkdir -p $root/lib/{firmware,udev/devices/{pts,shm,bus/usb}}
|
|
rm -f $root/lib/udev/devices/null
|
|
mknod -m0666 $root/lib/udev/devices/null c 1 3
|
|
add_flist $root/lib/udev/devices/null
|
|
rm -f $root/lib/udev/devices/zero
|
|
mknod -m0666 $root/lib/udev/devices/zero c 1 5
|
|
add_flist $root/lib/udev/devices/zero
|
|
rm -f $root/lib/udev/devices/fd
|
|
ln -sv /proc/self/fd $root/lib/udev/devices/fd
|
|
rm -f $root/lib/udev/devices/core
|
|
ln -sv /proc/kcore $root/lib/udev/devices/core
|
|
rm -f $root/lib/udev/devices/stdin
|
|
ln -sv /proc/self/fd/0 $root/lib/udev/devices/stdin
|
|
rm -f $root/lib/udev/devices/stdout
|
|
ln -sv /proc/self/fd/1 $root/lib/udev/devices/stdout
|
|
rm -f $root/lib/udev/devices/stderr
|
|
ln -sv /proc/self/fd/2 $root/lib/udev/devices/stderr
|
|
# Somehow on boot-up this prevents errors like:
|
|
# cp: will not create hard link `/dev/pts' to directory `/dev/bus/usb'
|
|
touch $root/lib/udev/devices/{pts,shm,bus/usb}/.empty
|
|
|
|
# Install LFS-specific rules and docs.
|
|
# tar $taropt $archdir/udev-config-$udev_config_ver.tar.bz2
|
|
# cd udev-config-$udev_config_ver
|
|
# make install
|
|
# make install-doc
|
|
# make install-extra-doc
|
|
|
|
rm -f etc/udev/rules.d/*.orig
|
|
cp -v etc/udev/rules.d/* $confdir/rules/* $root/etc/udev/rules.d/
|
|
cp -v $confdir/scripts/*.sh $confdir/scripts/modalias_* $root/lib/udev/
|
|
chmod +x $root/lib/udev/*.sh $root/lib/udev/modalias_*
|
|
|
|
install_init udev $confdir/udev.init
|
|
|
|
found_group_error=0
|
|
for group in `grep 'GROUP="[^%]' $root/etc/udev/rules.d/*.rules | sed 's,.*GROUP=",,; s,".*,,;' | sort -u`
|
|
do
|
|
if ! grep -q "^$group:" $root/etc/group; then
|
|
echo "ERROR: Found udev rules not existing group '$group'."
|
|
found_group_error=1
|
|
fi
|
|
done
|
|
[ $found_group_error = 0 ] || abort
|
|
}
|
|
|
|
udev_prem() {
|
|
for i in $(find extras/ -maxdepth 2 -name Makefile); do
|
|
udev_extras="${udev_extras} $(dirname ${i})"
|
|
done
|
|
# DESTDIR=/ prevents kill and restart of udev.
|
|
var_append makeopt " " 'EXTRAS="${udev_extras}"'
|
|
var_append makeinstopt " " 'EXTRAS="${udev_extras}"'
|
|
}
|
|
|
|
prefix=""
|
|
hook_add postmake 1 udev_pm
|
|
hook_add premake 3 udev_prem
|
|
|
|
if [ $stagelevel -le 2 ] ; then
|
|
export LD=$CC
|
|
var_append makeopt " " "CROSS_COMPILE=$archprefix"
|
|
var_append makeinstopt " " "CROSS_COMPILE=$archprefix"
|
|
fi
|