clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change
on this file since 1f7827a2 was
1f7827a2,
checked in by Jim Gifford <clfs@…>, 18 years ago
|
r1012@server (orig r1010): jim | 2006-01-06 10:33:15 -0800
r1291@server: jim | 2006-01-06 10:31:33 -0800
Updates based on Alex's findings. Thank You Alex
|
-
Property mode set to
100755
|
File size:
1.7 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | ######################################################################## |
---|
3 | # |
---|
4 | # Description : Mount devices |
---|
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 | |
---|
18 | . /etc/sysconfig/rc |
---|
19 | . ${rc_functions} |
---|
20 | . /etc/sysconfig/storage |
---|
21 | |
---|
22 | test "$HOTPLUG_MOUNT_FSTAB" != yes && exit |
---|
23 | |
---|
24 | # Handle only partitions of sd |
---|
25 | case "$DEVNAME" in |
---|
26 | /dev/sd*|/dev/hd*) : ;; |
---|
27 | *) exit 0 ;; |
---|
28 | esac |
---|
29 | case "$DEVNAME" in |
---|
30 | *sd[a-z]|*hd[a-z]) exit 0 ;; |
---|
31 | esac |
---|
32 | |
---|
33 | NODES=$DEVNAME |
---|
34 | for sl in `udevinfo -q symlink -p $DEVPATH`; do |
---|
35 | NODES="$NODES /dev/$sl" |
---|
36 | done |
---|
37 | boot_mesg "Available nodes: $NODES" |
---|
38 | |
---|
39 | NODE= |
---|
40 | declare -i FSCK=0 |
---|
41 | while read dn mp fs opts dump fsck x; do |
---|
42 | for n in $NODES; do |
---|
43 | if [ "$n" == "$dn" ] ; then |
---|
44 | case $opts in |
---|
45 | *hotplug*) : ;; |
---|
46 | *) exit 0 ;; |
---|
47 | esac |
---|
48 | NODE="$n" |
---|
49 | FSCK="$fsck" |
---|
50 | boot_mesg "matching line for $DEVNAME:" |
---|
51 | boot_mesg "$dn $mp $fs $opts $dump $fsck $x" |
---|
52 | break 2 |
---|
53 | fi |
---|
54 | done |
---|
55 | done < /etc/fstab |
---|
56 | |
---|
57 | if [ "$HOTPLUG_CHECK_FILESYSTEMS" == yes -a "$FSCK" -gt 0 ] ; then |
---|
58 | MESSAGE="`fsck -a $DEVNAME`" |
---|
59 | RET=$? |
---|
60 | boot_mesg "$MESSAGE" |
---|
61 | case $RET in |
---|
62 | 0|1) : ;; |
---|
63 | 2|3) |
---|
64 | boot_mesg "Please unplug device $DEVNAME, and plug it again" |
---|
65 | logger -t $0 "fsck for '$DEVNAME' failed. Will not mount it." |
---|
66 | exit 0 |
---|
67 | ;; |
---|
68 | *) |
---|
69 | err_mesg "fsck failed on $DEVNAME. Please fsck filesystem manually." |
---|
70 | logger -t $0 "fsck for '$DEVNAME' failed. Will not mount it." |
---|
71 | exit 1 |
---|
72 | ;; |
---|
73 | esac |
---|
74 | fi |
---|
75 | |
---|
76 | |
---|
77 | if [ -n "$NODE" ] ; then |
---|
78 | MESSAGE="`mount -av "$NODE"`" |
---|
79 | test $? != 0 && logger -t $0 "Could not mount '$DEVNAME'." |
---|
80 | boot_mesg "$MESSAGE" |
---|
81 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.