Author: bdubbs
Date: 2012-01-27 13:31:11 -0700 (Fri, 27 Jan 2012)
New Revision: 9244

Added:
   trunk/bootscripts/blfs/services/bridge
Modified:
   trunk/BOOK/general.ent
   trunk/BOOK/introduction/welcome/changelog.xml
   trunk/BOOK/networking/netprogs/bridgeutils.xml
   trunk/BOOK/postlfs/config/users.xml
   trunk/bootscripts/Makefile
   trunk/bootscripts/blfs/init.d/lisa
Log:
Add configuration to bridge-utils and add bridge service script.



Modified: trunk/BOOK/general.ent
===================================================================
--- trunk/BOOK/general.ent      2012-01-27 19:58:55 UTC (rev 9243)
+++ trunk/BOOK/general.ent      2012-01-27 20:31:11 UTC (rev 9244)
@@ -58,7 +58,7 @@
 <!ENTITY lfs-vim-version              "7.3">
 <!-- End LFS versions -->
 
-<!ENTITY blfs-bootscripts-version     "20111226">
+<!ENTITY blfs-bootscripts-version     "20120127">
 <!ENTITY blfs-bootscripts-download    
"&downloads-root;/blfs-bootscripts-&blfs-bootscripts-version;.tar.bz2">
 
 <!ENTITY blfs-wiki                    "http://wiki.&lfs-domainname;/blfs/wiki";>

Modified: trunk/BOOK/introduction/welcome/changelog.xml
===================================================================
--- trunk/BOOK/introduction/welcome/changelog.xml       2012-01-27 19:58:55 UTC 
(rev 9243)
+++ trunk/BOOK/introduction/welcome/changelog.xml       2012-01-27 20:31:11 UTC 
(rev 9244)
@@ -45,6 +45,11 @@
       <para>January 28th, 2012</para>
       <itemizedlist>
         <listitem>
+          <para>[bdubbs] - Add configuration to bridge-utils and add bridge
+          service script.
+          </para>
+        </listitem>
+        <listitem>
           <para>[ken] - Add gdb-7.3.1 and SpiderMonkey (js185-1.0.0) from 
Wayne.
           </para>
         </listitem>

Modified: trunk/BOOK/networking/netprogs/bridgeutils.xml
===================================================================
--- trunk/BOOK/networking/netprogs/bridgeutils.xml      2012-01-27 19:58:55 UTC 
(rev 9243)
+++ trunk/BOOK/networking/netprogs/bridgeutils.xml      2012-01-27 20:31:11 UTC 
(rev 9244)
@@ -69,10 +69,26 @@
 
   </sect2>
 
+  <sect2 role="kernel" id='bridgeutils-kernel'>
+    <title>Kernel Configuration</title>
+
+    <para>Enable the following options in the kernel configuration
+    and recompile the kernel if necessary:</para>
+
+<screen><literal>Networking support: Y
+  Networking options: 
+    802.1d Ethernet Bridging: M or Y</literal></screen>
+
+    <indexterm zone="bridgeutils bridgeutils-kernel">
+      <primary sortas="d-bridgeutils">Bridge Utilities</primary>
+    </indexterm>
+
+  </sect2>
+
   <sect2 role="installation">
-    <title>Installation of Wget</title>
+    <title>Installation of bridge-utils</title>
 
-    <para>Install <application>Wget</application> by running the following
+    <para>Install <application>bridge-utils</application> by running the 
following
     commands:</para>
 
 <screen><userinput>autoreconf                &amp;&amp;
@@ -91,6 +107,69 @@
 
   </sect2>
 
