clfs-1.2
        clfs-2.1
        clfs-3.0.0-systemd
        clfs-3.0.0-sysvinit
        systemd
        sysvinit
      
      
        
          | Last change
 on this file since b370497 was             7e161ea, checked in by Jim Gifford <clfs@…>, 20 years ago | 
        
          | 
r833@server (orig r831):  jim | 2005-12-05 10:42:24 -0800Added: udev package for Cross-LFS. Work in Progress
 
 | 
        
          | 
              
Property                 mode
 set to                 100755 | 
        
          | File size:
            1.3 KB | 
      
      
| Rev | Line |  | 
|---|
| [7e161ea] | 1 | #! /bin/bash | 
|---|
|  | 2 |  | 
|---|
|  | 3 | . /etc/sysconfig/hardware/scripts/functions | 
|---|
|  | 4 | . /etc/sysconfig/storage | 
|---|
|  | 5 |  | 
|---|
|  | 6 | test "$HOTPLUG_MOUNT_FSTAB" != yes && exit | 
|---|
|  | 7 |  | 
|---|
|  | 8 | # Handle only partitions of sd | 
|---|
|  | 9 | case "$DEVNAME" in | 
|---|
|  | 10 | /dev/sd*|/dev/hd*) : ;; | 
|---|
|  | 11 | *) exit 0 ;; | 
|---|
|  | 12 | esac | 
|---|
|  | 13 | case "$DEVNAME" in | 
|---|
|  | 14 | *sd[a-z]|*hd[a-z]) exit 0 ;; | 
|---|
|  | 15 | esac | 
|---|
|  | 16 |  | 
|---|
|  | 17 |  | 
|---|
|  | 18 | NODES=$DEVNAME | 
|---|
|  | 19 | for sl in `udevinfo -q symlink -p $DEVPATH`; do | 
|---|
|  | 20 | NODES="$NODES /dev/$sl" | 
|---|
|  | 21 | done | 
|---|
|  | 22 | info_mesg "Avilable nodes: $NODES" | 
|---|
|  | 23 |  | 
|---|
|  | 24 | NODE= | 
|---|
|  | 25 | declare -i FSCK=0 | 
|---|
|  | 26 | while read dn mp fs opts dump fsck x; do | 
|---|
|  | 27 | for n in $NODES; do | 
|---|
|  | 28 | if [ "$n" == "$dn" ] ; then | 
|---|
|  | 29 | case $opts in | 
|---|
|  | 30 | *hotplug*) : ;; | 
|---|
|  | 31 | *) exit 0 ;; | 
|---|
|  | 32 | esac | 
|---|
|  | 33 | NODE="$n" | 
|---|
|  | 34 | FSCK="$fsck" | 
|---|
|  | 35 | info_mesg "matching line for $DEVNAME:" | 
|---|
|  | 36 | info_mesg "$dn $mp $fs $opts $dump $fsck $x" | 
|---|
|  | 37 | break 2 | 
|---|
|  | 38 | fi | 
|---|
|  | 39 | done | 
|---|
|  | 40 | done < /etc/fstab | 
|---|
|  | 41 |  | 
|---|
|  | 42 | if [ "$HOTPLUG_CHECK_FILESYSTEMS" == yes -a "$FSCK" -gt 0 ] ; then | 
|---|
|  | 43 | MESSAGE="`fsck -a $DEVNAME`" | 
|---|
|  | 44 | RET=$? | 
|---|
|  | 45 | info_mesg "$MESSAGE" | 
|---|
|  | 46 | case $RET in | 
|---|
|  | 47 | 0|1) : ;; | 
|---|
|  | 48 | 2|3) | 
|---|
|  | 49 | info_mesg "Please unplug device $DEVNAME, and plug it again" | 
|---|
|  | 50 | logger -t $0 "fsck for '$DEVNAME' failed. Will not mount it." | 
|---|
|  | 51 | exit 0 | 
|---|
|  | 52 | ;; | 
|---|
|  | 53 | *) | 
|---|
|  | 54 | err_mesg "fsck failed on $DEVNAME. Please fsck filesystem manually." | 
|---|
|  | 55 | logger -t $0 "fsck for '$DEVNAME' failed. Will not mount it." | 
|---|
|  | 56 | exit 1 | 
|---|
|  | 57 | ;; | 
|---|
|  | 58 | esac | 
|---|
|  | 59 | fi | 
|---|
|  | 60 |  | 
|---|
|  | 61 |  | 
|---|
|  | 62 | if [ -n "$NODE" ] ; then | 
|---|
|  | 63 | MESSAGE="`mount -av "$NODE"`" | 
|---|
|  | 64 | test $? != 0 && logger -t $0 "Could not mount '$DEVNAME'." | 
|---|
|  | 65 | info_mesg "$MESSAGE" | 
|---|
|  | 66 | fi | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.