added NFS boot support for fedora live 11
authorPravin Shinde <pravin@black-perl.(none)>
Wed, 22 Jul 2009 00:28:53 +0000 (02:28 +0200)
committerPravin Shinde <pravin@black-perl.(none)>
Wed, 22 Jul 2009 00:28:53 +0000 (02:28 +0200)
adding iscsi boot support to debian

25 files changed:
pxeknife/debian/debian-live-501-i386/generate_initrd.sh
pxeknife/debian/debian-live-501-i386/iscsi/initiatorname.iscsi [new file with mode: 0644]
pxeknife/debian/debian-live-501-i386/iscsi/iscsid.conf [new file with mode: 0644]
pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsi-iname [new file with mode: 0755]
pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsi_discovery [new file with mode: 0755]
pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsiadm [new file with mode: 0755]
pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsid [new file with mode: 0755]
pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsistart [new file with mode: 0755]
pxeknife/debian/debian-live-501-i386/iscsi/tools/isosize [new file with mode: 0755]
pxeknife/debian/debian-live-501-i386/live
pxeknife/debian/debian.conf
pxeknife/red_hat/fedora_11_live_cd/generate_initrd.sh
pxeknife/red_hat/fedora_11_live_cd/modules/auth_rpcgss.ko [new file with mode: 0755]
pxeknife/red_hat/fedora_11_live_cd/modules/lockd.ko [new file with mode: 0755]
pxeknife/red_hat/fedora_11_live_cd/modules/nfs.ko [new file with mode: 0755]
pxeknife/red_hat/fedora_11_live_cd/modules/nfs_acl.ko [new file with mode: 0755]
pxeknife/red_hat/fedora_11_live_cd/modules/sunrpc.ko [new file with mode: 0755]
pxeknife/red_hat/fedora_11_live_cd/mount.nfs [new file with mode: 0755]
pxeknife/red_hat/fedora_11_live_cd/mount_http_iso.sh
pxeknife/red_hat/fedora_11_live_cd/mount_nfs_iso.sh [new file with mode: 0755]
pxeknife/red_hat/fedora_11_live_cd/real-init
pxeknife/red_hat/fedora_11_live_cd/run-init [new file with mode: 0755]
pxeknife/red_hat/red_hat.conf
pxeknife/ubuntu/ubuntu-9.04-desktop-i386/generate_initrd.sh
pxeknife/ubuntu/ubuntu.conf

index 352bfed..aa3906a 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+set -e
 
 #cleanup the old mess
 echo "Removing the old files"
@@ -11,7 +12,7 @@ gunzip initrd.gz
 echo "extracting filesystem filesystem"
 mkdir mpoint
 cd mpoint 
-cpio -ivu --no-absolute-filename  < ../initrd
+cpio -ivu --no-absolute-filename  < ../initrd 2> /dev/null
 cd ..
 
 echo "coping the needed files..."
@@ -20,6 +21,17 @@ echo "coping the needed files..."
 cp run-init mpoint/bin/
 chmod 777 mpoint/bin/run-init
 
+echo "copying iscsi related files..."
+mkdir mpoint/etc/iscsi
+cp iscsi/iscsid.conf mpoint/etc/iscsi/
+cp iscsi/initiatorname.iscsi mpoint/etc/iscsi/
+cp iscsi/tools/* mpoint/sbin/
+cp strace mpoint/sbin/
+cp passwd mpoint/etc/
+cp group mpoint/etc/
+cp a.out mpoint/bin/
+
+
 cp httpfs/server/httpfs mpoint/bin/
 chmod 777 mpoint/bin/httpfs
 
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/initiatorname.iscsi b/pxeknife/debian/debian-live-501-i386/iscsi/initiatorname.iscsi
new file mode 100644 (file)
index 0000000..a732d75
--- /dev/null
@@ -0,0 +1,6 @@
+## DO NOT EDIT OR REMOVE THIS FILE!
+## If you remove this file, the iSCSI daemon will not start.
+## If you change the InitiatorName, existing access control lists
+## may reject this initiator.  The InitiatorName must be unique
+## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames.
+InitiatorName=iqn.1993-08.org.debian:01:74e6bd2d995f
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/iscsid.conf b/pxeknife/debian/debian-live-501-i386/iscsi/iscsid.conf
new file mode 100644 (file)
index 0000000..83200c2
--- /dev/null
@@ -0,0 +1,245 @@
+#
+# Open-iSCSI default configuration.
+# Could be located at /etc/iscsi/iscsid.conf or ~/.iscsid.conf
+#
+# Note: To set any of these values for a specific node/session run
+# the iscsiadm --mode node --op command for the value. See the README
+# and man page for iscsiadm for details on the --op command.
+#
+
+################
+# iSNS settings
+################
+# Address of iSNS server
+#isns.address = 192.168.0.1
+#isns.port = 3205
+
+#############################
+# NIC/HBA and driver settings
+#############################
+# open-iscsi can create a session and bind it to a NIC/HBA.
+# To set this up see the example iface config file.
+
+#*****************
+# Startup settings
+#*****************
+
+# To request that the iscsi initd scripts startup a session set to "automatic".
+node.startup = automatic
+#
+# To manually startup the session set to "manual". The default is manual.
+#node.startup = manual
+
+# *************
+# CHAP Settings
+# *************
+
+# To enable CHAP authentication set node.session.auth.authmethod
+# to CHAP. The default is None.
+#node.session.auth.authmethod = CHAP
+
+# To set a CHAP username and password for initiator
+# authentication by the target(s), uncomment the following lines:
+#node.session.auth.username = username
+#node.session.auth.password = password
+
+# To set a CHAP username and password for target(s)
+# authentication by the initiator, uncomment the following lines:
+#node.session.auth.username_in = username_in
+#node.session.auth.password_in = password_in
+
+# To enable CHAP authentication for a discovery session to the target
+# set discovery.sendtargets.auth.authmethod to CHAP. The default is None.
+#discovery.sendtargets.auth.authmethod = CHAP
+
+# To set a discovery session CHAP username and password for the initiator
+# authentication by the target(s), uncomment the following lines:
+#discovery.sendtargets.auth.username = username
+#discovery.sendtargets.auth.password = password
+
+# To set a discovery session CHAP username and password for target(s)
+# authentication by the initiator, uncomment the following lines:
+#discovery.sendtargets.auth.username_in = username_in
+#discovery.sendtargets.auth.password_in = password_in
+
+# ********
+# Timeouts
+# ********
+#
+# See the iSCSI REAME's Advanced Configuration section for tips
+# on setting timeouts when using multipath or doing root over iSCSI.
+#
+# To specify the length of time to wait for session re-establishment
+# before failing SCSI commands back to the application when running
+# the Linux SCSI Layer error handler, edit the line.
+# The value is in seconds and the default is 120 seconds.
+node.session.timeo.replacement_timeout = 120
+
+# To specify the time to wait for login to complete, edit the line.
+# The value is in seconds and the default is 15 seconds.
+node.conn[0].timeo.login_timeout = 15
+
+# To specify the time to wait for logout to complete, edit the line.
+# The value is in seconds and the default is 15 seconds.
+node.conn[0].timeo.logout_timeout = 15
+
+# Time interval to wait for on connection before sending a ping.
+node.conn[0].timeo.noop_out_interval = 5
+
+# To specify the time to wait for a Nop-out response before failing
+# the connection, edit this line. Failing the connection will
+# cause IO to be failed back to the SCSI layer. If using dm-multipath
+# this will cause the IO to be failed to the multipath layer.
+node.conn[0].timeo.noop_out_timeout = 5
+
+# To specify the time to wait for abort response before
+# failing the operation and trying a logical unit reset edit the line.
+# The value is in seconds and the default is 15 seconds.
+node.session.err_timeo.abort_timeout = 15
+
+# To specify the time to wait for a logical unit response
+# before failing the operation and trying session re-establishment
+# edit the line.
+# The value is in seconds and the default is 30 seconds.
+node.session.err_timeo.lu_reset_timeout = 20
+
+#******
+# Retry
+#******
+
+# To specify the number of times iscsid should retry a login
+# if the login attempt fails due to the node.conn[0].timeo.login_timeout
+# expiring modify the following line. Note that if the login fails
+# quickly (before node.conn[0].timeo.login_timeout fires) because the network
+# layer or the target returns an error, iscsid may retry the login more than
+# node.session.initial_login_retry_max times.
+#
+# This retry count along with node.conn[0].timeo.login_timeout
+# determines the maximum amount of time iscsid will try to
+# establish the initial login. node.session.initial_login_retry_max is
+# multiplied by the node.conn[0].timeo.login_timeout to determine the
+# maximum amount.
+#
+# The default node.session.initial_login_retry_max is 8 and
+# node.conn[0].timeo.login_timeout is 15 so we have:
+#
+# node.conn[0].timeo.login_timeout * node.session.initial_login_retry_max =
+#                                                              120 seconds
+#
+# Valid values are any integer value. This only
+# affects the initial login. Setting it to a high value can slow
+# down the iscsi service startup. Setting it to a low value can
+# cause a session to not get logged into, if there are distuptions
+# during startup or if the network is not ready at that time.
+node.session.initial_login_retry_max = 8
+
+################################
+# session and device queue depth
+################################
+
+# To control how many commands the session will queue set
+# node.session.cmds_max to an integer between 2 and 2048 that is also
+# a power of 2. The default is 128.
+node.session.cmds_max = 128
+
+# To control the device's queue depth set node.session.queue_depth
+# to a value between 1 and 128. The default is 32.
+node.session.queue_depth = 32
+
+#***************
+# iSCSI settings
+#***************
+
+# To enable R2T flow control (i.e., the initiator must wait for an R2T
+# command before sending any data), uncomment the following line:
+#
+#node.session.iscsi.InitialR2T = Yes
+#
+# To disable R2T flow control (i.e., the initiator has an implied
+# initial R2T of "FirstBurstLength" at offset 0), uncomment the following line:
+#
+# The defaults is No.
+node.session.iscsi.InitialR2T = No
+
+#
+# To disable immediate data (i.e., the initiator does not send
+# unsolicited data with the iSCSI command PDU), uncomment the following line:
+#
+#node.session.iscsi.ImmediateData = No
+#
+# To enable immediate data (i.e., the initiator sends unsolicited data
+# with the iSCSI command packet), uncomment the following line:
+#
+# The default is Yes
+node.session.iscsi.ImmediateData = Yes
+
+# To specify the maximum number of unsolicited data bytes the initiator
+# can send in an iSCSI PDU to a target, edit the following line.
+#
+# The value is the number of bytes in the range of 512 to (2^24-1) and
+# the default is 262144
+node.session.iscsi.FirstBurstLength = 262144
+
+# To specify the maximum SCSI payload that the initiator will negotiate
+# with the target for, edit the following line.
+#
+# The value is the number of bytes in the range of 512 to (2^24-1) and
+# the defauls it 16776192
+node.session.iscsi.MaxBurstLength = 16776192
+
+# To specify the maximum number of data bytes the initiator can receive
+# in an iSCSI PDU from a target, edit the following line.
+#
+# The value is the number of bytes in the range of 512 to (2^24-1) and
+# the default is 131072
+node.conn[0].iscsi.MaxRecvDataSegmentLength = 131072
+
+
+# To specify the maximum number of data bytes the initiator can receive
+# in an iSCSI PDU from a target during a discovery session, edit the
+# following line.
+#
+# The value is the number of bytes in the range of 512 to (2^24-1) and
+# the default is 32768
+# 
+discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
+
+# To allow the targets to control the setting of the digest checking,
+# with the initiator requesting a preference of enabling the checking, uncomment# one or both of the following lines:
+#node.conn[0].iscsi.HeaderDigest = CRC32C,None
+#node.conn[0].iscsi.DataDigest = CRC32C,None
+#
+# To allow the targets to control the setting of the digest checking,
+# with the initiator requesting a preference of disabling the checking,
+# uncomment one or both of the following lines:
+#node.conn[0].iscsi.HeaderDigest = None,CRC32C
+#node.conn[0].iscsi.DataDigest = None,CRC32C
+#
+# To enable CRC32C digest checking for the header and/or data part of
+# iSCSI PDUs, uncomment one or both of the following lines:
+#node.conn[0].iscsi.HeaderDigest = CRC32C
+#node.conn[0].iscsi.DataDigest = CRC32C
+#
+# To disable digest checking for the header and/or data part of
+# iSCSI PDUs, uncomment one or both of the following lines:
+#node.conn[0].iscsi.HeaderDigest = None
+#node.conn[0].iscsi.DataDigest = None
+#
+# The default is to never use DataDigests or HeaderDigests.
+#
+
+
+#************
+# Workarounds
+#************
+
+# Some targets like IET prefer after an initiator has sent a task
+# management function like an ABORT TASK or LOGICAL UNIT RESET, that
+# it does not respond to PDUs like R2Ts. To enable this behavior uncomment
+# the following line (The default behavior is Yes):
+node.session.iscsi.FastAbort = Yes
+
+# Some targets like Equalogic prefer that after an initiator has sent
+# a task management function like an ABORT TASK or LOGICAL UNIT RESET, that
+# it continue to respond to R2Ts. To enable this uncomment this line
+# node.session.iscsi.FastAbort = No
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsi-iname b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsi-iname
new file mode 100755 (executable)
index 0000000..8afc1ba
Binary files /dev/null and b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsi-iname differ
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsi_discovery b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsi_discovery
new file mode 100755 (executable)
index 0000000..398a6e8
--- /dev/null
@@ -0,0 +1,188 @@
+#!/bin/sh
+#
+# Copyright (C) Voltaire Ltd. 2006.  ALL RIGHTS RESERVED.
+#
+# 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., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Author: Dan Bar Dov <danb@voltaire.com>
+
+# iscsi_discovery:
+#    * does a send-targets discovery to the given IP
+#    * set the transport type to the preferred transport (or tcp is -t flag is not used)
+#    * tries to login
+#    * if succeeds,
+#          o logout,
+#          o mark record autmatic (unless -m flag is used)
+#    * else
+#          o reset transport type to TCP
+#          o try to login
+#          o if succeeded
+#                + logout
+#                + mark record automatic (unless -m flag is used)
+#
+
+usage()
+{
+       echo "Usage: $0 <IP> [-p <port>] [-d] [-t <tcp|iser> [-f]] [-m] [-l]"
+       echo "Options:"
+       echo  "-p               set the port number (defualt is 3260)."
+       echo  "-d               print debugging information"
+       echo  "-t               set trasnpot (default is tcp)."
+       echo  "-f               force specific transport -disable the fallback to tcp (default is fallback enabled)."
+       echo  "                 force the transport specified by the argument of the -t flag."
+       echo  "-m               manual startup - will set manual startup (default is automatic startup)."
+       echo  "-l               login to the new discovered nodes (defualt is false)."
+}
+
+dbg()
+{
+       $debug && echo $@
+}
+
+initialize()
+{
+       trap "exit" 2
+       debug=false
+       force="0"
+       log_out="1"
+       startup_manual="0"
+       #set defualt transport to tcp
+       transport=tcp
+       #set defualt port to 3260
+       port=3260;
+}
+
+parse_cmdline()
+{
+       if [ $# -lt 1 ]; then
+               usage
+               exit 1
+       fi
+
+       # check if the IP address is valid
+       ip=`echo $1 | awk -F'.' '$1 != "" && $1 <=255 && $2 != "" && $2 <= 255 && $3 != "" && $3 <= 255 && $4 != "" && $4 <= 255 {print $0}'`
+       if [ -z "$ip" ]; then
+               echo "$1 is not a vaild IP address!"
+               exit 1
+       fi
+       shift
+       while getopts "dfmlt:p:" options; do
+        case $options in
+               d ) debug=true;;
+               f ) force="1";;
+               t ) transport=$OPTARG;;
+               p ) port=$OPTARG;;
+               m ) startup_manual="1";;
+               l ) log_out=0;;
+               \? ) usage
+                       exit 1;;
+               * )  usage
+                       exit 1;;
+        esac
+       done
+}
+
+discover()
+{
+       # If open-iscsi is already logged in to the portal, exit
+       if [ $(iscsiadm -m session | grep -c ${ip}:${port}) -ne 0 ]; then
+               echo "Please logout from all targets on ${ip}:${port} before trying to run discovery on that portal"
+               exit 2
+       fi
+
+       connected=0
+       discovered=0
+       df=/tmp/discovered.$$
+
+       dbg "starting discovery to $ip"
+       iscsiadm -m discovery --type sendtargets --portal ${ip}:${port} > ${df}
+       while read portal target
+       do
+               portal=${portal%,*}
+               select_transport
+       done < ${df}
+
+       discovered=$(cat ${df} | wc -l)
+       if [ ${discovered} = 0 ]; then
+               echo "failed to discover targets at ${ip}"
+               exit 2
+       else
+               echo "discovered ${discovered} targets at ${ip}"
+       fi
+       /bin/rm -f ${df}
+}
+
+try_login()
+{
+       if [ "$startup_manual" != "1" ]; then
+               iscsiadm -m node --targetname ${target} --portal ${portal} --op update -n node.conn[0].startup -v automatic
+       fi
+       iscsiadm -m node --targetname ${target} --portal ${portal} --login >/dev/null 2>&1
+       ret=$?
+       if [ ${ret} = 0 ]; then
+               echo "Set target ${target} to automatic login over ${transport} to portal ${portal}"
+               connected=$(($connected + 1))
+               if [ "$log_out" = "1" ]; then
+                       iscsiadm -m node --targetname ${target} --portal ${portal} --logout
+               fi
+       else
+               echo "Cannot login over ${transport} to portal ${portal}"
+               iscsiadm -m node --targetname ${target} --portal ${portal} --op update -n node.conn[0].startup -v manual
+       fi
+       return ${ret}
+}
+
+set_transport()
+{
+       transport=$1
+       if [ "$transport" == "iser" ];then
+               iscsiadm -m node --targetname ${target} --portal ${portal} \
+                               --op update -n node.conn[0].iscsi.HeaderDigest -v None
+               iscsiadm -m node --targetname ${target} --portal ${portal} \
+                               --op update -n node.conn[0].iscsi.DataDigest -v None
+       fi
+       transport_name=`iscsiadm  -m node -p ${portal} -T ${target} |awk '/transport_name/ {print $1}'`
+       iscsiadm -m node --targetname ${target} --portal ${portal} \
+                       --op update -n ${transport_name} -v ${transport}
+}
+
+select_transport()
+{
+       set_transport $transport
+       dbg "Testing $transport-login to target ${target} portal ${portal}"
+       try_login;
+       if [ $? != 0 -a  "$force" = "0" ]; then
+               set_transport tcp
+               dbg "starting to test tcp-login to target ${target} portal ${portal}"
+               try_login;
+       fi
+}
+
+check_iscsid()
+{
+       #check if iscsid is running
+       pidof iscsid &>/dev/null
+       ret=$?
+       if [ $ret -ne 0 ]; then
+               echo "iscsid is not running"
+               echo "Exiting..."
+               exit 1
+       fi
+}
+
+check_iscsid
+initialize
+parse_cmdline "$@"
+discover
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsiadm b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsiadm
new file mode 100755 (executable)
index 0000000..ddca8b0
Binary files /dev/null and b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsiadm differ
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsid b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsid
new file mode 100755 (executable)
index 0000000..40c3194
Binary files /dev/null and b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsid differ
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsistart b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsistart
new file mode 100755 (executable)
index 0000000..0371157
Binary files /dev/null and b/pxeknife/debian/debian-live-501-i386/iscsi/tools/iscsistart differ
diff --git a/pxeknife/debian/debian-live-501-i386/iscsi/tools/isosize b/pxeknife/debian/debian-live-501-i386/iscsi/tools/isosize
new file mode 100755 (executable)
index 0000000..ae09dcc
Binary files /dev/null and b/pxeknife/debian/debian-live-501-i386/iscsi/tools/isosize differ
index 564e655..e56a696 100755 (executable)
@@ -781,8 +781,17 @@ do_httpmount ()
                        httpfs "${url}" "${rootmnt}/iso" 
                FILEPATH=`ls "${rootmnt}"/iso/*.iso`
                echo  "File path is $FILEPATH" 
-#              losetup "${rootmnt}/dev/loop0" $FILEPATH
+               losetup "${rootmnt}/dev/loop0" $FILEPATH
                mount -t iso9660 $FILEPATH "${mountpoint}" -o loop -o ro
+            
+            modprobe iscsi_tcp
+            modprobe ib_iser
+            mkdir /var/run
+#            mkdir /etc/iscsi/nodes
+#            /sbin/iscsid
+#            iscsiadm -m discovery -t st -p 192.168.0.1
+            
+
             return 0
         else
             echo "not BKO http mount, proceding in normal way"
index d50cec2..e163a35 100755 (executable)
@@ -29,7 +29,7 @@ label debian-live-501-local
         Uses web-server on localhost
     ENDTEXT
        kernel pxeknife/debian/debian-live-501-i386/vmlinuz1
-       append  netboot=http boot=live union=aufs httpfs=http://192.168.0.1/filesystem.squashfs  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
+       append  netboot=http boot=live union=aufs httpfs=http://192.168.111.11/filesystem.squashfs  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
     IPAPPEND 3
 
 label debian-live-501-rom-iso
@@ -50,6 +50,6 @@ label debian-live-501-local
         Dont select it
     ENDTEXT
        kernel pxeknife/debian/debian-live-501-i386/vmlinuz1
-       append netboot=http boot=live union=aufs httpfs=http://192.168.0.1/debian-live-501-i386-gnome-desktop.iso  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
+       append netboot=http boot=live union=aufs httpfs=http://192.168.111.11/debian-live-501-i386-gnome-desktop.iso  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
     IPAPPEND 3
 
index 7d9b1a4..75e3df6 100755 (executable)
@@ -13,14 +13,17 @@ mkdir mpoint
 
 echo "extracting filesystem filesystem"
 cd mpoint 
-cpio -ivu --no-absolute-filename  < ../initrd0
+cpio -ivu --no-absolute-filename  < ../initrd0 2> /dev/null
+
 cd ..
 
 echo "copying the needed tools..."
 
 
 cp mount_http_iso.sh mpoint/bin/
+cp mount_nfs_iso.sh mpoint/bin/
 chmod 777 mpoint/bin/mount_http_iso.sh
+chmod 777 mpoint/bin/mount_nfs_iso.sh
 
 cp httpfs/server/httpfs mpoint/bin/
 chmod 777 mpoint/bin/httpfs
@@ -28,6 +31,8 @@ chmod 777 mpoint/bin/httpfs
 cp httpfs/server/fusermount mpoint/bin/
 chmod 777 mpoint/bin/fusermount
 
+cp mount.nfs mpoint/sbin/
+
 cp busybox mpoint/bin/
 chmod 777 mpoint/bin/busybox
 
diff --git a/pxeknife/red_hat/fedora_11_live_cd/modules/auth_rpcgss.ko b/pxeknife/red_hat/fedora_11_live_cd/modules/auth_rpcgss.ko
new file mode 100755 (executable)
index 0000000..dee6730
Binary files /dev/null and b/pxeknife/red_hat/fedora_11_live_cd/modules/auth_rpcgss.ko differ
diff --git a/pxeknife/red_hat/fedora_11_live_cd/modules/lockd.ko b/pxeknife/red_hat/fedora_11_live_cd/modules/lockd.ko
new file mode 100755 (executable)
index 0000000..92cbba1
Binary files /dev/null and b/pxeknife/red_hat/fedora_11_live_cd/modules/lockd.ko differ
diff --git a/pxeknife/red_hat/fedora_11_live_cd/modules/nfs.ko b/pxeknife/red_hat/fedora_11_live_cd/modules/nfs.ko
new file mode 100755 (executable)
index 0000000..61e0ca8
Binary files /dev/null and b/pxeknife/red_hat/fedora_11_live_cd/modules/nfs.ko differ
diff --git a/pxeknife/red_hat/fedora_11_live_cd/modules/nfs_acl.ko b/pxeknife/red_hat/fedora_11_live_cd/modules/nfs_acl.ko
new file mode 100755 (executable)
index 0000000..8bed455
Binary files /dev/null and b/pxeknife/red_hat/fedora_11_live_cd/modules/nfs_acl.ko differ
diff --git a/pxeknife/red_hat/fedora_11_live_cd/modules/sunrpc.ko b/pxeknife/red_hat/fedora_11_live_cd/modules/sunrpc.ko
new file mode 100755 (executable)
index 0000000..bd6481d
Binary files /dev/null and b/pxeknife/red_hat/fedora_11_live_cd/modules/sunrpc.ko differ
diff --git a/pxeknife/red_hat/fedora_11_live_cd/mount.nfs b/pxeknife/red_hat/fedora_11_live_cd/mount.nfs
new file mode 100755 (executable)
index 0000000..9eeea96
Binary files /dev/null and b/pxeknife/red_hat/fedora_11_live_cd/mount.nfs differ
index 0c0b7b8..d53ef01 100755 (executable)
@@ -39,14 +39,20 @@ route add default gw $mygw 2> /outputroute
 
 ISO_PATH=$2
 echo "The location of fedora.iso is $ISO_PATH"
+echo "The location of fedora.iso is $ISO_PATH\n" >> /output
+echo "" >> /output
 echo "mounting CDROM"
 mkdir /iso
-httpfs $ISO_PATH /iso
+echo "httpfs $ISO_PATH /iso"
+mknod /dev/fuse c 10 229
+httpfs "$ISO_PATH" /iso
+    
 FILEPATH=`ls /iso/*.iso`
 mount -t iso9660 $FILEPATH /sysroot -o loop -o ro
+echo "FILEPATH is $FILEPATH and URL is $ISO_PATH"
 
 
-# test if knoppix is there
+# test if fedora is there
 if test -f /sysroot/LiveOS/squashfs.img
 then
     echo -n "successfully mounted the Image"
diff --git a/pxeknife/red_hat/fedora_11_live_cd/mount_nfs_iso.sh b/pxeknife/red_hat/fedora_11_live_cd/mount_nfs_iso.sh
new file mode 100755 (executable)
index 0000000..4647d04
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# objectives: 
+# Enable networking.
+# Setup networking.
+# Find the location from which we need to get the ISO.
+# Mount the ISO.
+
+echo "HTTP Boot: inserting network modules"
+insmod /modules/8390.ko >/dev/null 2>&1  
+insmod /modules/mii.ko >/dev/null 2>&1 
+insmod /modules/ne2k-pci.ko >/dev/null 2>&1 
+insmod /modules/pcnet32.ko >/dev/null 2>&1 
+insmod /modules/r8169.ko >/dev/null 2>&1 
+insmod /modules/e100.ko >/dev/null 2>&1 
+insmod /modules/e1000.ko >/dev/null 2>&1 
+insmod /modules/sis900.ko >/dev/null 2>&1 
+insmod /modules/via-rhine.ko >/dev/null 2>&1 
+insmod /modules/8139too.ko >/dev/null 2>&1 
+insmod /modules/fuse.ko >/dev/null 2>&1 
+
+ifconfig lo 127.0.0.1 up
+ifconfig eth0 up
+tempIP=$1
+
+
+myip=`echo $tempIP | cut -d: -f1`
+echo "Using ip address $myip"
+mynm=`echo $tempIP | cut -d: -f4`
+echo "Using Netmask $mynm"
+mygw=`echo $tempIP | cut -d: -f3`
+echo "Using gateway ip $mygw"
+ifconfig eth0 $myip netmask $mynm 2> /output
+echo "verify the ip address"
+ifconfig eth0
+
+insmod /modules/sunrpc.ko
+insmod /modules/lockd.ko
+insmod /modules/auth_rpcgss.ko
+insmod /modules/nfs_acl.ko
+insmod /modules/nfs.ko
+
+echo "setting route"
+route add default gw $mygw 2> /outputroute
+
+NFS_PATH=$2
+echo "The NFS mount location is $NFS_PATH"
+echo "mounting NFS"
+mkdir /iso
+echo "nfs mounting $NFS_PATH /iso"
+mount "$NFS_PATH" /iso -o nolock
+    
+FILEPATH="/iso/Fedora-11-i686-Live.iso"
+mount -t iso9660 $FILEPATH /sysroot -o loop -o ro
+echo "FILEPATH is $FILEPATH and URL is $ISO_PATH"
+
+
+# test if fedora is there
+if test -f /sysroot/LiveOS/squashfs.img
+then
+    echo -n "successfully mounted the Image"
+    exit 0
+fi
+exit 1
index 63926b7..15e0a59 100755 (executable)
@@ -87,6 +87,9 @@ for o in `cat /proc/cmdline` ; do
     ip=*)
         given_ip=${o#ip=}
         ;;
+    nfs=*)
+        NFS=${o#nfs=}
+        ;;
     httpfs=*)
         HTTPFS=${o#httpfs=}
         ;;
@@ -356,11 +359,20 @@ else
 fi
 
 if [ -z ${HTTPFS} ] ; then
-    echo " no httpfs provided, booting normal filesystem"
-    mount -n -t $rootfstype $mountoptions $thingtomount /sysroot
-    RES=$?
+    if [ -z ${NFS} ] ; then
+        echo " no httpfs and nfs provided, booting normal filesystem"
+        mount -n -t $rootfstype $mountoptions $thingtomount /sysroot
+        RES=$?
+    else
+        echo " mounting httpfs filesystem from ${HTTPFS}"
+        mount_nfs_iso.sh ${given_ip} ${NFS}
+        RES=$?
+
+    fi
 else
     echo " mounting httpfs filesystem from ${HTTPFS}"
+    echo " mounting httpfs filesystem from ${HTTPFS}" > /output
+    echo "\n" > /output
     mount_http_iso.sh ${given_ip} ${HTTPFS}
     RES=$?
 fi
diff --git a/pxeknife/red_hat/fedora_11_live_cd/run-init b/pxeknife/red_hat/fedora_11_live_cd/run-init
new file mode 100755 (executable)
index 0000000..e42fd3f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/sbin/nash
+setquiet
+echo "Doing setuproot"
+setuproot
+echo "Loading policy"
+loadpolicy
+echo "Switching to new root..."
+plymouth --newroot=/sysroot
+switchroot
index 29271de..cb64a3e 100755 (executable)
@@ -12,6 +12,7 @@ LABEL rootmenu
 
 
 label fedora_11_live_cd_rom
+    MENU DEFAULT
        MENU LABEL Fedora 11 Live CD - from rom (US Mirror)
     TEXT HELP
         currently work only in single user mode
@@ -29,6 +30,16 @@ label fedora_11_live_cd_local
         Uses web-server on localhost
     ENDTEXT
        kernel pxeknife/red_hat/fedora_11_live_cd/vmlinuz0
-       append root=CDLABEL=Fedora-11-i686-Live httpfs=http://192.168.0.1/Fedora-11-i686-Live.iso initrd=pxeknife/red_hat/fedora_11_live_cd/initrd0.img  rootfstype=auto ro liveimg rhgb selinux=0 single 
+       append root=CDLABEL=Fedora-11-i686-Live httpfs=http://192.168.111.11/Fedora-11-i686-Live.iso initrd=pxeknife/red_hat/fedora_11_live_cd/initrd0.img  rootfstype=auto ro liveimg rhgb selinux=0 single 
+    IPAPPEND 3
+
+label fedora_11_live_cd_nfs
+       MENU LABEL Fedora 11 Live CD - (nfs)
+    TEXT HELP
+           Used for testing only
+        Uses nfs server on localhost
+    ENDTEXT
+       kernel pxeknife/red_hat/fedora_11_live_cd/vmlinuz0
+       append root=CDLABEL=Fedora-11-i686-Live nfs=192.168.111.11:/var/www/ initrd=pxeknife/red_hat/fedora_11_live_cd/initrd0.img  rootfstype=auto ro liveimg rhgb selinux=0 3  
     IPAPPEND 3
 
index 993c57d..da1e0e8 100755 (executable)
@@ -7,16 +7,18 @@ rm -rf initrd.gz initrd mpoint
 # create a copy of image to modify
 cp initrd.gz_orig initrd.gz
 gunzip initrd.gz
-mkdir mpoint
 
 echo "extracting filesystem filesystem"
 mkdir mpoint
 cd mpoint 
-cpio -ivu --no-absolute-filename  < ../initrd
+cpio -ivu --no-absolute-filename  < ../initrd 2> /dev/null
 cd ..
 
 echo "coping the needed files..."
 
+#rm mpoint/lib/modules/2.6.28-11-generic/kernel/ubuntu/squashfs/squashfs.ko
+#cp squashfs.ko mpoint/lib/modules/2.6.28-11-generic/kernel/ubuntu/squashfs/
+
 cp run-init mpoint/bin/
 chmod 777 mpoint/bin/run-init
 
index 623f89d..5ffce41 100755 (executable)
@@ -30,7 +30,7 @@ label ubuntu904desktopi386-laptop
         Dont select it
     ENDTEXT
        kernel pxeknife/ubuntu/ubuntu-9.04-desktop-i386/vmlinuz
-       append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://192.168.0.1/ubuntu-9.04-desktop-i386.iso  initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrd.gz init=/bin/sh
+       append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://192.168.111.11/ubuntu-9.04-desktop-i386.iso  initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrd.gz init=/bin/sh
     IPAPPEND 3
 
 label ubuntu904desktopi386-rom-squash
@@ -40,7 +40,7 @@ label ubuntu904desktopi386-rom-squash
         Good option of American subcontinent
     ENDTEXT
        kernel pxeknife/ubuntu/ubuntu-9.04-desktop-i386/vmlinuz
-       append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://192.168.0.1/U/filesystem.squashfs  initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrd.gz 
+       append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://140.211.167.171/share/pravin/U/filesystem.squashfs initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrd.gz
     IPAPPEND 3
 
 label ubuntu904desktopi386-laptop-squash
@@ -50,6 +50,6 @@ label ubuntu904desktopi386-laptop-squash
         Dont select it
     ENDTEXT
        kernel pxeknife/ubuntu/ubuntu-9.04-desktop-i386/vmlinuz
-       append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://192.168.0.1/U/filesystem.squashfs  initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrdv2.gz rdinit=/bin/sh
+       append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://192.168.111.11/U/filesystem.squashfs  initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrd.gz
     IPAPPEND 3