+  <sect2 role="configuration">
+    <title>Configuring bridge-utils</title>
+
+    <sect3 id='bridgeutils-init'>
+      <title>Configuration Information</title>
+
+      <para>To automate bridge creation and configuration, 
+      install the <filename>/lib/services/etc/bridge</filename>
+      service script included in the <xref linkend="bootscripts"/>
+      package.</para>
+
+      <indexterm zone="bridgeutils bridgeutils-init">
+        <primary sortas="f-bridgeutils">bridge-utils</primary>
+      </indexterm>
+
+<screen role="root"><userinput>make install-bridge</userinput></screen>
+
+      <note><para>The <filename>bridge</filename> script depends
+      on the comamnds <command>/sbin/ifup</command> and 
+      <command>/sbin/ifdown</command> and the service script
+      <emphasis>ipv4-static</emphasis> from the <emphasis>LFS</emphasis>
+      bootscripts dated January 27, 2012 or later.</para></note>
+
+      <para>The following configuration file will create a bridge device
+      at boot time and attach the eth0 device to it.  If more than one
+      device is desired, use a space separated list of INTERFACES.  This
+      configuration is useful when planning to run a virtual machine
+      such as kvm/qemu.</para>
+
+      <para>Other SERVICE combinations are possible, for example, 
+      SERVICES="bridge dhcp".  In that case, the address parameters
+      are not needed, but do not interfere if present. The 
+      bridge service may also be used alone, but will require
+      additional subsequent configuration.</para>
+
+      <caution><para>Do not run a parallel configuration for a device
+      in the INTERFACES list.  For instance, in the example below,
+      do not configure <filename>/etc/sysconfig/ifconfig.eth0</filename>
+      to run at boot time.  The command <command>ifdown br0</command>
+      followed by  command <command>ifup eth0</command> will work, but
+      don't try to have both up at the same time.</para></caution>
+      
+<screen role="root"><userinput>cat &gt; /etc/sysconfig/ifconfig.br0 &lt;&lt; 
"EOF"
+<literal>ONBOOT=yes
+IFACE=br0
+SERVICE="bridge ipv4-static"  # Space separated
+IP=192.168.1.32
+GATEWAY=192.168.1.1
+PREFIX=24
+BROADCAST=192.168.1.255
+CHECK_LINK=no                 # Don't check before ibridge is created
+STP=no                        # Spanning tree protocol, default no
+INTERFACES="eth0"             # Add to IFACE, space separated devices 
+IP_FORWARD=true</literal>
+EOF</userinput></screen>
+
+      <para>All addresses should be changed to meet your circumstance.</para>
+
+    </sect3>
+
+  </sect2>
+
+
   <sect2 role="content">
     <title>Contents</title>
 

Modified: trunk/BOOK/postlfs/config/users.xml
===================================================================
--- trunk/BOOK/postlfs/config/users.xml 2012-01-27 19:58:55 UTC (rev 9243)
+++ trunk/BOOK/postlfs/config/users.xml 2012-01-27 20:31:11 UTC (rev 9244)
@@ -97,6 +97,7 @@
         <row><entry>svn     </entry><entry>56</entry><entry>56</entry></row>
         <row><entry>svntest </entry><entry>  </entry><entry>57</entry></row>
         <row><entry>games   </entry><entry>60</entry><entry>60</entry></row>
+        <row><entry>kvm     </entry><entry>  </entry><entry>61</entry></row>
         <row><entry>scanner </entry><entry>  </entry><entry>70</entry></row>
         <row><entry>avahi   </entry><entry>84</entry><entry>84</entry></row>
         
<row><entry>avahi-autoipd</entry><entry>85</entry><entry>85</entry></row>

Modified: trunk/bootscripts/Makefile
===================================================================
--- trunk/bootscripts/Makefile  2012-01-27 19:58:55 UTC (rev 9243)
+++ trunk/bootscripts/Makefile  2012-01-27 20:31:11 UTC (rev 9244)
@@ -11,7 +11,7 @@
        @echo "Select an appropriate install target from the above list" ; exit 
1
 
 create-dirs:
-       install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc{0,1,2,3,4,5,6,sysinit}.d
+       install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc{0,1,2,3,4,5,6,S}.d
        install -d -m ${DIRMODE} ${EXTDIR}/rc.d/init.d
        install -d -m ${DIRMODE} ${EXTDIR}/sysconfig
 
@@ -25,6 +25,9 @@
 install-service-dhcpcd: create-service-dir
        install -m ${MODE} blfs/services/dhcpcd  ${LIBDIR}
 
