Commit Graph

137 Commits (c75196e11ec4325fc76bb11aeb884ceade62df48)

Author SHA1 Message Date
Derek Higgins 9408a2ac33 Skip iscsi attachment if no info
If no iscsi session information can be retrieved from the firmware
then skip the iscsi attachment and allow the boot process to continue.
Ensure the timeout scripts don't hit their timeout waiting for
/tmp/iscsistarted-firmware to be created.
This will allow a common image to be used for servers with both a
local and iscsi root with rd.iscsi.firmware set.
2017-10-26 16:27:45 +01:00
Harald Hoyer 7e51a94f5b Do not "cp" the selinux context
replace "cp -a" with $DRACUT_CP, so in case the selinux policy disallows
root to set the selinux context in /var/tmp, dracut does not fail.
2017-01-16 14:27:39 +01:00
Harald Hoyer 8d9ab2755d Fix regressions with dracut-install with kernel modules
Make sure, the same modules are installed as before.
2016-04-13 11:47:20 +02:00
Harald Hoyer 794b2d2c75 Use dracut-install to install kernel modules
dracut-install can now install kernel modules and their corresponding
firmware files.
2016-04-11 16:32:10 +02:00
Harald Hoyer 602dce9ff2 iscsi/parse-iscsiroot.sh: reload udev rules
in the DHCP case udev is already running, so reload the rules before
continuing.
2015-11-13 16:37:48 +01:00
Harald Hoyer ed92ecaa3c iscsi: only systemctl try-restart iscsid, if systemd is used 2015-11-13 13:16:10 +01:00
Harald Hoyer 98e9db2755 iscsi/iscsiroot.sh: put variables in quotes
best practice
2015-11-13 13:15:05 +01:00
Harald Hoyer 79cb273dc0 iscsi/parse-iscsiroot.sh: correct handling if netroot isn't set
corrects bfe65f913a

(cherry picked from commit 7fd112f20e)
2015-11-11 16:46:54 +01:00
Harald Hoyer b5363e834a iscsi/iscsiroot.sh: handle iscsi_firmware in online and timeout queue
The return code of iscsi_firmware is broken, so set the marker
unconditionally.

(cherry picked from commit fd3eddf069)
2015-11-11 16:44:36 +01:00
Harald Hoyer df087c45d8 iscsi/iscsiroot.sh: use all_ifaces_setup()
we want the route and gateway setup

(cherry picked from commit 7cddfbbadb)
2015-11-11 16:44:20 +01:00
Harald Hoyer 73833796b4 network: move "ip=ibft" handling to network module
(cherry picked from commit b334c83e4a)
2015-11-11 16:38:49 +01:00
Harald Hoyer e803d076f8 iscsi/parse-iscsiroot.sh: only set initiator-name, if not empty
(cherry picked from commit eb87dc91d0)
2015-11-11 16:36:25 +01:00
Harald Hoyer 3632be079b iscsi/parse-iscsiroot.sh: restart iscsid with try-restart
(cherry picked from commit a6befb52eb)
2015-11-11 16:17:42 +01:00
Harald Hoyer 782e909eef iscsi/parse-iscsiroot.sh: handle firmware in online queue
(cherry picked from commit 7f59cbd318)
2015-11-11 16:17:33 +01:00
Harald Hoyer bcbcacb5d6 iscsi: handle timeout case better
(cherry picked from commit bfe65f913a)
2015-11-11 15:56:27 +01:00
Harald Hoyer f5753e1861 iscsi/module-setup.sh: iscsid need /var/lib/iscsi
(cherry picked from commit f74b0a9f38)
2015-11-11 15:52:44 +01:00
Harald Hoyer 6138a45dd2 iscsi/parse-iscsiroot.sh: do not modify netroot
(cherry picked from commit 197e4c90b9)
2015-11-11 15:21:27 +01:00
Harald Hoyer 7391fef29a iscsi/iscsiroot.sh: handle firmware in online queue
otherwise it does not get called, if no netroot is set

