/[baselayout]/trunk/init.d/checkroot
Gentoo

Diff of /trunk/init.d/checkroot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2774 Revision 2775
5description="Check the root filesystem according to /etc/fstab for errors \ 5description="Check the root filesystem according to /etc/fstab for errors \
6and optionally repair them." 6and optionally repair them."
7 7
8do_mtab() { 8do_mtab() {
9 # Don't create mtab if /etc is readonly 9 # Don't create mtab if /etc is readonly
10 if ! touch /etc/mtab 2> /dev/null ; then 10 if ! echo 2>/dev/null >/etc/mtab ; then
11 ewarn "Skipping /etc/mtab initialization" "(ro root?)" 11 ewarn "Skipping /etc/mtab initialization" "(ro root?)"
12 return 0 12 return 0
13 fi 13 fi
14
15 # Clear the existing mtab
16 > /etc/mtab
17 14
18 # Add the entry for / to mtab 15 # Add the entry for / to mtab
19 mount -f / 16 mount -f /
20 17
21 # Don't list root more than once 18 # Don't list root more than once
41 # Don't bother doing a fsck on these 38 # Don't bother doing a fsck on these
42 if [ -n "${CDBOOT}" ] || is_net_fs / || is_union_fs / ; then 39 if [ -n "${CDBOOT}" ] || is_net_fs / || is_union_fs / ; then
43 return 0 40 return 0
44 fi 41 fi
45 42
46 if touch /.test.$$ 2> /dev/null ; then 43 if echo 2>/dev/null >/.test.$$ ; then
47 einfo "root filesystem is mounted read-write - skipping" 44 einfo "root filesystem is mounted read-write - skipping"
48 rm -f /.test.$$ 45 rm -f /.test.$$
49 return 0 46 return 0
50 fi 47 fi
51 48

Legend:
Removed from v.2774  
changed lines
  Added in v.2775

  ViewVC Help
Powered by ViewVC 1.1.20