+install-service-bridge: create-service-dir
+       install -m ${MODE} blfs/services/bridge  ${LIBDIR}
+
 install-service-ipx: create-service-dir
        install -m ${MODE} blfs/sysconfig/network-devices/services/ipx      
${EXTDIR}/sysconfig/network-devices/services
 
@@ -52,7 +55,7 @@
 install-autofs: create-dirs
        install -m $(MODE) blfs/init.d/autofs    $(EXTDIR)/rc.d/init.d/
        install -m $(CONFMODE) blfs/sysconfig/autofs.conf $(EXTDIR)/sysconfig/
-       ln -sf  ../init.d/autofs $(EXTDIR)/rc.d/rcsysinit.d/S52autofs
+       ln -sf  ../init.d/autofs $(EXTDIR)/rc.d/rcS.d/S52autofs
 
 install-bind: create-dirs
        install -m ${MODE} blfs/init.d/bind       ${EXTDIR}/rc.d/init.d/
@@ -449,12 +452,8 @@
 
 install-sysstat: create-dirs
        install -m ${MODE} blfs/init.d/sysstat    ${EXTDIR}/rc.d/init.d/
-       ln -sf ../init.d/sysstat ${EXTDIR}/rc.d/rcsysinit.d/S85sysstat
+       ln -sf ../init.d/sysstat ${EXTDIR}/rc.d/rcS.d/S85sysstat
 
-install-usb: create-dirs
-       install -m ${MODE} blfs/init.d/usb        ${EXTDIR}/rc.d/init.d/
-       ln -sf ../init.d/usb ${EXTDIR}/rc.d/rcsysinit.d/S90usb
-
 install-virtuoso: create-dirs
        install -m ${MODE} blfs/init.d/virtuoso   ${EXTDIR}/rc.d/init.d/
        ln -sf ../init.d/virtuoso ${EXTDIR}/rc.d/rc0.d/K40virtuoso
@@ -513,7 +512,7 @@
 
 uninstall-autofs:
        rm -f $(EXTDIR)/rc.d/init.d/autofs
-       rm -f $(EXTDIR)/rc.d/rcsysinit.d/S52autofs
+       rm -f $(EXTDIR)/rc.d/rcS.d/S52autofs
 
 uninstall-bind:
        rm -f ${EXTDIR}/rc.d/init.d/bind
@@ -843,12 +842,8 @@
 
 uninstall-sysstat:
        rm -f ${EXTDIR}/rc.d/init.d/sysstat
-       rm -f ${EXTDIR}/rc.d/rcsysinit.d/S85sysstat
+       rm -f ${EXTDIR}/rc.d/rcS.d/S85sysstat
 
-uninstall-usb:
-       rm -f ${EXTDIR}/rc.d/init.d/usb
-       rm -f ${EXTDIR}/rc.d/rcsysinit.d/S90usb
-
 uninstall-virtuoso:
        rm -f ${EXTDIR}/rc.d/init.d/virtuoso
        rm -f ${EXTDIR}/rc.d/rc0.d/K40virtuoso
@@ -932,7 +927,6 @@
        install-sysstat \
        install-vsftpd \
        install-virtuoso \
-       install-usb \
        install-winbind \
        install-xinetd \
        uninstall-alsa \
@@ -973,6 +967,5 @@
        uninstall-sysstat \
        uninstall-virtuoso \
        uninstall-vsftpd \
-       uninstall-usb \
        uninstall-winbind \
        uninstall-xinetd

Modified: trunk/bootscripts/blfs/init.d/lisa
===================================================================
--- trunk/bootscripts/blfs/init.d/lisa  2012-01-27 19:58:55 UTC (rev 9243)
+++ trunk/bootscripts/blfs/init.d/lisa  2012-01-27 20:31:11 UTC (rev 9244)
@@ -1,47 +1,63 @@
 #!/bin/sh
-# Begin $rc_base/init.d/lisa
+########################################################################
+# Begin lisa
+#
+# Description : 
+#
+# Author      : Bruce Dubbs - [email protected]
+#
+# Version     : LFS 7.0
+#
+########################################################################
 
