Ticket #318: 318-proposal-2.patch

File 318-proposal-2.patch, 7.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
     37       top)
     38                NFSMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /nfs/ { print $2 }' \
     39                        /etc/mtab)
     40                SMBMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /smbfs/ { print $2 }' \
     41                        /etc/mtab)
     42                CODAMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /coda/ { print $2 }' \
     43                        /etc/mtab)
     44                NCPMOUNTS=$(awk 'BEGIN { ORS=" "} $3 ~ /ncpfs/ { print $2 }' \
     45                        /etc/mtab)
     46
     47                echo -n "Unmounting network volumes..."
     48
     49                if [ -z "$NFSMOUNTS$SMBMOUNTS$CODAMOUNTS$NCPMOUNTS" ]
     50                    then
     51                        echo "No network volumes mounted!"
     52                        evaluate_retval
     53                    else
     54
     55                        echo " "
     56                        fuser -km $NFSMOUNTS $SMBMOUNTS \
     57                                $CODAMOUNTS $NCPMOUNTS  &gt;&gt; /dev/null
     58                        umount $NFSMOUNTS $SMBMOUNTS \
     59                                $CODAMOUNTS $NCPMOUNTS &gt;&gt; /dev/null
     60                        evaluate_retval
     61                fi
     62                ;;
     63
     64*)
     65                echo "Usage: $0 {start|stop}"
     66                exit 1
     67                ;;
     68esac
     69
     70# End $rc_base/init.d/netfs
     71EOF
     72chmod 755 /etc/rc.d/init.d/netfs</userinput></screen>
     73
     74<para>Create the symlinks using the following commands:</para>
     75<screen><userinput>ln -sf ../init.d/netfs /etc/rc.d/rc0.d/K47netfs &amp;&amp;
     76ln -sf ../init.d/netfs /etc/rc.d/rc1.d/K47netfs &amp;&amp;
     77ln -sf ../init.d/netfs /etc/rc.d/rc2.d/K47netfs &amp;&amp;
     78ln -sf ../init.d/netfs /etc/rc.d/rc6.d/K47netfs </userinput></screen>
     79
     80<para>Notice that there are no start symlinks.  The start case is
     81added only as a convience for later on in your installation.</para>
     82
     83</sect1>
     84
  • 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">