Browse Source

Andreas V. Meier, fake:


			
			
				rocklinux
			
			
		
Andreas V. 'netrunner' Meier 19 years ago
parent
commit
954ed4f2ce
18 changed files with 413 additions and 165 deletions
  1. +3
    -4
      package/base/rockinitrd/init
  2. +2
    -2
      package/base/rockinitrd/initrd_base.txt
  3. +7
    -2
      package/base/rockinitrd/mkinitrd.sh
  4. +150
    -0
      package/base/udev/devfs.rules
  5. +25
    -0
      package/base/udev/dont-kill-and-restart-udevd.patch
  6. +0
    -12
      package/base/udev/microcode.patch
  7. +1
    -1
      package/base/udev/permissions.rules
  8. +47
    -0
      package/base/udev/scripts/ide-devfs.sh
  9. +1
    -1
      package/base/udev/scripts/inputdev.sh
  10. +50
    -0
      package/base/udev/scripts/raid-devfs.sh
  11. +100
    -0
      package/base/udev/scripts/scsi-devfs.sh
  12. +0
    -39
      package/base/udev/scsi_dev_discs.patch
  13. +0
    -21
      package/base/udev/scsi_dev_discs_rules.patch
  14. +24
    -9
      package/base/udev/udev.conf
  15. +0
    -57
      package/base/udev/useless_use_of_cat.patch
  16. +2
    -1
      target/bootdisk/build_stage1.sh
  17. +1
    -4
      target/bootdisk/linuxrc.sh
  18. +0
    -12
      target/bootdisk/linuxrc2.sh

+ 3
- 4
package/base/rockinitrd/init

