Ticket #318: 318-proposal-1.patch

File 318-proposal-1.patch, 8.0 KB (added by DJ Lucas, 21 years ago)

Proposed patch for netfs script creation

  • appendices/symlinks/rc0.xml

    diff -Naur BOOK-ORIG/appendices/symlinks/rc0.xml BOOK-DJL/appendices/symlinks/rc0.xml
    old new  
    105105</row>
    106106
    107107<row>
     108<entry>K47</entry>
     109<entry>netfs</entry>
     110<entry><filename>../init.d/netfs</filename></entry>
     111<entry>Unmount network filesystems: <xref linkend="postlfs-config-netfs"/></entry>
     112</row>
     113
     114<row>
    108115<entry>K48</entry>
    109116<entry>samba</entry>
    110117<entry><filename>../init.d/samba</filename></entry>
  • appendices/symlinks/rc1.xml

    diff -Naur BOOK-ORIG/appendices/symlinks/rc1.xml BOOK-DJL/appendices/symlinks/rc1.xml
    old new  
    7777</row>
    7878
    7979<row>
     80<entry>K47</entry>
     81<entry>netfs</entry>
     82<entry><filename>../init.d/netfs</filename></entry>
     83<entry>Unmount network filesystems: <xref linkend="postlfs-config-netfs"/></entry>
     84</row>
     85
     86<row>
    8087<entry>K48</entry>
    8188<entry>samba</entry>
    8289<entry><filename>../init.d/samba</filename></entry>
  • appendices/symlinks/rc2.xml

    diff -Naur BOOK-ORIG/appendices/symlinks/rc2.xml BOOK-DJL/appendices/symlinks/rc2.xml
    old new  
    6363</row>
    6464
    6565<row>
     66<entry>K47</entry>
     67<entry>netfs</entry>
     68<entry><filename>../init.d/netfs</filename></entry>
     69<entry>Unmount network filesystems: <xref linkend="postlfs-config-netfs"/></entry>
     70</row>
     71
     72<row>
    6673<entry>K48</entry>
    6774<entry>samba</entry>
    6875<entry><filename>../init.d/samba</filename></entry>
  • appendices/symlinks/rc6.xml

    diff -Naur BOOK-ORIG/appendices/symlinks/rc6.xml BOOK-DJL/appendices/symlinks/rc6.xml
    old new  
    9898</row>
    9999
    100100<row>
     101<entry>K47</entry>
     102<entry>netfs</entry>
     103<entry><filename>../init.d/netfs</filename></entry>
     104<entry>Unmount network filesystems: <xref linkend="postlfs-config-netfs"/></entry>
     105</row>
     106
     107<row>
    101108<entry>K48</entry>
    102109<entry>samba</entry>
    103110<entry><filename>../init.d/samba</filename></entry>
  • introduction/welcome/credits.xml

    diff -Naur BOOK-ORIG/introduction/welcome/credits.xml BOOK-DJL/introduction/welcome/credits.xml
    old new  
    147147and STLport: <emphasis>
    148148Tushar Teredesai</emphasis></para></listitem>
    149149
    150 <listitem><para>RP-PPPoE: <emphasis> DJ Lucas
     150<listitem><para>RP-PPPoE and netfs: <emphasis> DJ Lucas
    151151</emphasis></para></listitem>
    152152
    153153</itemizedlist>
  • postlfs/config/config.xml

    diff -Naur BOOK-ORIG/postlfs/config/config.xml BOOK-DJL/postlfs/config/config.xml
    old new  
    2626&postlfs-config-manpages;
    2727&postlfs-config-infopages;
    2828&postlfs-config-skel;
     29&postlfs-config-netfs;
    2930
    3031</chapter>
    3132
  • postlfs/config/netfs.xml

    diff -Naur BOOK-ORIG/postlfs/config/netfs.xml BOOK-DJL/postlfs/config/netfs.xml
    old new  
     1<sect1 id="postlfs-config-netfs" xreflabel="netfs">
     2<?dbhtml filename="netfs.html" dir="postlfs"?>
     3<title>/etc/rc.d/init.d/netfs</title>
     4
     5<para>The base LFS system does not take into account all of the possible
     6ways of connecting to networks, and as a result, it dosen't handle
     7unmounting of network filesystems very well.  The base configuration of
     8LFS is not a problem for a simple static network.  However, as you
     9begin to expand your networking with BLFS, adding into the mix various
     10network clients, connection protocols, tunneling, etc., it can display
     11a few minor problems.  <filename> netfs</filename> is a simple script to
     12overcome one of those little problems that may creep up on you as you add
     13to the network on your BLFS system.</para>
     14<para>Use the following commands to create the <filename>netfs</filename>
     15script.</para>
     16
     17<screen><userinput>cat &gt; /etc/rc.d/init.d/netfs &lt;&lt; "EOF"
     18#!/bin/sh
     19# Begin $rc_base/init.d/netfs
     20
     21# Based on sysklogd script from LFS-3.1 and earlier.
     22# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
     23# Netfs script written by DJ Lucas  - dj@lucasit.com
     24
     25source /etc/sysconfig/rc
     26source $rc_functions
     27
     28case "$1" in
     29
     30        start)
     31                echo "Mounting network volumes..."
     32                mount -at nfs,sbmfs,coda,ncpfs
     33                evaluate_retval               
     34                ;;
     35               
     36        stop)
     37                NFSMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /nfs/ { print $2 }' \
     38                        /etc/mtab)
     39                SMBMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /smbfs/ { print $2 }' \
     40                        /etc/mtab)
     41                CODAMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /coda/ { print $2 }' \
     42                        /etc/mtab)
     43                NCPMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /ncpfs/ { print $2 }' \
     44                        /etc/mtab)
     45
     46                echo -n "Unmounting network volumes..."
     47
     48                if [ -z "$NFSMOUNTS$SMBMOUNTS$CODAMOUNTS$NCPMOUNTS" ]
     49                    then
     50                        echo "No network volumes mounted!"
     51                        evaluate_retval
     52                    else
     53                        echo " "
     54                fi
     55
     56                if [ "$NFSMOUNTS" != "" ]
     57                then
     58                        echo "Unmounting NFS volumes..."
     59                        fuser -km $NFSMOUNTS &gt;&gt; /dev/null
     60                        umount $NFSMOUNTS &gt;&gt; /dev/null
     61                        evaluate_retval
     62                fi
     63
     64                if [ "$SMBMOUNTS" != "" ]
     65                then
     66                        echo "Unmounting Samba shares..."
     67                        fusrer -km $SMBMOUNTS &gt;&gt; /dev/null
     68                        umount $SMBMOUNTS &gt;&gt; /dev/null
     69                        evaluate_retval
     70                fi
     71
     72                if [ "$CODAMOUNTS" != "" ]
     73                then
     74                        echo "Unmounting Coda volumes..."
     75                        fuser -km $CODAMOUNTS &gt;&gt; /dev/null
     76                        umount $CODAMOUNTS &gt;&gt; /dev/null
     77                        evaluate_retval
     78                fi
     79
     80                if [ "$NCPMOUNTS" != "" ]
     81                then
     82                        echo "Unmounting Netware volumes..."
     83                        fuser -km $NCPMOUNTS &gt;&gt; /dev/null
     84                        umount $NCPMOUNTS &gt;&gt; /dev/null
     85                        evaluate_retval
     86                fi
     87                ;;
     88
     89        *)
     90                echo "Usage: $0 {start|stop}"
     91                exit 1
     92                ;;
     93esac
     94
     95# End $rc_base/init.d/netfs
     96EOF
     97chmod 755 /etc/rc.d/init.d/netfs</userinput></screen>
     98
     99<para>Create the symlinks using the following commands:</para>
     100<screen><userinput>ln -sf ../init.d/netfs /etc/rc.d/rc0.d/K47netfs &amp;&amp;
     101ln -sf ../init.d/netfs /etc/rc.d/rc1.d/K47netfs &amp;&amp;
     102ln -sf ../init.d/netfs /etc/rc.d/rc2.d/K47netfs &amp;&amp;
     103ln -sf ../init.d/netfs /etc/rc.d/rc6.d/K47netfs </userinput></screen>
     104
     105<para>Notice that there are no start symlinks.  The start case is
     106added only as a convience for later on in your installation.</para>
     107
     108</sect1>
     109
  • postlfs/postlfs.ent

    diff -Naur BOOK-ORIG/postlfs/postlfs.ent BOOK-DJL/postlfs/postlfs.ent
    old new  
    1111<!ENTITY postlfs-config-manpages SYSTEM "config/manpages.xml">
    1212<!ENTITY postlfs-config-infopages SYSTEM "config/infopages.xml">
    1313<!ENTITY postlfs-config-skel SYSTEM "config/skel.xml">
     14<!ENTITY postlfs-config-netfs SYSTEM "config/netfs.xml">
    1415
    1516<!-- Post-LFS Security -->
    1617<!ENTITY postlfs-security SYSTEM "security/security.xml">