Commit Graph

47 Commits (4ef45f13f4d11c86c4c8c3fd8d8a6be2c5b4deef)

Author SHA1 Message Date
Praveen_Paladugu@Dell.com f4eb0d9804 Installing an OS with VLAN enabled to an ISCSI LUN (from ibft)
When installing OS to a VLAN enabled iscsi LUN (extracted from iBFT), "/tmp/net.{xyz}.has_ibft_config" is not being set properly.

Then anaconda installer requires 'BOOTPROTO="ibft"' populated in ifcfg of the vlan interface (ex: ibft0.20), for it to properly populate the kernel parameters post installation. The setting 'BOOTPROTO="ibft"' is populated by write-ifcfg.sh script only if the corresponding interface has a file /tmp/net.{xyz}.has_inft_config

To get around this issue, in ibft_to_cmdline() function in net-lib.sh file, I made the following changes to populate the has_ibft_config file for the vlan interface(ex: ibft0.20):
2014-07-17 16:36:39 +02:00
Chapman Flack 2c19a5fa78 Specify strstr tightly, add strglob/strglobin.
By convention, strstr should be a literal string match. Previously, it
would match as a glob pattern. Some code used that, so add new
functions strglob and strglobin to do what that code expects, and
specify them tightly too. strglob tests whether the glob pattern
matches the entire string (the name strglob is also used in the yorick
language, and that's what it does there), while strglobin tests whether
the glob pattern matches anywhere in the string.

Also tightens str_starts, str_ends, and str_replace to deal with
literal strings only. In a quick grep I did not find code that depended
on these functions matching globs.

Changes the call sites where strstr was used with glob patterns to use
strglobin or strglob as the intention seemed to be (or, in one case,
strstr with the * removed as it did not affect the result anyway).
2014-04-07 10:49:07 +02:00
Harald Hoyer 2e094b20a6 ifcfg: only bind to HWADDR, if addr_assign_type == 0
/sys/class/net/$netif/addr_assign_type is != 0 for random MAC address
interfaces
2014-04-04 12:52:39 +02:00
Harald Hoyer fb0e5184a6 ifcfg: do not bind persistent interface names to HWADDR 2014-04-04 12:48:32 +02:00
Harald Hoyer 43a85a7365 network: merge setup_net_$netif.ok and net.$netif.did-setup
one marker per interface is enough
2014-02-28 12:10:41 +01:00
Harald Hoyer 61b4afb424 network: IPv6 status, wait for tentative flag to be cleared
also do not arping the IPv6 address.
2014-02-27 12:13:18 +01:00
Harald Hoyer 7f70f81153 network/net-lib.sh:wait_for_ipv6_auto() also wait for the tentative flag
Wait until the tentative flag is cleared.

https://bugzilla.redhat.com/show_bug.cgi?id=1069263
2014-02-26 15:02:48 +01:00
Harald Hoyer fac3275a43 network:fix dns parsing in ip= parameter 2014-02-07 15:41:50 +01:00
Harald Hoyer e95e48c6ee network/net-lib.sh: parse ibft nameserver settings 2014-01-30 17:38:27 +01:00
Harald Hoyer 66bfe863f5 network: understand ip=.....:<dns1>:<dns2> 2014-01-30 13:50:02 +01:00
Hannes Reinecke 1c89fd148d Fixup script permissions
Scripts with a shebang should be marked as executable.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Harald Hoyer 7c8da72c11 network/net-lib.sh:iface_has_link() fixup
Just echo'ing the flags IFF_UP|IFF_RUNNING does _not_ reflect the
carrier state immediately. So wait for it to really show up.
2013-12-03 16:21:04 +01:00
Harald Hoyer 56ee31ccfe network/net-lib.sh:wait_for_if_up() wait for "state UP"
really wait for "state UP", otherwise it returns earlier than we want
2013-12-03 16:21:04 +01:00
Harald Hoyer e0aa98a1df network: correctly name iBFT vlan devices 2013-09-11 09:56:57 +02:00
Harald Hoyer 8d3d72a68c no more global $CMDLINE
Do not use the global variable CMDLINE anymore. Use
CMDLINE=$(getcmdline)
2013-09-05 09:57:48 +02:00
WANG Chao f2cbd4cbd6 net-lib: ibft_to_cmdline() fixes
Fix 3 issues in ibft_to_cmdline():
- unset local variables at the beginning of each loop
- only write vlan.conf when we write out ip=xxx
- when vlan id is 0, don't write out vlan.conf. Because 0 means untagged
  and we don't actually need vlan interface.
2013-09-04 08:04:20 +02:00
Harald Hoyer 0b11ea7199 network/net-lib.sh: fix ibft interface configuration
also skip ibft$num names, which have been already given

https://bugzilla.redhat.com/show_bug.cgi?id=989944
2013-08-07 16:05:59 +02:00
Harald Hoyer 9444bf6161 network: add vlan support for iBFT 2013-07-31 13:17:24 +02:00
Harald Hoyer dd82da4e27 network/net-lib.sh: safeguard against incomplete iBFT settings 2013-07-31 12:00:53 +02:00
Harald Hoyer 32bd2fbb4c use "rm --" to guard against filenames beginning with "-" 2013-06-28 10:31:18 +02:00
Will Woods 3d0da653f0 net-lib: fix set_ifname()
/sys/class/$name$num isn't ever going to work; /sys/class/net/$name$num
(e.g. /sys/class/net/ibft0) should work right.
2013-06-13 14:07:17 +02:00
Will Woods 4ef0e2d92a net-lib: add configured_ifaces()
configured_ifaces is a function that returns the names of each interface
that the user wanted configured.

Currently, this is accomplished by reading the list from
/tmp/net.ifaces. But if we want to allow the user to specify an
interface by its MAC address or IP or something, we need a function that
will read the cache and convert the MACs etc. to names.

(Obviously this conversion only works once udev starts, so it will warn
you if you try it too early.)
2013-06-13 14:07:17 +02:00
Will Woods bd0f2c034a net-lib: add find_iface_with_link()
Add a function to look at the system network interfaces and return the
first one it finds with an active link (if any.)
2013-06-13 14:07:17 +02:00
Will Woods d8a698713e Don't explode when mixing BOOTIF and ip=
Now that we can use a MAC as a device identifier, we can just bring up
the device specified by BOOTIF as a normal interface.

So instead of ignoring everything but BOOTIF, we'll put BOOTIF in the
IFACES list and bring it up as normal, defaulting to DHCP if nothing
else is specified.

We can also handle anaconda-style 'ksdevice=bootif' this way.
2013-06-13 14:07:17 +02:00
Will Woods 215ff169db move fix_bootif to net-lib
This might be useful to other parts of dracut; move it to net-lib.sh.
2013-06-13 13:54:16 +02:00
Harald Hoyer f8b958dc62 network: wait 40 seconds for IPv6 auto configuration
https://bugzilla.redhat.com/show_bug.cgi?id=973719
2013-06-12 17:42:35 +02:00
Dennis Schridde cbfe65c2fe [40network] Provide a hostname fallback function, in case there is no executable of this name 2013-05-29 11:32:57 +02:00
Radek Vykydal fd8e4aef90 Write BOOTPROTO=ibft for ip=ibft to ifcfg files 2013-03-14 10:54:28 +01:00
Dan Horák 02640e8e65 set peer for point-to-point connections
network/net-lib.sh: only set net vars, if they have a value
2013-02-08 16:52:30 +01:00
dyoung@redhat.com 9078167927 Wait for link ready before use the interface
Some network driver will take long time to initialize. We have an example
in a HP machine which take about one minute for this. The callback such as
"ip link set <dev> up" will fail, afterwards setup for network will also
fail.

Fix this by add a new function wait_for_if_link, wait the link ready before
use it.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
dyoung@redhat.com b455451f49 Add function linkup
set link up usually include two steps, ip link set <dev> up and
wait_for_if_up <dev>. Now do these two steps in one function linkup.
Later patch will add other code into it.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
dyoung@redhat.com efa5eb424d Move wait for if functions to net lib
net-lib.sh are created for net related functions, move the wait_for_if* to
net-lib.sh naturally.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
Harald Hoyer 7990578443 network: fixed MAC address assignment 2012-11-26 13:49:38 +01:00
Chris Leech d672bf167c network: fix ip=ibft regression
It looks like ip=ibft has been busted since
  25aa3c5 network: refactor stuff from netroot/parse-ip-opts to net-lib
which moved ibft parsing code out to the ibft_to_cmdline function.

The use of ifname_mac was partially replaced by a local mac, but not
completely, causing ibft_to_cmdline to abort without generating network
configuration options.

Signed-off-by: Chris Leech <cleech@redhat.com>
2012-09-06 12:18:06 +02:00
Harald Hoyer 1760dfc051 network: do not rename other interfaces and document the ifname usage
We do not support renaming in the kernel namespace anymore (as udev does
that not anymore). So, if a user wants to use ifname, he has to rename
to a custom namespace. "eth[0-9]+" is not allowed anymore.
2012-07-06 12:41:55 +02:00
Harald Hoyer e7dc1e42cd network: factor out parse_ifname_opts() for ifname-genrules 2012-07-05 14:33:45 +02:00
Harald Hoyer 99c7b70d1d modules.d: get rid of "tr"
replace it with sed or str_replace or bash ${var/a/b}
2012-06-29 12:41:27 +02:00
Harald Hoyer 8b88dc7f71 network: do not arping with qeth layer3 interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=825783
2012-05-29 17:39:17 +02:00
Will Woods f629355b2f add anaconda-style option parsing to ip_to_var
Anaconda used arguments of the form:

  ip=<ip> gateway=<gw> netmask=<nm>

for static IP configuration. So if we get a value for "ip" that's an IP
address, look for gateway= and netmask= and related args to fill in the
ip config vars.
2012-05-29 11:32:45 +02:00
Harald Hoyer c6c704fda6 network: fix ifup and netroot calling 2012-04-23 11:32:45 +02:00
Will Woods e173f0b384 network: add save_netinfo, fix problems with nfs->NM takeover
For NetworkManager to properly take over a NFS-root system, we need to
have the interface name(s) in /tmp/net.ifaces and save the dhclient
lease. This lets the ifcfg module do its magic.

save_netinfo should properly write out /tmp/net.ifaces when needed, and
copies the dhclient files into place.
2012-04-16 11:53:04 +02:00
Will Woods 1e4a880125 run setup_net at start of initqueue/online hook
This makes sure the network is active and ready to use during the
initqueue/online hook.

It also makes it so you can run setup_net repeatedly without causing
error messages.
2012-04-16 11:53:04 +02:00
Harald Hoyer 990e945ffd add mtu and macaddr to ip= 2012-04-05 13:25:41 +02:00
Harald Hoyer ac3f1c6e87 add iscsi interface binding
iscsi connections can now be bound to <iscsi_iface_name> and <netdev_name>
2012-03-29 12:02:12 +02:00
Will Woods 25aa3c5a6e network: refactor stuff from netroot/parse-ip-opts to net-lib
Add new functions: all_ifaces_up, get_netroot_ip, ip_is_local, ifdown,
setup_net, set_ifname, ibft_to_cmdline

Use them in netroot.sh and parse-ip-opts.sh.

There's also a couple little unrelated cleanups.
2012-03-08 11:01:40 +01:00
Harald Hoyer 4977febf46 s/bash/sh for all new *-lib.sh 2012-02-15 15:46:24 +01:00
Will Woods 9d169a07ce 40network: add net-lib.sh
net-lib.sh is a library of useful functions for network stuff.

More things may get added/moved here in the future.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00