Changeset 970a126


Ignore:
Timestamp:
04/09/2012 07:14:33 PM (12 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
9bb0228
Parents:
b12948d
Message:

Update networking bootscripts. See bootscripts change log for details.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9807 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • bootscripts/lfs/lib/services/init-functions

    rb12948d r970a126  
    779779}
    780780
     781################################################################################
     782# is_true()                                                                    #
     783#                                                                              #
     784# Purpose: Utility to test if a variable is true | yes | 1                     #
     785#                                                                              #
     786################################################################################
     787is_true()
     788{
     789   [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] ||  [ "$1" = "y" ] ||
     790   [ "$1" = "t" ]
     791}
     792
    781793# End /lib/lsb/init-functions
  • bootscripts/lfs/lib/services/ipv4-static

    rb12948d r970a126  
    5353         ip addr add ${args} dev ${1}
    5454         evaluate_retval
    55 
    56          if [ -n "${GATEWAY}" ]; then
    57             if ip route | grep -q default; then
    58                log_warning_msg "\nGateway already setup; skipping."
    59             else
    60                log_info_msg "Setting up default gateway..."
    61                ip route add default via ${GATEWAY} dev ${1}
    62                evaluate_retval
    63              fi
    64          fi
    6555      else
    66          msg="Cannot add IPv4 address ${IP} to ${1}.  Already present."
    67          log_warning_msg "$msg"
     56         log_warning_msg "Cannot add IPv4 address ${IP} to ${1}.  Already present."
    6857      fi
    6958   ;;
  • bootscripts/lfs/sbin/ifdown

    rb12948d r970a126  
    1 #!/bin/sh
     1#!/bin/bash
    22########################################################################
    33# Begin /sbin/ifdown
     
    6868fi
    6969
    70 # Reverse the order
    71 SERVICES=
    72 for S in ${SERVICE}; do SERVICES="${SERVICES} ${S}"; done
     70# We only need to first service to bring down the interface
     71S=`echo ${SERVICE} | cut -f1 -d" "`
    7372
    74 # This will run the service scripts
    7573if ip link show ${IFACE} > /dev/null 2>&1; then
    76    for S in ${SERVICES}; do
    77 
    78      if [ -n "${S}" -a -x "/lib/services/${S}" ]; then
    79        IFCONFIG=${file} /lib/services/${S} ${IFACE} down
    80      else
    81        MSG="Unable to process ${file}.  Either "
    82        MSG="${MSG}the SERVICE variable was not set "
    83        MSG="${MSG}or the specified service cannot be executed."
    84        log_failure_msg "$MSG"
    85        exit 1
    86     fi
    87   done
     74   if [ -n "${S}" -a -x "/lib/services/${S}" ]; then
     75     IFCONFIG=${file} /lib/services/${S} ${IFACE} down
     76   else
     77     MSG="Unable to process ${file}.  Either "
     78     MSG="${MSG}the SERVICE variable was not set "
     79     MSG="${MSG}or the specified service cannot be executed."
     80     log_failure_msg "$MSG"
     81     exit 1
     82  fi
    8883else
    8984   log_warning_msg "Interface ${1} doesn't exist."
    9085fi
    9186
     87# Leave the interface up if there are additional interfaces in the device
    9288link_status=`ip link show ${IFACE} 2>/dev/null`
    9389
    9490if [ -n "${link_status}" ]; then
    9591   if [ "$(echo "${link_status}" | grep UP)" != "" ]; then
    96       # Set the interface down only if all IP addresses have been removed.
    9792      if [ "$(ip addr show ${IFACE} | grep 'inet ')" == ""  ]; then
    9893         log_info_msg "Bringing down the ${IFACE} interface..."
  • bootscripts/lfs/sbin/ifup

    rb12948d r970a126  
    99# Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org
    1010#
    11 # Version     : LFS 7.0
     11# Version     : LFS 7.2
    1212#
    1313# Notes       : The IFCONFIG variable is passed to the SERVICE script
     
    1717########################################################################
    1818
    19 RELEASE="7.0"
     19up()
     20{
     21  if ip link show $1 > /dev/null 2>&1; then
     22     link_status=`ip link show $1`
     23
     24     if [ -n "${link_status}" ]; then
     25        if ! echo "${link_status}" | grep -q UP; then
     26           ip link set $1 up
     27        fi
     28     fi
     29
     30  else
     31     log_failure_msg "\nInterface ${IFACE} doesn't exist."
     32     exit 1
     33  fi
     34}
     35
     36RELEASE="7.2"
    2037
    2138USAGE="Usage: $0 [ -hV ] [--help] [--version] interface"
     
    7996for S in ${SERVICE}; do
    8097  if [ ! -x "/lib/services/${S}" ]; then
    81     MSG="\n     Unable to process ${file}.  Either "
     98    MSG="\nUnable to process ${file}.  Either "
    8299    MSG="${MSG}the SERVICE '${S} was not present "
    83100    MSG="${MSG}or cannot be executed."
     
    87104done
    88105
    89 if [ -z "${CHECK_LINK}"         -o \
    90         "${CHECK_LINK}" = "y"   -o \
    91         "${CHECK_LINK}" = "yes" -o \
    92         "${CHECK_LINK}" = "1" ]; then
     106# Create/configure the interface
     107for S in ${SERVICE}; do
     108  IFCONFIG=${file} /lib/services/${S} ${IFACE} up
     109done
    93110
    94    #  Bring up the interface
    95    if ip link show ${IFACE} > /dev/null 2>&1; then
    96       link_status=`ip link show ${IFACE}`
    97 
    98       if [ -n "${link_status}" ]; then
    99          if ! echo "${link_status}" | grep -q UP; then
    100             ip link set ${IFACE} up
    101          fi
    102       fi
    103 
    104    else
    105       log_failure_msg2 "Interface ${IFACE} doesn't exist."
    106       exit 1
    107    fi
    108 fi
     111# Bring up the interface and any components
     112for I in $IFACE $INTERFACE_COMPONENTS; do up $I; done
    109113
    110114# Set MTU if requested. Check if MTU has a "good" value.
    111115if test -n "${MTU}"; then
    112116   if [[ ${MTU} =~ ^[0-9]+$ ]] && [[ $MTU -ge 68 ]] ; then
    113       ip link set dev ${IFACE} mtu $MTU
     117      for I in $IFACE $INTERFACE_COMPONENTS; do
     118         ip link set dev $I mtu $MTU;
     119      done
    114120   else
    115121      log_info_msg2 "Invalid MTU $MTU"
     
    117123fi
    118124
    119 for S in ${SERVICE}; do
    120   IFCONFIG=${file} /lib/services/${S} ${IFACE} up
    121 done
     125# Set the route default gateway if requested
     126if [ -n "${GATEWAY}" ]; then
     127   if ip route | grep -q default; then
     128      log_warning_msg "\nGateway already setup; skipping."
     129   else
     130      log_info_msg "Setting up default gateway..."
     131      ip route add default via ${GATEWAY} dev ${IFACE}
     132      evaluate_retval
     133   fi
     134fi
    122135
    123136# End /sbin/ifup
  • bootscripts/lfs/sbin/ifup.8

    rb12948d r970a126  
    2929              Show version information.
    3030
    31 EXAMPLE
     31EXAMPLES
    3232       ifup eth0
    3333              Bring up the interface defined in the file
    3434              /etc/sysconfig/ifconfig.eth0
    3535
     36                ONBOOT=no
     37                IFACE=eth0
     38                SERVICE=ipv4-static
     39                IP=192.168.1.22
     40                GATEWAY=192.168.1.1
     41                PREFIX=24
     42                BROADCAST=192.168.1.255
     43
    3644       ifdown eth0:2
    3745              Bring down the interface defined in the file
    3846              /etc/sysconfig/ifconfig.eth0:2
     47
     48                ONBOOT=no
     49                IFACE=eth0:2
     50                SERVICE=dhcpcd
     51         
     52                DHCP_START="--waitip"
     53                DHCP_STOP="-k"
     54         
     55                # Set PRINTIP="yes" to have the script print the DHCP IP address
     56                PRINTIP="yes"
     57         
     58                # Set PRINTALL="yes" to print the DHCP assigned values for
     59                # IP, SM, DG, and 1st NS.
     60                PRINTALL="no"
     61
     62       ifup br0
     63              Bring up the interface defined in the file
     64              /etc/sysconfig/ifconfig.br0
     65                   
     66                ONBOOT=yes
     67                IFACE=br0
     68                SERVICE="bridge ipv4-static"
     69                IP=192.168.1.22
     70                GATEWAY=192.168.1.1
     71                PREFIX=24
     72                BROADCAST=192.168.1.255
     73                STP=no                      # Spanning tree protocol, default no
     74                INTERFACE_COMPONENTS=eth0   # Add to IFACE
     75                IP_FORWARD=true
    3976
    4077NOTES
     
    5289                 face.  Standard services are ipv4-static and
    5390                 ipv4-static-route.  Other services such as dhcp
    54                  may be installed.
     91                 or bridge may be installed.  This value may
     92                 be a list of services when the interface is a
     93                 compound device such as a bridge.
    5594
    5695       ONBOOT  - If set to 'yes', the specified interface is
    5796                 configured by the netowrk boot script.
     97
     98       GATEWAY - The default IP address to use for routing if
     99                 the destination IP address is not in a static
     100                 route or on a local network, e.g., 192.168.1.1. 
     101                 For secondary IP addresses on an interface, this
     102                 parameter should not be specified.
     103
     104       INTERFACE_COMPONENTS - A list of component interfaces
     105                 only needed for a compound device such as a bridge. 
     106                 This list is normally a single value, e.g. eth0,
     107                 for use with a virtual host such as kvm.
    58108
    59109       Other paramters that are service specific include:
     
    65115
    66116         PREFIX    - The number of bits that specify the network
    67                      number of the interface, e.g., 24.
     117                     number of the interface.  The default, if not
     118                     specified, is 24.
    68119       
    69          GATEWAY   - The default IP address to use for routing
    70                      if the destination IP address is not in a
    71                      static route or on a local network, e.g.,
    72                      192.168.1.1.  For secondary IP addresses on
    73                      an interface, this parameter should not be
    74                      specified.
    75 
    76120         BROADCAST - The brodcast address for this interface,
    77                      e.g 192.168.1.255.
     121                     e.g 192.168.1.255.  If not specified,
     122                     the broadcast address will be calculated
     123                     from the IP and PREFIX.
    78124
    79125       ipv4-static-route
     
    82128                    'network', 'or host'.
    83129
    84          IP      -  The IP address for a network or host, if thei
     130         IP      -  The IP address for a network or host, if the
    85131                    TYPE is not 'default'.
    86132
     
    93139                    route. (optional)
    94140
     141       dhcp/dhclient
     142
     143         DHCP_START - Optional parameters to pass to the dhcp client
     144                      at startup.
     145
     146         DHCP_STOP  - Optional paremeters to pass to the dhcp client
     147                      at shutdown.
     148
     149         PRINTIP    - Flag to print the dhcp address to stdout
     150
     151         PRINTALL   - Flag to print all obtained dhcp data to stdout
     152
     153       bridge
     154
     155         IP_FORWARD - An optional flag to enable the system to forward
     156                      inbound IP packets received by one interface to
     157                      another outbound interface. 
     158
     159         STP        - Set bridge spanning tree protocol.  Default is no.
     160
    95161FILES
    96162       /etc/sysconfig/ifconfig.*
     
    98164
    99165AUTHORS
    100        The  ifup/ifdown suite was written by Nathan Coulson
     166       The ifup/ifdown suite was written by Nathan Coulson
    101167       <nathan@linuxfromscratch.org> and Kevin P. Fleming
    102168       <kpfleming@linuxfromscratch.org>
     
    106172       ip(8).
    107173
    108 IFUP/IFDOWN                   18 Sep 2011                 ifup(8)
     174IFUP/IFDOWN                   8 April 2012                 ifup(8)
  • chapter01/changelog.xml

    rb12948d r970a126  
    3838-->
    3939    <listitem>
     40      <para>2012-05-09</para>
     41      <itemizedlist>
     42         <listitem>
     43           <para>[bdubbs] - Update networking bootscripts.  See
     44           bootscripts change log for details.
     45           Fixes
     46           <ulink url="&lfs-ticket-root;3053">#3053</ulink>.</para>
     47         </listitem>
     48      </itemizedlist>
     49    </listitem>
     50
     51    <listitem>
    4052      <para>2012-05-05</para>
    4153      <itemizedlist>
  • chapter06/automake.xml

    rb12948d r970a126  
    7171
    7272      <seglistitem>
    73         <seg>acinstall, aclocal, aclocal-&automake-version;, automake,
    74         automake-&automake-version;, compile, config.guess, config.sub,
     73        <seg>acinstall, aclocal, aclocal-&am-minor-version;, automake,
     74        automake-&am-minor-version;, compile, config.guess, config.sub,
    7575        depcomp, elisp-comp, install-sh, mdate-sh, missing, mkinstalldirs,
    7676        py-compile, symlink-tree, and ylwrap</seg>
    77         <seg>/usr/share/aclocal-1.11, /usr/share/automake-1.11,
     77        <seg>/usr/share/aclocal-&am-minor-version;, /usr/share/automake-&am-minor-version;,
    7878        /usr/share/doc/automake-&automake-version;</seg>
    7979      </seglistitem>
     
    107107
    108108      <varlistentry id="aclocalversion">
    109         <term><command>aclocal-&automake-version;</command></term>
     109        <term><command>aclocal-&am-minor-version;</command></term>
    110110        <listitem>
    111111          <para>A hard link to <command>aclocal</command></para>
    112112          <indexterm zone="ch-system-automake aclocalversion">
    113             <primary sortas="b-aclocal-&automake-version;">aclocal-&automake-version;</primary>
     113            <primary sortas="b-aclocal-&am-minor-version;">aclocal-&am-minor-version;</primary>
    114114          </indexterm>
    115115        </listitem>
     
    134134
    135135      <varlistentry id="automake-version">
    136         <term><command>automake-&automake-version;</command></term>
     136        <term><command>automake-&am-minor-version;</command></term>
    137137        <listitem>
    138138          <para>A hard link to <command>automake</command></para>
    139139          <indexterm zone="ch-system-automake automake-version">
    140             <primary sortas="b-automake-&automake-version;">automake-&automake-version;</primary>
     140            <primary sortas="b-automake-&am-minor-version;">automake-&am-minor-version;</primary>
    141141          </indexterm>
    142142        </listitem>
  • chapter06/gcc.xml

    rb12948d r970a126  
    290290    xpointer="xpointer(//*[@os='v'])"/>
    291291
    292     <para>Finally, move a misplced file:</para>
    293 
    294 <screen><userinput remap="install">case `uname -m` in
    295   i?86) GDBDIR=/usr/share/gdb/auto-load/usr/lib/   ;;
    296   *)    GDBDIR=/usr/share/gdb/auto-load/usr/lib64/ ;;
    297 esac
    298 
    299 mkdir -pv $GDBDIR
    300 mv -v /usr/lib/*gdb.py $GDBDIR
    301 unset GDBDIR</userinput></screen>
     292    <para>Finally, move a misplaced file:</para>
     293
     294<screen><userinput remap="install">mkdir -pv /usr/share/gdb/auto-load/usr/lib
     295mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib</userinput></screen>
    302296
    303297  </sect2>
  • chapter07/network.xml

    rb12948d r970a126  
    166166    variable entirely.</para>
    167167
    168     <para>The <envar>PREFIX</envar> variable needs to contain the number of
     168    <para>The <envar>PREFIX</envar> variable containis the number of
    169169    bits used in the subnet. Each octet in an IP address is 8 bits. If the
    170170    subnet's netmask is 255.255.255.0, then it is using the first three octets
     
    173173    commonly used by DSL and cable-based Internet Service Providers (ISPs).
    174174    In this example (PREFIX=24), the netmask is 255.255.255.0. Adjust the
    175     <envar>PREFIX</envar> variable according to your specific subnet.</para>
     175    <envar>PREFIX</envar> variable according to your specific subnet.i
     176    If omitted, the PREFIX defaults to 24.</para>
     177
     178    <para>For more information see the <command>ifup</command> man page.</para>
    176179
    177180  </sect2>
  • general.ent

    rb12948d r970a126  
    1 <!ENTITY version "SVN-20120405">
    2 <!ENTITY releasedate "Apr 05, 2012">
     1<!ENTITY version "SVN-20120409">
     2<!ENTITY releasedate "Apr 09, 2012">
    33<!ENTITY copyrightdate "1999-2012"><!-- jhalfs needs a literal dash, not &ndash; -->
    44<!ENTITY milestone "7.2">
  • packages.ent

    rb12948d r970a126  
    1818
    1919<!ENTITY automake-version "1.11.4">
     20<!ENTITY am-minor-version "1.11">
    2021<!ENTITY automake-size "1,066 KB">
    2122<!ENTITY automake-url "&gnu;automake/automake-&automake-version;.tar.xz">
     
    303304<!ENTITY less-ch6-sbu "less than 0.1 SBU">
    304305
    305 <!ENTITY lfs-bootscripts-version "20120322">                 <!-- Scripts depend on this format -->
     306<!ENTITY lfs-bootscripts-version "20120409">                 <!-- Scripts depend on this format -->
    306307<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB">         <!-- Updated in Makefile -->
    307308<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
Note: See TracChangeset for help on using the changeset viewer.