-# Based on sysklogd script from LFS-3.1 and earlier.
-# Rewritten by Gerard Beekmans  - [email protected]
+### BEGIN INIT INFO
+# Provides:            lisa
+# Required-Start:      network
+# Should-Start:
+# Required-Stop:       sendsignals
+# Should-Stop:
+# Default-Start:       3 4 5
+# Default-Stop:        0 1 2 6
+# Short-Description:   Starts lisa daemon.
+# Description:         Starts Trinity lisa daemon.
+# X-LFS-Provided-By:   LFS
+### END INIT INFO
 
+TRINITY_PREFIX=/opt/trinity
+. /lib/lsb/init-functions
+
 #$LastChangedBy$
 #$Date$
 
-. /etc/sysconfig/rc
-. $rc_functions
+export PATH=$PATH:$TRINITY_PREFIX/bin
 
-export PATH=$PATH:/opt/kde/bin
-
 case "$1" in
-        start)
-                boot_mesg "Starting LISA Daemon..."
-                loadproc /opt/kde/bin/lisa
-                ;;
+   start)
+      log_info_msg "Starting LISA Daemon..."
+      start_daemon $TRINITY_PREFIX/bin/lisa
+      evaluate_retval
+      ;;
 
-        stop)
-                boot_mesg "Stopping LISA Daemon..."
-                killproc /opt/kde/bin/lisa
-                ;;
+   stop)
+      log_info_msg "Stopping LISA Daemon..."
+      killproc $TRINITY_PREFIX/bin/lisa
+      evaluate_retval
+      ;;
 
-        reload)
-                boot_mesg "Reloading LISA Daemon..."
-                reloadproc /opt/kde/bin/lisa
-                ;;
+   restart)
+      $0 stop
+      sleep 1
+      $0 start
+      ;;
 
-        restart)
-                $0 stop
-                sleep 1
-                $0 start
-                ;;
+   status)
+      statusproc $TRINITY_PREFIX/bin/lisa
+      ;;
 
-        status)
-                statusproc /opt/kde/bin/lisa
-                ;;
-
-        *)
-                echo "Usage: $0 {start|stop|reload|restart|status}"
-                exit 1
-                ;;
+   *)
+      echo "Usage: $0 {start|stop|restart|status}"
+      exit 1
+      ;;
 esac
 
-# End $rc_base/init.d/lisa
+# End /etc/init.d/lisa

Added: trunk/bootscripts/blfs/services/bridge
===================================================================
--- trunk/bootscripts/blfs/services/bridge                              (rev 0)
+++ trunk/bootscripts/blfs/services/bridge      2012-01-27 20:31:11 UTC (rev 
9244)
@@ -0,0 +1,56 @@
+#!/bin/sh
+########################################################################
+# Begin /lib/services/bridge
+#
+# Description : Bridge Boot Script
+#
+# Authors     : Nathan Coulson - [email protected]
+#               Bruce Dubbs - [email protected]
+#
+# Version     : LFS-7.0
+#
+########################################################################
+
+. /lib/lsb/init-functions
+. ${IFCONFIG}
+
+if [ -n "${INTERFACE}" ]; then
+   log_failure_msg "INTERFACES variable missing from ${IFCONFIG}"
+   exit 1
+fi
+
+case "${2}" in
+   up)
+      log_info_msg "Creating the ${1} interface..."
+      brctl addbr ${1}
+      evaluate_retval
+      for I in ${INTERFACES}; do
+         log_info_msg "Adding ${I} to ${1}..."
+         ip link set ${I} up &&
+         brctl addif ${1} ${I}
+         evaluate_retval
+      done
+   ;;
+   
+   down)
+      for I in ${INTERFACES}; do
+         log_info_msg "Removing ${I} from ${1}..."
+         ip link set ${I} down &&
+         brctl delif ${1} ${I}
+         evaluate_retval
+      done
+
+      log_info_msg "Bringing down the ${1} interface..."
+      ip link set ${1} down
+      brctl delbr ${1}
+      evaluate_retval
+   ;;
+   
+   *)
+      echo "Usage: ${0} [interface] {up|down}"
+      exit 1
+   ;;
+esac
+
+# End /lib/services/bridge
+

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to