source: udev/load_ide_modules.sh@ a4feff9

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since a4feff9 was 7e161ea, checked in by Jim Gifford <clfs@…>, 19 years ago

r833@server (orig r831): jim | 2005-12-05 10:42:24 -0800
Added: udev package for Cross-LFS. Work in Progress

  • Property mode set to 100644
File size: 871 bytes
Line 
1#!/bin/sh
2########################################################################
3#
4# Description : load_ide_modules
5#
6# Authors : Based on Open Suse Udev Rules
7# kay.sievers@suse.de
8#
9# Adapted to : Jim Gifford
10# LFS
11#
12# Version : 00.00
13#
14# Notes :
15#
16########################################################################
17
18device=${DEVPATH#/devices/*/ide?/}
19drive=${device#?.}
20bus=${device%.?}
21name=$(printf "hd%x" $(($drive + $bus * 2 + 10)))
22procfile="/proc/ide/$name/media"
23
24loop=50
25while ! test -e $procfile; do
26 sleep 0.1;
27 test "$loop" -gt 0 || exit 1
28 loop=$(($loop - 1))
29done
30
31read media < $procfile
32case "$media" in
33 cdrom)
34 /sbin/modprobe ide-cd
35 ;;
36 disk)
37 /sbin/modprobe ide-disk
38 ;;
39 floppy)
40 /sbin/modprobe ide-floppy
41 ;;
42 tape)
43 /sbin/modprobe ide-tape
44 ;;
45 *)
46 /sbin/modprobe ide-generic
47 ;;
48esac
Note: See TracBrowser for help on using the repository browser.