(cherry picked from commit 3bd3bbec31)
2015-11-11 15:21:19 +01:00
Harald Hoyer 6802cf2349 iscsi/iscsiroot.sh: handle timeout with all interfaces up
restart iscsid, because it may disbehaved
2015-08-13 11:53:21 +02:00
Harald Hoyer feb8dc685d iscsi/parse-iscsiroot.sh: use iBFT initiator name 2015-08-12 15:17:33 +02:00
Harald Hoyer d94050ddae iscsi: integrate with systemd and improve robustness
parse-cmdline sets up an initial initiator-name to let iscsid start.

iscsid is started before doing any iscsistart business.

iscsistart is done with systemd-run asynchrone to do things in
paralllel. Also restarted for every new interface which shows up.

If rd.iscsi.waitnet (default) is set, iscsistart is done only
after all interfaces are up.

If not all interfaces are up and rd.iscsi.testroute (default) is set,
the route to a iscsi target IP is checked and skipped, if there is none.

If all things fail, we issue a "dummy" interface iscsiroot to retry
everything in the initqueue/timeout.
2015-08-12 14:33:49 +02:00
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Harald Hoyer 437dad70e9 Defer modprobe of HW modules, until udev is running
Also honor blacklisting
2015-04-24 11:59:37 +02:00
Hannes Reinecke cd72830807 95iscsi: parse output from iscsiadm correctly
Due to some obsure reason the IFS parameter is not set correctly
when evaluating get_ibft_mod(). So change the parsing to not rely
on IFS altogether.

References: bnc#886199

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger f34a2ef14d iscsi: iscsi.initiator and others can and must only show up once
Make sure duplicates of iscsi.initiator vanish.
Only get one rd.iscsi.* paramter value. If getargs is used and several
parameters are parsed, one gets two values separated by whitespace in a
variable which breaks later code and is not suppported.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke c4d8793c67 95iscsi: generate commandline for software iscsi
When installing on an software iscsi root we need to generate
the correct commandline, otherwise the system cannot boot.

References: bnc#880108
Patch: 0093

When using software iscsi we should be using the existing
configuration from the system for the time being.

References: bnc#884768
Patch: 0095

Avoid bad ip route call on empty address
Patch: 0143

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke 54e28d79b9 95iscsi: More empty cmdline fixes
This fixes up some 95iscsi/module-setup.sh which might print out empty
commandline files.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke 2e34f38095 95iscsi: Fixup bnx2i offload booting
bnx2i is using a separate iSCSI offload engine with a separate
MAC address. As a result, the iBFT information is displaying
a MAC address which does not relate to any MAC address from
the network interfaces.
In addition, the iSCSI offload engine works independently on
the NIC, so we do not need to enable the NIC for iSCSI offload
to work.
This patch modifies the automatic iBFT detection to not set
the 'ip=ibft' flag when bnx2i offload is detected.

References: bnc#855747

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke 9ebf4a5d3c 95iscsi: strip one set of quotes when calling initqueue
The bad initqueue parameter passing is already addressed by git commit:
commit bb8c16d121
and
commit 486a8f33e2

However this appraoch is slightly different:
"$netroot" instead of "'$netroot'", etc.

initqueue will process the arguments, assuming the first non-option
argument to be the program to be executed. Putting the entire
commandline into this argument confuses both, initqueue and the
program in question.

References: bnc#879038

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke a3a2266046 95iscsi: Set correct iscsi_started value for iSCSI firmware
When iSCSI firmware booting is selected we should not rely on
'netroot' or 'iscsiroot' variables to be set.

References: bnc#873448

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke 4aad3438f7 95iscsi: Install libgcc_s library
iscsiuio is using pthread, which requires libgcc_s for
pthread_cancel to work.
Without this library iscsiuio will crash with SIGABRT.

