Commit 5e315c4c authored by Phil's avatar Phil

update udev for initscripts 2011.09 series

parent 71efb43c
......@@ -6,7 +6,7 @@
pkgname=chakra-live
pkgver=2011.04
pkgrel=0.20110621.1
pkgrel=0.20110623.1
pkgdesc="Chakra GNU/Linux livecd/liveusb generation scripts"
arch=('any')
url="https://gitorious.org/chakra/chakra-live"
......@@ -17,7 +17,7 @@ makedepends=('git')
provides=()
conflicts=()
source=(http://chakra-project.org/sources/${pkgname}/${pkgname}-${pkgver}-${pkgrel}.tar.xz)
md5sums=(f42acd788c1708447663e0b43faf8961)
md5sums=(0522ada174268459fbeaec4ddf8466b6)
# create tarball: source PKGBUILD && mksource
......@@ -34,4 +34,4 @@ mksource() {
package() {
cd ${srcdir}/${pkgname}/chakra-iso
make DESTDIR="$pkgdir" install
}
\ No newline at end of file
}
# do not edit this file, it will be overwritten on update
ACTION=="remove", GOTO="drivers_end"
DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/lib/udev/load-modules.sh $env{MODALIAS}"
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/lib/udev/load-modules.sh tifm_sd"
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/lib/udev/load-modules.sh tifm_ms"
SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh ms_block"
SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh mspro_block"
SUBSYSTEM=="i2o", RUN+="/lib/udev/load-modules.sh i2o_block"
SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/lib/udev/load-modules.sh sg"
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/lib/udev/load-modules.sh ppdev"
LABEL="drivers_end"
......@@ -19,37 +19,6 @@
# global stuff
#
#####################################
###### Hotplug rules - begin
# Only additional modules,
# which are not detectable,
# are loaded here!
#####################################
# check if the device has already been claimed by a driver
ACTION!="add", GOTO="drivers_end"
#PNP addon modules
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP0800", RUN+="/lib/udev/load-modules.sh pcspkr"
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="*PNP051[01]*", RUN+="/lib/udev/load-modules.sh irtty-sir"
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNPb02f", RUN+="/lib/udev/load-modules.sh analog"
# PARPORT addon modules
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh lp"
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh ppdev"
# fix ide cdrom detection on old proliant servers
SUBSYSTEM=="pci", ENV{MODALIAS}=="pci:v00000E11d00000001sv00000000sd00000000bc06sc02i00", RUN+="/lib/udev/load-modules.sh ide-generic"
LABEL="drivers_end"
#####################################
##### Hotplug rules - end
#####################################
#####################################
# Additional Chakra GNU/Linux
# Permissions and Symlinks - begin
#####################################
# permission for sg devices
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660"
......
......@@ -7,31 +7,22 @@
pkgbase="udev"
pkgname=('udev' 'udev-compat')
pkgver=171
pkgrel=3
pkgrel=2
arch=(i686 x86_64)
url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
license=('GPL')
groups=('base')
# older initscripts versions required start_udev
options=(!makeflags !libtool)
conflicts=('initscripts<2011.09')
makedepends=('glibc' 'coreutils' 'util-linux' 'pciutils' 'libusb-compat' 'glib2' 'kernel26' 'gperf' 'libxslt' 'gobject-introspection')
source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgbase-$pkgver.tar.bz2
80-drivers.rules
81-chakra.rules
load-modules.sh
81-chakra.rules
static-audio-nodes-group.patch
static-nodes-permissions.patch)
md5sums=('bdf4617284be2ecac11767437417e209'
'4427855146513a4703ab5c7eb8a0156e'
'0343412cecef4bb662ac91403c1ed53e'
'f91fddc67609b45b244a624977c4247b'
'4f625aea95a5597afd8cdf189421f193'
'f9e50b8dfcd2215f5423ff9bc04ecf68')
build() {
cd $srcdir/$pkgbase-$pkgver
# fix https://bugs.archlinux.org/task/24362 (will be in udev-172)
patch -Np1 -i ../static-audio-nodes-group.patch
patch -Np1 -i ../static-nodes-permissions.patch
./configure --sysconfdir=/etc --with-rootlibdir=/lib --libexecdir=/lib/udev\
......@@ -52,12 +43,8 @@ package_udev() {
cd $srcdir/$pkgbase-$pkgver
make DESTDIR=${pkgdir} install
# Replace original 80-drivers.rules with custom one.
install -D -m644 $srcdir/80-drivers.rules $pkgdir/lib/udev/rules.d/80-drivers.rules
# Install our rule for permissions and symlinks
install -D -m644 $srcdir/81-chakra.rules $pkgdir/lib/udev/rules.d/81-chakra.rules
# install our module loading subsystem
install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh
# create framebuffer blacklist
mkdir -p $pkgdir/etc/modprobe.d/
......@@ -108,3 +95,7 @@ package_udev-compat() {
install -d -m755 ${pkgdir}/lib/${pkgbase}/rules.d
install -D -m644 ${srcdir}/${pkgbase}-${pkgver}/rules/misc/30-kernel-compat.rules ${pkgdir}/lib/udev/rules.d/30-kernel-compat.rules
}
md5sums=('bdf4617284be2ecac11767437417e209'
'97eec6fa818878bd7e87d374e7cd9fb0'
'4f625aea95a5597afd8cdf189421f193'
'f9e50b8dfcd2215f5423ff9bc04ecf68')
#!/bin/bash
# Implement blacklisting for udev-loaded modules
[ $# -ne 1 ] && exit 1
. /etc/rc.conf
# grab modules from rc.conf
BLACKLIST="${MOD_BLACKLIST[@]}"
MODPROBE="/sbin/modprobe"
LOGGER="/usr/bin/logger"
RESOLVEALIAS="${MODPROBE} --resolve-alias"
USEBLACKLIST="--use-blacklist"
if [ -f /proc/cmdline ]; then
for cmd in $(cat /proc/cmdline); do
case $cmd in
disablemodules=*) eval $cmd ;;
load_modules=off) exit ;;
esac
done
#parse cmdline entries of the form "disablemodules=x,y,z"
if [ -n "$disablemodules" ]; then
BLACKLIST="$BLACKLIST $(echo $disablemodules | sed 's|,| |g')"
fi
fi
#MODULES entries in rc.conf that begin with ! are blacklisted
for mod in ${MODULES[@]}; do
if [ "${mod}" != "${mod#!}" ]; then
BLACKLIST="$BLACKLIST ${mod#!}"
fi
done
if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" ]; then
if [ -n "${BLACKLIST}" ]; then
# If an alias name is on the blacklist, load no modules for this device
if echo "${BLACKLIST}" | /bin/grep -q -e " $1 " -e "^$1 " -e " $1\$"; then
$LOGGER -p info -t "$(basename $0)" "Not loading module alias '$1' because it is blacklisted"
exit
fi
#sanitize the blacklist
BLACKLIST="$(echo "$BLACKLIST" | sed -e 's|-|_|g')"
# Try to find all modules for the alias
mods=$($RESOLVEALIAS $1)
# If no modules could be found, try if the alias name is a module name
# In that case, omit the --use-blacklist parameter to imitate normal modprobe behaviour
[ -z "${mods}" ] && $MODPROBE -qni $1 && mods="$1" && USEBLACKLIST=""
[ -z "${mods}" ] && $LOGGER -p local0.debug -t "$(basename $0)" "'$1' is not a valid module or alias name"
for mod in ${mods}; do
# Find the module and all its dependencies
deps="$($MODPROBE -i --show-depends ${mod})"
[ $? -ne 0 ] && continue
#sanitize the module names
deps="$(echo "$deps" | sed \
-e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" \
-e 's|-|_|g')"
# If the module or any of its dependencies is blacklisted, don't load it
for dep in $deps; do
if echo "${BLACKLIST}" | /bin/grep -q -e " ${dep} " -e "^${dep} " -e " ${dep}\$"; then
if [ "${dep}" = "${mod}" ]; then
$LOGGER -p local0.info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because it is blacklisted"
else
$LOGGER -p local0.info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because its dependency '${dep}' is blacklisted"
fi
continue 2
fi
done
# modprobe usually uses the "blacklist" statements from modprobe.conf only to blacklist all aliases
# of a module, but not the module itself. We use --use-blacklist here so that modprobe also blacklists
# module names if we resolved alias names manually above
$MODPROBE $USEBLACKLIST ${mod}
done
else
$MODPROBE $USEBLACKLIST $1
fi
fi
# vim: set et ts=4:
......@@ -8,9 +8,36 @@ post_upgrade() {
echo "udev >=098 rules syntax has changed, please update your own rules."
echo "udev >=099 Added persistent network and CD/DVD Symlink generator rules."
echo "Please read the instructions carefully before reboot."
echo "They are located in /etc/udev/readme-udev-chakra.txt"
echo "They are located in /etc/udev/readme-udev-arch.txt"
echo "----------"
fi
if [ "$(vercmp $2 169)" -lt 0 ]; then
echo "ATTENTION UDEV:"
echo "---------------"
echo "Kernel 2.6.32 or newer is now required."
echo "OSS emulation modules are not loaded by default, add to rc.conf if needed."
echo "Arch specific cd symlinks are now no longer created."
echo "cd and net persistent rules will no longer be autogenerated,"
echo "see <https://wiki.archlinux.org/index.php/Udev> for details."
echo "Errors are now logged (possibly to the console) by default."
echo "---------------"
fi
if [ "$(vercmp $2 172)" -lt 0 ]; then
echo "ATTENTION UDEV:"
echo "---------------"
echo "Arch's custom blacklisting logic has been removed. MOD_AUTOLOAD and"
echo "blacklisting in MODULES no longer works."
echo "See 'man modprobe.conf' for a replacement to blacklisting."
echo "To disable a module mod1 on the kernel command line, use"
echo "mod1.disable=1"
echo "or"
echo "modprobe.blacklist=mod1"
echo " --"
echo "The following modules are no longer unconditionally loaded:"
echo " pcspkr irtty-sir analog lp ppdev ide-generic"
echo "Add them to MODULES in rc.conf if you need them."
echo "---------------"
fi
}
post_install() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment