summaryrefslogtreecommitdiffstats
path: root/install/net
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-07-11 04:44:04 +0200
committerDave Reisner <dreisner@archlinux.org>2011-09-27 12:18:04 +0200
commit1ce14002289b676c54729e9d9dfaa7f6fd58024b (patch)
tree91e887e78f744c81e09e14e37cdd1863b27ef369 /install/net
parent1793ad71472d85912dd258cc6730e20a46dbbb17 (diff)
downloadmkinitcpio-1ce14002289b676c54729e9d9dfaa7f6fd58024b.tar.gz
mkinitcpio-1ce14002289b676c54729e9d9dfaa7f6fd58024b.tar.xz
cleanup and bashify install hooks
No logical code changes -- this is purely a syntactical cleanup and standardization across the build hooks along with ensuring that help messages are wrapped to 80 columns or less. All hooks get the same treatment, adhering to the following style: #!/bin/bash build() { COMMANDS } help() { cat <<HELPEOF This is a help message. HELPEOF } # vim: set ft=sh ts=4 sw=4 et: Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'install/net')
-rw-r--r--install/net195
1 files changed, 96 insertions, 99 deletions
diff --git a/install/net b/install/net
index 2c816ba..88d0c97 100644
--- a/install/net
+++ b/install/net
@@ -1,109 +1,106 @@
-# vim: set ft=sh:
+#!/bin/bash
-build()
-{
+build() {
MODULES="nfs $(checked_modules "/drivers/net/") "
-
- BINARIES=""
- FILES=""
SCRIPT="net"
add_binary "/lib/initcpio/ipconfig" "/bin/ipconfig"
add_binary "/lib/initcpio/nfsmount" "/bin/nfsmount"
}
-help ()
-{
-cat<<HELPEOF
- This hook loads the necessary modules for a network device.
- Detection will take place at runtime. To minimize the modules
- in the image, add the autodetect hook too.
- For pcmcia net devices please use pcmcia hook too.
-
- Kernel Parameters:
- An interface spec can be either short form, which is just the name of
- an interface (eth0 or whatever), or long form. The long form consists
- of up to seven elements, separated by colons:
-
- ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
- nfsaddrs= is an alias to ip= and can be used too.
-
- <client-ip> IP address of the client. If empty, the address will
- either be determined by RARP/BOOTP/DHCP. What protocol
- is used de- pends on the <autoconf> parameter. If this
- parameter is not empty, autoconf will be used.
-
- <server-ip> IP address of the NFS server. If RARP is used to
- determine the client address and this parameter is NOT
- empty only replies from the specified server are
- accepted. To use different RARP and NFS server,
- specify your RARP server here (or leave it blank), and
- specify your NFS server in the 'nfsroot' parameter
- (see above). If this entry is blank the address of the
- server is used which answered the RARP/BOOTP/DHCP
- request.
-
- <gw-ip> IP address of a gateway if the server is on a different
- subnet. If this entry is empty no gateway is used and the
- server is assumed to be on the local network, unless a
- value has been received by BOOTP/DHCP.
-
- <netmask> Netmask for local network interface. If this is empty,
- the netmask is derived from the client IP address assuming
- classful addressing, unless overridden in BOOTP/DHCP reply.
-
- <hostname> Name of the client. If empty, the client IP address is
- used in ASCII notation, or the value received by
- BOOTP/DHCP.
-
- <device> Name of network device to use. If this is empty, all
- devices are used for RARP/BOOTP/DHCP requests, and the
- first one we receive a reply on is configured. If you
- have only one device, you can safely leave this blank.
-
- <autoconf> Method to use for autoconfiguration. If this is either
- 'rarp', 'bootp', or 'dhcp' the specified protocol is
- used. If the value is 'both', 'all' or empty, all
- protocols are used. 'off', 'static' or 'none' means
- no autoconfiguration.
- Examples:
- ip=127.0.0.1:::::lo:none --> Enable the loopback interface.
- ip=192.168.1.1:::::eth2:none --> Enable static eth2 interface.
- ip=:::::eth0:dhcp --> Enable dhcp protcol for eth0 configuration.
-
- nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
-
- If the 'nfsroot' parameter is NOT given on the command line, the default
- "/tftpboot/%s" will be used.
-
- <server-ip> Specifies the IP address of the NFS server. If this field
- is not given, the default address as determined by the
- 'ip' variable (see below) is used. One use of this
- parameter is for example to allow using different servers
- for RARP and NFS. Usually you can leave this blank.
-
- <root-dir> Name of the directory on the server to mount as root. If
- there is a "%s" token in the string, the token will be
- replaced by the ASCII-representation of the client's IP
- address.
-
- <nfs-options> Standard NFS options. All options are separated by commas.
- If the options field is not given, the following defaults
- will be used:
- port = as given by server portmap daemon
- rsize = 1024
- wsize = 1024
- timeo = 7
- retrans = 3
- acregmin = 3
- acregmax = 60
- acdirmin = 30
- acdirmax = 60
- flags = hard, nointr, noposix, cto, ac
-
- root=/dev/nfs
-
- If you don't use nfsroot= parameter you need to set root=/dev/nfs
- to boot from a nfs root by autoconfiguration.
+help() {
+ cat <<HELPEOF
+This hook loads the necessary modules for a network device.
+Detection will take place at runtime. To minimize the modules
+in the image, add the autodetect hook too.
+For pcmcia net devices please use pcmcia hook too.
+
+Kernel Parameters:
+An interface spec can be either short form, which is just the name of
+an interface (eth0 or whatever), or long form. The long form consists
+of up to seven elements, separated by colons:
+
+ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
+nfsaddrs= is an alias to ip= and can be used too.
+
+<client-ip> IP address of the client. If empty, the address will
+ either be determined by RARP/BOOTP/DHCP. What protocol
+ is used de- pends on the <autoconf> parameter. If this
+ parameter is not empty, autoconf will be used.
+
+<server-ip> IP address of the NFS server. If RARP is used to
+ determine the client address and this parameter is NOT
+ empty only replies from the specified server are
+ accepted. To use different RARP and NFS server,
+ specify your RARP server here (or leave it blank), and
+ specify your NFS server in the 'nfsroot' parameter
+ (see above). If this entry is blank the address of the
+ server is used which answered the RARP/BOOTP/DHCP
+ request.
+
+<gw-ip> IP address of a gateway if the server is on a different
+ subnet. If this entry is empty no gateway is used and the
+ server is assumed to be on the local network, unless a
+ value has been received by BOOTP/DHCP.
+
+<netmask> Netmask for local network interface. If this is empty,
+ the netmask is derived from the client IP address assuming
+ classful addressing, unless overridden in BOOTP/DHCP reply.
+
+<hostname> Name of the client. If empty, the client IP address is
+ used in ASCII notation, or the value received by
+ BOOTP/DHCP.
+
+<device> Name of network device to use. If this is empty, all
+ devices are used for RARP/BOOTP/DHCP requests, and the
+ first one we receive a reply on is configured. If you
+ have only one device, you can safely leave this blank.
+
+<autoconf> Method to use for autoconfiguration. If this is either
+ 'rarp', 'bootp', or 'dhcp' the specified protocol is
+ used. If the value is 'both', 'all' or empty, all
+ protocols are used. 'off', 'static' or 'none' means
+ no autoconfiguration.
+Examples:
+ip=127.0.0.1:::::lo:none --> Enable the loopback interface.
+ip=192.168.1.1:::::eth2:none --> Enable static eth2 interface.
+ip=:::::eth0:dhcp --> Enable dhcp protcol for eth0 configuration.
+
+nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
+
+If the 'nfsroot' parameter is NOT given on the command line, the default
+"/tftpboot/%s" will be used.
+
+<server-ip> Specifies the IP address of the NFS server. If this field
+ is not given, the default address as determined by the
+ 'ip' variable (see below) is used. One use of this
+ parameter is for example to allow using different servers
+ for RARP and NFS. Usually you can leave this blank.
+
+<root-dir> Name of the directory on the server to mount as root. If
+ there is a "%s" token in the string, the token will be
+ replaced by the ASCII-representation of the client's IP
+ address.
+
+<nfs-options> Standard NFS options. All options are separated by commas.
+ If the options field is not given, the following defaults
+ will be used:
+ port = as given by server portmap daemon
+ rsize = 1024
+ wsize = 1024
+ timeo = 7
+ retrans = 3
+ acregmin = 3
+ acregmax = 60
+ acdirmin = 30
+ acdirmax = 60
+ flags = hard, nointr, noposix, cto, ac
+
+root=/dev/nfs
+
+If you don't use nfsroot= parameter you need to set root=/dev/nfs
+to boot from a nfs root by autoconfiguration.
HELPEOF
}
+
+# vim: set ft=sh ts=4 sw=4 et: