diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2007-07-25 19:04:16 -0500 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2007-07-25 19:04:16 -0500 |
commit | 2899caf02bbfd76cd56103e696e5aebed6af9276 (patch) | |
tree | 0f2369652a43f3dce39a626160890c3e63b039e0 /include | |
parent | 75a052f1bedab2ca504156e2c6fa5b72c371c75b (diff) | |
download | open-iscsi-2899caf02bbfd76cd56103e696e5aebed6af9276.tar.gz |
hook fw programs into iscsi tools
This patch hooks ibft into iscsiadm and iscsistart. Why do this? It
seems easier to be able to just run the same tool we use for normal
login. For example in the installer or initramfs we can do this:
// This will check for fw crap and if found
// log into targets that are found
// returns 0 on success and non zero if
// there was no fw crap or we could not log
// in or some other error.
// This will _not_ store any record (text files
// with data in it) in /var/lib/iscsi.
// It is completely dynamic in that regard.
ret = iscsiadm -m discovery -t fwboot -l
(fwboot - is a new discovery type I added which is for this fw crap).
// For normal iscsi install we can then do:
ret = iscsiadm -m discovery -t st -p ip:port -l
// This will do discovery to the portal at
// ip:port, and now the code supports the -l on discovery,
// so it will also log into all the targets found
// automagically for the caller.
// This will store records (text files with target data in it)
// like usual to /var/lib/iscsi.
To setup the initramfs then, we just need some variable that tells us if
we are doing the fw boot or the pxe net iscsi boot. This could be done
by checking iscsiadm or iscsistart like so:
ret = iscsiadm -m discovery -t fwboot
// no login/-l command this time
if ret
indicates success, then setup initramfs for dynamic fwboot
else
do the normal pxe static iscsi root stuff we did.
In the initrams fs if using iscsistart we would just do
(if this got setup for fw dynamic boot)
or it would end up as
And if using iscsiadm in the initramfs you can just do
iscsiadm -m discovery -t fwboot -l
The patch was made using Prasana and Doug's code. I have not tested it.
I do not have the hardware handy (no intel card and I got stuck looking
for a ppc box with it).
Diffstat (limited to 'include')
-rw-r--r-- | include/fw_context.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/fw_context.h b/include/fw_context.h new file mode 100644 index 0000000..4307509 --- /dev/null +++ b/include/fw_context.h @@ -0,0 +1,46 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * + * Copyright (C) IBM Corporation. 2007 + * Author: Doug Maxey <dwm@austin.ibm.com> + * "Prasanna Mumbai" <mumbai.prasanna@gmail.com> + * + */ +#ifndef FWPARAM_CONTEXT_H_ +#define FWPARAM_CONTEXT_H_ + +struct boot_context { +#define IQNSZ (223) + int target_port; + char initiatorname[IQNSZ]; + char targetname[IQNSZ]; + char target_ipaddr[32]; + char chap_name[127]; + char chap_password[16]; + char chap_name_in[127]; + char chap_password_in[16]; + char mac[16]; + char iface[42]; + char lun[17]; + char vlan[15]; + char isid[10]; +}; + +int fw_entry_init(struct boot_context *context, int option); + +#define FW_CONNECT 0 +#define FW_PRINT 1 + +#endif /* FWPARAM_CONTEXT_H_ */ |