References: bnc#881692

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke 442abd16d2 95iscsi: Autodetect iSCSI firmware
Some iSCSI initiator present firmware information in
/sys/firmware/ibft or /sys/firmware/iscsi_bootX

Whenever we detect one of those directories we should assume
that the iSCSI devices should be activated.

Also incorporates SUSE patches:
0049:
95iscsi: Use 'ip=ibft' for ibft autoconfiguration

For iBFT autoconfiguration we should be setting 'ip=ibft'
instead of rd.neednet. This should instruct dracut to only
enable the iBFT interfaces and leave the rest alone.

References: bnc#879038

0054:
95iscsi: update commandline printing

dracut has a separate callout 'cmdline' which should be used
for printing out the generated commandline.

Signed-off-by: Pavel Wieczorkiewicz <pwieczorkiewicz@suse.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer bb8c16d121 iscsi: correctly install the settled iscsiroot dummy call
initqueue parses $1 as the executable command
2014-06-11 14:58:55 +02:00
Harald Hoyer 486a8f33e2 iscsi: correctly install the timeout iscsiroot dummy call
initqueue parses $1 as the executable command
2014-06-11 14:55:11 +02:00
Harald Hoyer a324c2111e iscsi: for iBFT read the initiator-name from the correct file
/sys/firmware/ibft/initiator-name should be
/sys/firmware/ibft/initiator/initiator-name

https://github.com/haraldh/dracut/issues/12
2014-02-19 11:49:34 +01:00
Harald Hoyer cb802bfbc7 iscsiroot: touch the right marker file 2014-02-12 18:26:36 +01:00
Harald Hoyer 30e6e809ed Factor out all the "type -V" commands
Add new functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.

These functions print a warning line telling the user, which binary is
missing for the specific dracut module.

This unifies the way of checking for binaries and makes the life of an
initramfs creator easier, if he wants to find out why a specific dracut
module is not included in the initramfs.
2014-02-06 16:45:20 +01:00
Harald Hoyer 352d557d4d Do not reload systemd with wait_for_dev 2014-02-05 13:12:29 +01:00
Harald Hoyer b5b31c9589 iscsi/iscsiroot.sh: beautify warning 2014-01-28 12:14:07 +01:00
Harald Hoyer c7e15f0891 iscsi: more iscsiroot fixes
handle iscsiroot with firmware more gracefully
2014-01-22 17:40:10 +01:00
Harald Hoyer 21a3aab720 iscsi: call "iscsistart -b" until it succeeds 2014-01-17 14:52:01 +01:00
Harald Hoyer 8c828f329b iscsi/iscsiroot.sh: do not trust iscsistart return value 2014-01-13 09:51:04 +01:00
Harald Hoyer ab6f4a825e iscsi: do iscsi_firmware regardless of network
Do the iscsi_firmware iscsistart at least once, even if the network is
not up, to activate offload HBA iSCSI.

https://bugzilla.redhat.com/show_bug.cgi?id=1031160
2013-12-18 15:22:24 +01:00
Harald Hoyer c2ab990938 iscsi,nbd: do not fail in hostonly mode 2013-11-11 16:57:09 +01:00
Harald Hoyer fa9384b1c0 iscsi/nbd: do not try to mount the whole disk, if root= is missing
only mount the whole disk for root=dhcp
2013-10-30 17:38:43 +01:00
Harald Hoyer 8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Harald Hoyer de74e1ef41 Rewrite "rootok" and "netroot" logic
Previously if "$rootok" = 1, parsing of netroot command line arguments
was skipped. For multiple netroot arguments, all parse scripts have to
run.

Previously only the first netroot argument was taken into account for
the parsing scripts. Now every netroot argument is processed.
2013-09-04 09:49:19 +02:00
Harald Hoyer 5ecc117a25 iscsi: parse iscsi parameter, even if rootok=1 2013-09-03 15:23:28 +02:00
Harald Hoyer ffc68f357e use ${var:+val} rather than ${var+val}
${var:+val} also catches var=""
2013-08-22 11:24:01 +02:00