mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

81 lines
3.0 KiB

#!/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 ---
# prefix=""
# set_confopt
sbindir="$instroot/sbin"
var_append confopt ' ' '--exec-prefix="${instroot#$root}"'
hook_add postmake 1 udev_pm
udev_pm() {
# the deletion and re-creation is needed for stage 9 rebuilds
rm -rf $root/lib/udev/devices/{pts,shm,bus/usb}
mkdir -p $root/lib/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
rm -f etc/udev/rules.d/*.orig
cp -v $confdir/rules/* $root/etc/udev/rules.d/
# Copy package/architecture specific rules supplied by udev.
# Rules in lib/udev are private to udev and should not be modified by users.
cp -v rules/packages/* $root/lib/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,lib}/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
}
if [ $stagelevel -le 2 ] ; then
export LD=$CC
var_append makeopt " " "CROSS_COMPILE=$archprefix"
var_append makeinstopt " " "CROSS_COMPILE=$archprefix"
fi