On Tue, Sep 24, 2013 at 01:09:30PM +0800, WANG Chao wrote:
On 09/23/13 at 03:47pm, Vivek Goyal wrote:
> On Thu, Sep 05, 2013 at 12:47:22AM +0800, WANG Chao wrote:
> > 1st kernel uses ip=ibft and rd.iscsi.firmware to log in ibft lun. In 2nd
> > kernel, ibft lun can be logged in automatically, because 2nd kernel
> > inherit 1st kernel cmdline.
> >
> > Currently kdump will configure netroot=iscsi:xxx if we find iscsi lun
> > being used. In case of ibft, ip=ibft and rd.iscsi.firmware is enough for
> > dracut to be aware of, otherwise netroot=iscsi:xxx will only confuse
> > dracut and fail to log in ibft lun.
> >
> > So in kdump module, we should avoid handling iscsi lun if ibft.
> >
> > Signed-off-by: WANG Chao <chaowang(a)redhat.com>
> > ---
> > dracut-module-setup.sh | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> > index 517099c..252d17a 100755
> > --- a/dracut-module-setup.sh
> > +++ b/dracut-module-setup.sh
> > @@ -268,6 +268,16 @@ kdump_install_conf() {
> > rm -f /tmp/$$-kdump.conf
> > }
> >
> > +kdump_is_ibft() {
> > + local path=$1
> > + local tgt_name fw_tgt_name
> > +
> > + tgt_name=$(kdump_iscsi_get_rec_val "$path"
"node.name")
> > + fw_tgt_name=$(/sbin/iscsiadm -m fw 2>/dev/null | awk '$1 ==
"node.name" {print $3}')
> > +
> > + [ -n "$fw_tgt_name" ] && strstr "$fw_tgt_name"
"$tgt_name"
> > +}
> > +
> > kdump_iscsi_get_rec_val() {
> >
> > local result
> > @@ -323,6 +333,11 @@ kdump_setup_iscsi_device() {
> > return 1
> > fi
> >
> > + if kdump_is_ibft ${path}; then
> > + dinfo "${path} is ibft, skip"
>
> So this is relying on the fact that ip=ibft and rd.iscsi.firmware has
> been passed on command line. Is it always the case in first kernel?
ip=ibft and rd.iscsi.firmware will be appended to cmdline automatically
after installation. Because both of the cmdline args are *required* to
boot an ibft box.
Will it not be the case only if root was on a lun as seen by ibft. What
if I have another network card in the system where I am doing regular
software iscsi and that's where my root is. Or my root is on local disk
but I have some iscsi luns exported using ibft and my dump destination
is an ibft lun?
If users want to use ibft, they must have both ip=ibft and
rd.iscsi.firmware in cmdline. I don't know if dracut or anaconda will
change about it, but for now it's true.
So you are saying that even if root is not on ibft lun, dracut will
bring up ibft luns? Does not sound right to me. Have you tested it?
> Can't I bring up ibft luns from user space later?
You don't have to manually do this. ibft luns will be brought up in
initrd.
Only if root is on ibft lun?
> If yes, it might be better to always append ip=ibft and rd.iscsi.firmware
> to command line option.
If 1st kernel uses ibft, ip=ibft and rd.iscsi.firmware are already there
in cmdline.
If 1st kernel doesn't use ibft, I don't see a reason for ibft to be used
in 2nd kernel.
Providing duplicated ip=ibft might cause some unexpected behavior of
dracut. I didn't test it. I'm not sure wether it's a good idea or not.
But if you have strong reason or insist to do this, I'm fine with this.
You can write a function which appends an option to command line only
if it is not present already.
Thanks
Vivek