@ -44,13 +44,12 @@ mount -n -t tmpfs tmpfs /tmp || echo "Can't mount tmpfs!"
mount -n -t proc proc /proc || echo "Can't mount procfs!"
mount -n -t sysfs sysfs /sys || echo "Can't mount sysfs!"
mount -n -t ramfs ramfs /dev || echo "Can't mount ramfs!"
cp -r /lib/udev/devices/* /dev
echo "" > /proc/sys/kernel/hotplug
/sbin/udevd --daemon
rm -rf /dev/fd
ln -sf /proc/self/fd /dev
mkdir -p /dev/pts /dev/shm
if [ -n "${real_root}" ] ; then
rootfs=${real_root}
else

+ 2
- 2
package/base/rockinitrd/initrd_base.txt

@ -5,6 +5,7 @@
/bin/cat /bin/cat
/bin/ln /bin/ln
/bin/rm /bin/rm
/bin/cp /bin/cp
/usr/bin/readlink /bin/readlink
/usr/bin/basename /bin/basename
/usr/bin/tr /bin/tr
@ -12,10 +13,9 @@
/bin/gawk /bin/awk
/bin/sleep /bin/sleep
/sbin/udev /sbin/udev
/sbin/udevstart /sbin/udevstart
/sbin/udevsend /sbin/udevsend
/sbin/udevd /sbin/udevd
/etc/udev /etc/udev
/lib/udev_run_hotplugd /lib/udev_run_hotplugd
/lib/udev /lib/udev
/etc/hotplug.d /etc/hotplug.d
/etc/hotplug /etc/hotplug

+ 7
- 2
package/base/rockinitrd/mkinitrd.sh

@ -66,11 +66,12 @@ for x in /etc/conf/initrd/initrd_* ; do
[ -f $x ] || continue
while read file target ; do
if [ -d $file ] ; then
find $file -type f | while read f ; do
find $file -type f -o -type b -o -type c -o -type l | while read f ; do
tfile=${targetdir}/${target}/${f#$file}
[ -e $tfile ] && continue
mkdir -p ${tfile%/*}
cp $f $tfile
cp -a $f $tfile
file $x | grep -q ELF || continue
libs="$libs `ldd $f 2>/dev/null | grep -v 'not a dynamic executable' | sed -e 's,^[\t ]*,,g' | cut -f 3 -d' '`"
done
fi
@ -95,6 +96,10 @@ while [ -n "$libs" ] ; do
done
done
# though this is not clean, it helps avoid a warning from fsck about
# it being unable to determine wether a filesystem is mounted.
ln -s /proc/mounts $targetdir/etc/mtab
itmp=`mktemp`
mkfs.cramfs $tmpdir ${itmp}
gzip -9 < ${itmp} > /boot/initrd-${kernel}.img

+ 150
- 0
package/base/udev/devfs.rules

@ -0,0 +1,150 @@
# There are a number of modifiers that are allowed to be used in some
# of the different fields. They provide the following subsitutions:
#
# %n the "kernel number" of the device.
# For example, 'sda3' has a "kernel number" of '3'
# %e the smallest number for that name which does not matches an existing node
# %k the kernel name for the device
# %M the kernel major number for the device
# %m the kernel minor number for the device
# %b the bus id for the device
# %c the string returned by the PROGRAM
# %s{filename} the content of a sysfs attribute
# %% the '%' char itself
#
# workaround for devices which do not report media changes
BUS=="ide", KERNEL=="hd[a-z]", SYSFS{removable}=="1", \
ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions"
# IDE devices
BUS=="ide", KERNEL=="hd[a-z]*", PROGRAM="/lib/udev/ide-devfs.sh %k %b %n", \
NAME="%c{1}", SYMLINK+="%k %c{2}", GROUP="%c{3}"
# SCSI devices
BUS=="scsi", KERNEL=="sd*", PROGRAM="/lib/udev/scsi-devfs.sh sd %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
BUS=="scsi", KERNEL=="sr*", PROGRAM="/lib/udev/scsi-devfs.sh sr %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
BUS=="scsi", KERNEL=="st*", PROGRAM="/lib/udev/scsi-devfs.sh st %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
BUS=="scsi", KERNEL=="sg*", PROGRAM="/lib/udev/scsi-devfs.sh sg %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
# RAID controllers
KERNEL=="cciss!*|ida!*|rd!*", PROGRAM="/lib/udev/raid-devfs.sh %k", \
NAME="%c{1}", SYMLINK+="%k"
# other block devices
KERNEL=="md[0-9]*", NAME="md/%n",
KERNEL=="loop[0-9]*", NAME="loop/%n"
KERNEL=="ram[0-9]*", NAME="rd/%n"
# USB devices
BUS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
BUS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
BUS=="usb", KERNEL=="dabusb*", NAME="usb/%k"
BUS=="usb", KERNEL=="hiddev*", NAME="usb/%k"
BUS=="usb", KERNEL=="legousbtower*", NAME="usb/%k"
BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
BUS=="usb", KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", \
SYMLINK+="pilot"
# usbfs-like devices
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; B=$${K%%%%.*}; D=$${K#*.}; echo bus/usb/$$B/$$D'", \
NAME="%c"
# serial devices
KERNEL=="ttyS[0-9]*", NAME="tts/%n"
KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n"
KERNEL=="rfcomm[0-9]*", NAME="bluetooth/rfcomm/%n",
KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
KERNEL=="capi[0-9]*", NAME="capi/%n"
# vc devices
KERNEL=="tty[0-9]*", NAME="vc/%n"
KERNEL=="vcs", NAME="vcc/0"
KERNEL=="vcs[0-9]*", NAME="vcc/%n"
KERNEL=="vcsa", NAME="vcc/a0"
KERNEL=="vcsa[0-9]*", NAME="vcc/a%n"
# video devices
KERNEL=="video[0-9]*", NAME="v4l/%k"
KERNEL=="radio[0-9]*", NAME="v4l/%k"
KERNEL=="vbi[0-9]*", NAME="v4l/%k"
KERNEL=="vtx[0-9]*", NAME="v4l/%k"
KERNEL=="dvb*", PROGRAM="/bin/sh -c 'KNAME=%k; KNAME=$${KNAME#dvb}; A=$${KNAME%%%%.*}; D=$${KNAME#*.}; echo dvb/adapter$$A/$$D'", \
NAME="%c"
KERNEL=="fb[0-9]*", NAME="fb/%n"
KERNEL=="card[0-9]*", NAME="dri/%k"
# misc devices
KERNEL=="apm_bios", NAME="misc/%k",
KERNEL=="agpgart", NAME="misc/%k"
KERNEL=="hw_random", NAME="hwrng"
KERNEL=="nvram", NAME="misc/%k"
KERNEL=="psaux", NAME="misc/%k"
KERNEL=="rtc", NAME="misc/%k"
KERNEL=="tun", NAME="net/%k"
# printers and parallel devices
KERNEL=="lp[0-9]*", NAME="printers/%n"
KERNEL=="parport[0-9]*", NAME="parports/%n"
KERNEL=="i2c-[0-9]*", NAME="i2c/%n"
KERNEL=="fd[0-9]*", NAME="floppy/%n"
KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
KERNEL=="pktcdvd", NAME="pktcdvd/control"
KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
KERNEL=="microcode", NAME="cpu/microcode", SYMLINK="misc/microcode"
KERNEL=="umad*", NAME="infiniband/%k"
KERNEL=="issm*", NAME="infiniband/%k"
KERNEL=="uverbs*", NAME="infiniband/%k"
KERNEL=="ucm*", NAME="infiniband/%k"
# sound devices
KERNEL=="controlC[0-9]*", NAME="snd/%k"
KERNEL=="hwC[D0-9]*", NAME="snd/%k"
KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
KERNEL=="midiC[D0-9]*", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
KERNEL=="audio*", NAME="sound/%k"
KERNEL=="dsp*", NAME="sound/%k"
KERNEL=="adsp*", NAME="sound/%k"
KERNEL=="midi*", NAME="sound/%k"
KERNEL=="mixer*", NAME="sound/%k"
KERNEL=="sequencer*", NAME="sound/%k"
KERNEL=="amidi*", NAME="sound/%k"
KERNEL=="dmmidi*", NAME="sound/%k"
KERNEL=="admmidi*", NAME="sound/%k"
# ieee1394 devices
KERNEL=="dv1394*", NAME="dv1394/%n"
KERNEL=="video1394*", NAME="video1394/%n"
# input devices
KERNEL=="mice", NAME="input/%k"
KERNEL=="mouse[0-9]*", NAME="input/%k"
KERNEL=="event[0-9]*", NAME="input/%k"
KERNEL=="js[0-9]*", NAME="input/%k"
KERNEL=="ts[0-9]*", NAME="input/%k"
KERNEL=="uinput", NAME="input/%k"
# Zaptel
KERNEL=="zapctl", NAME="zap/ctl"
KERNEL=="zaptimer", NAME="zap/timer"
KERNEL=="zapchannel", NAME="zap/channel"
KERNEL=="zappseudo", NAME="zap/pseudo"
KERNEL=="zap[0-9]*", NAME="zap/%n"
# AOE character devices
SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k"
SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k"
SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
# device mapper creates its own device nodes, so ignore these
KERNEL=="dm-[0-9]*", NAME=""
KERNEL=="device-mapper", NAME="mapper/control"

+ 25
- 0
package/base/udev/dont-kill-and-restart-udevd.patch

@ -0,0 +1,25 @@
--- ./Makefile.orig 2006-03-14 23:08:37.000000000 +0100
+++ ./Makefile 2006-03-14 23:09:18.000000000 +0100
@@ -294,11 +294,6 @@
@extras="$(EXTRAS)"; for target in $$extras; do \
$(MAKE) -C $$target $@ || exit 1; \
done;
-ifndef DESTDIR
- - killall udevd
- - rm -rf /dev/.udev
- - $(sbindir)/udevd --daemon
-endif
.PHONY: install-bin
uninstall-bin:
@@ -307,10 +302,6 @@
- rm -f $(DESTDIR)$(usrsbindir)/udevmonitor
- rm -f $(DESTDIR)$(usrbindir)/udevinfo
- rm -f $(DESTDIR)$(usrbindir)/udevtest
-ifndef DESTDIR
- - killall udevd
- - rm -rf /dev/.udev
-endif
@extras="$(EXTRAS)"; for target in $$extras; do \
$(MAKE) -C $$target $@ || exit 1; \
done;

+ 0
- 12
package/base/udev/microcode.patch

@ -1,12 +0,0 @@
diff -pruN udev-084-orig/etc/udev/debian/devfs.rules udev-084/etc/udev/debian/devfs.rules
--- udev-084-orig/etc/udev/debian/devfs.rules 2006-02-14 16:11:51.000000000 +0100
+++ udev-084/etc/udev/debian/devfs.rules 2006-02-14 16:13:23.000000000 +0100
@@ -96,7 +96,7 @@ KERNEL=="pktcdvd", NAME="pktcdvd/contro
KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
-KERNEL=="microcode", NAME="cpu/microcode"
+KERNEL=="microcode", NAME="cpu/microcode", SYMLINK="misc/microcode"
KERNEL=="umad*", NAME="infiniband/%k"
KERNEL=="issm*", NAME="infiniband/%k"

+ 1
- 1
package/base/udev/permissions.rules

@ -71,7 +71,7 @@ KERNEL=="dv1394*", GROUP="video"
KERNEL=="video1394*", GROUP="video"
# input devices
KERNEL=="event[0-9]*", PROGRAM="/etc/udev/scripts/inputdev.sh %k", \
KERNEL=="event[0-9]*", PROGRAM="/lib/udev/inputdev.sh %k", \
RESULT=="inputdev", MODE="0664", GROUP="video"
KERNEL=="js[0-9]*", MODE="0664"

+ 47
- 0
package/base/udev/scripts/ide-devfs.sh

@ -0,0 +1,47 @@
#!/bin/bash
# udev external PROGRAM script
# return devfs-names for ide-devices
# BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}", GROUP="%c{3}"
HOST="${2%\.[0-9]}"
TARGET="${2#[0-9]\.}"
if [ -z "${HOST#[13579]}" ]; then
HOST=$((${HOST} - 1))
BUS="1"
else
BUS="0"
fi
get_dev_number() {
num=0
DRIVE="${1%%[0-9]*}"
for x in /proc/ide/*/media; do
if [ -e "${x}" ]; then
lMEDIA=`cat ${x}`
if [ "${lMEDIA}" = "$2" ]; then
num=$((${num} + 1))
fi
if [ "${x}" = "/proc/ide/${DRIVE}/media" ]; then
break
fi
fi
done
echo $((${num} - 1))
}
if [ -z "$3" ] && [ -f /proc/ide/${1}/media ]; then
MEDIA=`cat /proc/ide/${1}/media`
if [ "${MEDIA}" = "cdrom" ]; then
echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` ${MEDIA}
elif [ "${MEDIA}" = "floppy" ]; then
echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc ${MEDIA}
elif [ "${MEDIA}" = "disk" ]; then
echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc ${MEDIA}
fi
else
echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`get_dev_number $1 disk`/part$3
fi

package/base/udev/inputdev.sh → package/base/udev/scripts/inputdev.sh

@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash -e
#
# Scans /proc/bus/input/devices for the given device.
#

+ 50
- 0
package/base/udev/scripts/raid-devfs.sh

@ -0,0 +1,50 @@
#!/bin/bash -e
#
# Copyright (c) 2004 Marco d'Itri <md@linux.it>
# Copyright (c) 2004 Piotr Roszatycki <dexter@debian.org>
#
# Usage:
# KERNEL=="cciss!*", PROGRAM="/lib/udev/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
# KERNEL=="ida!*", PROGRAM="/lib/udev/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
# KERNEL=="rd!*", PROGRAM="/lib/udev/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
get_dev_number_cciss() {
grep '^cciss/' /proc/driver/cciss/* | cat -n | \
sed -n "/cciss\/$1:/s/cciss.*//p"
}
get_dev_number_ida() {
grep '^ida/' /proc/driver/cpqarray/* | cat -n | \
sed -n "/ida\/$1:/s/ida.*//p"
}
get_dev_number_rd() {
grep '^ */dev/rd/' /proc/rd/*/initial_status | cat -n | \
sed -n "/rd\/$1:/s/\/dev\/rd.*//p"
}
get_dev_number() {
dev=$1
num=$(eval $(echo get_dev_number_$TYPE $dev))
[ "$num" ] || exit 1
echo $(($num - 1))
}
TYPE=${1%%/*}
NAME=${1#*/}
# abort if there was no match
[ "$TYPE" != "$1" ] || exit 1
case "$NAME" in
*p*)
LONG_NAME=disc$(get_dev_number ${NAME%%p*})/part${NAME##*p}
;;
*)
LONG_NAME=disc$(get_dev_number $NAME)/disc
;;
esac
echo "$TYPE/$LONG_NAME"
exit 0

+ 100
- 0
package/base/udev/scripts/scsi-devfs.sh

@ -0,0 +1,100 @@
#!/bin/bash
#
# scsi-devfs.sh: udev external PROGRAM script
#
# Copyright 2004 Richard Gooch <rgooch@atnf.csiro.au>
# Copyright 2004 Fujitsu Ltd.
# Distributed under the GNU Copyleft version 2.0.
#
# return devfs-names for scsi-devices
# Usage in udev.rules:
# BUS="scsi", KERNEL="sd*", PROGRAM="/lib/udev/scsi-devfs.sh sd %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
# BUS="scsi", KERNEL="sr*", PROGRAM="/lib/udev/scsi-devfs.sh sr %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
# BUS="scsi", KERNEL="st*", PROGRAM="/lib/udev/scsi-devfs.sh st %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
# BUS="scsi", KERNEL="sg*", PROGRAM="/lib/udev/scsi-devfs.sh sg %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
# Find out where sysfs is mounted. Exit if not available
sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'`
if [ "$sysfs" = "" ]; then
echo "sysfs is required"
exit 1
fi
cd $sysfs/bus/scsi/devices
case "$1" in
sd)
# Extract partition component
if [ "$3" = "" ]; then
lpart="disc"
spart=""
else
lpart="part$3"
spart="p$3"
fi
;;
sr)
lpart="cdrom"
spart=""
;;
st)
# Not supported yet
exit 1
;;
sg)
lpart="generic"
spart=""
;;
*)
exit 1
;;
esac
# Extract SCSI logical address components
scsi_host=`echo $2 | cut -f 1 -d:`
scsi_bus=`echo $2 | cut -f 2 -d:`
scsi_target=`echo $2 | cut -f 3 -d:`
scsi_lun=`echo $2 | cut -f 4 -d:`
# Generate long and short common name parts
l_com="bus$scsi_bus/target$scsi_target/lun$scsi_lun/$lpart"
s_com="b${scsi_bus}t${scsi_target}u${scsi_lun}$spart"
# Generate long and short logical names
l_log="scsi/host$scsi_host/$l_com"
s_log="$1/c${scsi_host}${s_com}"
readlink $2 | grep -F -q pci
if [ "$?" != "0" ]; then
# Not a PCI controller, show logical locations only
echo $l_log $s_log
exit 0
fi
# Extract PCI address
tmp=`readlink $2 | sed -e 's@/host.*/.*@@'`
pci_addr=`basename "$tmp"`
pci_domain=`echo $pci_addr | cut -f 1 -d:`
pci_bus=`echo $pci_addr | cut -f 2 -d:`
pci_slot=`echo $pci_addr | tr . : | cut -f 3 -d:`
pci_function=`echo $pci_addr | cut -f 2 -d.`
# Generate long and short physical names
l_pci="domain$pci_domain/bus$pci_bus/slot$pci_slot/function$pci_function"
l_phy="bus/pci/$l_pci/scsi/$l_com"
s_phy="$1/pci/$pci_addr/$s_com"
if [ -d /dev/discs ] ; then
for x in /dev/discs/disc* ; do
if readlink $x/disc | grep -q "$l_pci" ; then
x=`echo $x | cut -f3 -dc` # gives the number in disc0
break
fi
unset x
done
fi
if [ -z "${x}" -a -d /dev/discs ] ; then
x="`ls /dev/discs/ | grep -c .`"
fi
echo $l_log $s_log discs/disc${x}/${lpart}

+ 0
- 39
package/base/udev/scsi_dev_discs.patch

@ -1,39 +0,0 @@
# --- 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/scsi_dev_discs.patch
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or 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.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
--- ./extras/scsi-devfs.sh.orig 2006-01-04 17:02:54.370422160 +0100
+++ ./extras/scsi-devfs.sh 2006-01-04 17:04:39.350462768 +0100
@@ -83,6 +83,16 @@
l_phy="bus/pci/$l_pci/scsi/$l_com"
s_phy="$1/pci/$pci_addr/$s_com"
-echo $l_phy $s_phy $l_log $s_log
+for x in /dev/discs/disc* ; do
+ if readlink $x/disc | grep -q "$l_pci" ; then
+ x=`echo $x | cut -f3 -dc` # gives the number in disc0
+ break
+ fi
+ unset x
+done
+if [ -z "${x}" ] ; then
+ x="`ls /dev/discs/ | grep -c .`"
+fi
+echo $l_log $s_log discs/disc${x}/${lpart}

+ 0
- 21
package/base/udev/scsi_dev_discs_rules.patch

@ -1,21 +0,0 @@
--- ./etc/udev/debian/devfs.rules.orig 2006-01-13 00:23:21.195562168 +0100
+++ ./etc/udev/debian/devfs.rules 2006-01-13 00:24:18.676823688 +0100
@@ -18,12 +18,14 @@
ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions"
# IDE devices
-BUS=="ide", KERNEL=="hd[a-z]*", PROGRAM="/lib/udev/ide-devfs.sh %k %b %n", \
- NAME="%c{1}", SYMLINK+="%k %c{2}"
+BUS=="ide", KERNEL=="hd[a-z]*", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", \
+ NAME="%c{1}", SYMLINK+="%k %c{2}", GROUP="%c{3}"
# SCSI devices
-BUS=="scsi", PROGRAM="/lib/udev/scsi-devfs.sh %k %b %n", \
- NAME="%c{1}", SYMLINK+="%k %c{2}"
+BUS=="scsi", KERNEL=="sd*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sd %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
+BUS=="scsi", KERNEL=="sr*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sr %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
+BUS=="scsi", KERNEL=="st*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh st %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
+BUS=="scsi", KERNEL=="sg*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sg %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3}"
# RAID controllers
KERNEL=="cciss!*|ida!*|rd!*", PROGRAM="/lib/udev/raid-devfs.sh %k", \

+ 24
- 9
package/base/udev/udev.conf

@ -21,18 +21,33 @@
# --- ROCK-COPYRIGHT-NOTE-END ---
udev_pm() {
rm -f $root/lib/udev
mkdir -p $root/etc/udev/scripts
cp -v etc/udev/debian/devfs.rules $root/etc/udev/rules.d/50-udev.rules
cp -v extras/{ide-devfs.sh,scsi-devfs.sh} $root/etc/udev/scripts/
chmod +x $root/etc/udev/scripts/{ide-devfs.sh,scsi-devfs.sh}
mkdir -p $root/lib/udev/devices
ln -sv /proc/self/fd $root/lib/udev/devices/fd
ln -sv /proc/kcore $root/lib/udev/devices/core
ln -sv /proc/self/fd/0 $root/lib/udev/devices/stdin
ln -sv /proc/self/fd/1 $root/lib/udev/devices/stdout
ln -sv /proc/self/fd/2 $root/lib/udev/devices/stderr
mkdir -p $root/lib/udev/devices/{pts,shm}
# mkinitrd quickhack - wouldn't be included in the initrd otherwise
touch $root/lib/udev/devices/{pts,shm}/.empty
cp -v $confdir/devfs.rules $root/etc/udev/rules.d/50-udev.rules
cp -v $confdir/scripts/*.sh $root/lib/udev/
chmod +x $root/lib/udev/*.sh
cp -v $confdir/permissions.rules $root/etc/udev/rules.d/
cp -v $confdir/inputdev.sh $root/etc/udev/scripts
chmod +x $root/etc/udev/scripts/inputdev.sh
ln -svf ../etc/udev/scripts $root/lib/udev
install -v extras/path_id $root/sbin/
}
udev_prem() {
for i in $(find extras/ -name Makefile -maxdepth 2); do
udev_extras="${udev_extras} $(dirname ${i})"
done
var_append makeopt " " 'EXTRAS="${udev_extras}"'
var_append makeinstopt " " 'EXTRAS="${udev_extras}"'
}
prefix="$root"
makeopt="udevdir=$root/dev"
makeinstopt="udevdir=$root/dev install"
hook_add postmake 1 udev_pm
hook_add premake 3 udev_prem

+ 0
- 57
package/base/udev/useless_use_of_cat.patch

@ -1,57 +0,0 @@
diff -pruN udev-077/extras/ide-devfs.sh udev-077-patched/extras/ide-devfs.sh
--- udev-077/extras/ide-devfs.sh 2005-12-04 03:01:48.000000000 +0100
+++ udev-077-patched/extras/ide-devfs.sh 2006-01-16 08:54:51.000000000 +0100
@@ -20,7 +20,7 @@ get_dev_number() {
for x in /proc/ide/*/media; do
if [ -e "${x}" ]; then
- lMEDIA=`cat ${x}`
+ read lMEDIA < ${x}
if [ "${lMEDIA}" = "$2" ]; then
num=$((${num} + 1))
fi
@@ -34,7 +34,7 @@ get_dev_number() {
}
if [ -z "$3" ] && [ -f /proc/ide/${1}/media ]; then
- MEDIA=`cat /proc/ide/${1}/media`
+ read MEDIA < /proc/ide/${1}/media
if [ "${MEDIA}" = "cdrom" ]; then
echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` ${MEDIA}
elif [ "${MEDIA}" = "floppy" ]; then
diff -pruN udev-077/extras/raid-devfs.sh udev-077-patched/extras/raid-devfs.sh
--- udev-077/extras/raid-devfs.sh 2005-12-04 03:01:48.000000000 +0100
+++ udev-077-patched/extras/raid-devfs.sh 2006-01-16 09:01:47.000000000 +0100
@@ -9,17 +9,29 @@
# KERNEL=="rd!*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
get_dev_number_cciss() {
- grep '^cciss/' /proc/driver/cciss/* | cat -n | \
+ num=1
+ grep '^cciss/' /proc/driver/cciss/* | while read line ; do
+ echo "$num\t$line"
+ num=$(($num+1))
+ done | \
sed -n "/cciss\/$1:/s/cciss.*//p"
}
get_dev_number_ida() {
- grep '^ida/' /proc/driver/cpqarray/* | cat -n | \
+ num=1
+ grep '^ida/' /proc/driver/cpqarray/* | while read line ; do
+ echo "$num\t$line"
+ num=$(($num+1))
+ done | \
sed -n "/ida\/$1:/s/ida.*//p"
}
get_dev_number_rd() {
- grep '^ */dev/rd/' /proc/rd/*/initial_status | cat -n | \
+ num=1
+ grep '^ */dev/rd/' /proc/rd/*/initial_status | while read line ; do
+ echo "$num\t$line"
+ num=$(($num+1))
+ done | \
sed -n "/rd\/$1:/s/\/dev\/rd.*//p"
}

+ 2
- 1
target/bootdisk/build_stage1.sh

@ -31,7 +31,7 @@ sed -i -e "s,^STAGE_2_BIG_IMAGE=\"2nd_stage.tar.gz\"$,STAGE_2_BIG_IMAGE=\"${ROCK
linuxrc
echo_status "Copy various helper applications."
for file in ../2nd_stage/bin/{tar,gzip,bash2,bash,sh,mount,umount,ls,sed,cut} \
for file in ../2nd_stage/bin/{tar,gzip,bash2,bash,sh,mount,umount,ls,sed,cut,cp} \
../2nd_stage/bin/{cat,uname,rm,ln,mkdir,rmdir,gawk,awk,grep,sleep} \
../2nd_stage/sbin/{ip,hwscan,pivot_root,swapon,swapoff,udevd} \
../2nd_stage/usr/bin/{wget,find,expand,readlink,basename,tr} \
@ -40,6 +40,7 @@ for file in ../2nd_stage/bin/{tar,gzip,bash2,bash,sh,mount,umount,ls,sed,cut} \
cp ${file} bin/
done
cp -a $build_root/etc/udev etc/
cp -a $build_root/lib/udev lib/
for x in modprobe.static modprobe.static.old insmod.static insmod.static.old ; do
if [ -f ../2nd_stage/sbin/${x/.static/} ]; then

+ 1
- 4
target/bootdisk/linuxrc.sh

@ -406,10 +406,7 @@ mount -t sysfs none /sys || echo "Can't mount sysfs on /sys"
mount -t proc none /proc || echo "Can't mount /proc"
mount -t tmpfs -o ${TMPFS_OPTIONS} none /tmp || echo "Can't mount /tmpfs"
cd /dev
rm -rf fd
ln -s /proc/self/fd
cd -
cp -r /lib/udev/devices/* /dev
echo "" > /proc/sys/kernel/hotplug
/sbin/udevd --daemon

+ 0
- 12
target/bootdisk/linuxrc2.sh

@ -15,18 +15,6 @@ freeramdisk /dev/rd/* 2> /dev/null
mkdir -p /lib/modules/$( uname -r )
echo -n >> /lib/modules/$( uname -r )/modules.dep
echo "" > /proc/sys/kernel/hotplug
/sbin/udevstart
/sbin/udevd --daemon
cd /dev
rm -vf fd
ln -sf /proc/kcore core
ln -sf /proc/self/fd fd
ln -sf fd/0 stdin
ln -sf fd/1 stdout
ln -sf fd/2 stderr
cd /
setterm -blank 0 -powersave off -powerdown 0
echo

Loading…
Cancel
Save