now using the IPAPPEND option and dhcp use from initrd is removed
authorPravin Shinde <pravin@black-perl.(none)>
Tue, 7 Jul 2009 20:59:37 +0000 (22:59 +0200)
committerPravin Shinde <pravin@black-perl.(none)>
Tue, 7 Jul 2009 20:59:37 +0000 (22:59 +0200)
Now, this should work with both static and dynamic IP addresses.

13 files changed:
pxeknife/dsl/dsl.conf
pxeknife/dsl/generate_minirt24.sh
pxeknife/dsl/mount_http_iso.sh
pxeknife/knoppix/5.0.1/generate_minirt.sh
pxeknife/knoppix/5.0.1/mount_http_iso.sh
pxeknife/knoppix/knoppix.conf
pxeknife/red_hat/fedora_11_live_cd/generate_initrd.sh
pxeknife/red_hat/fedora_11_live_cd/mount_http_iso.sh
pxeknife/red_hat/fedora_11_live_cd/real-init
pxeknife/red_hat/red_hat.conf
pxeknife/ubuntu/ubuntu-9.04-desktop-i386/casper
pxeknife/ubuntu/ubuntu-9.04-desktop-i386/generate_initrd.sh
pxeknife/ubuntu/ubuntu.conf

index fb092d9..2ec3889 100644 (file)
@@ -11,6 +11,7 @@ LABEL dsl-http-rom
        # for rom.etherboot.org
        KERNEL pxeknife/dsl/linux24 httpfs=http://140.211.167.171/share/pravin/dsl.iso
        APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=pxeknife/dsl/minirt24.gz nomce noapic quiet BOOT_IMAGE=knoppix
+    IPAPPEND 3
 
 
 LABEL dsl-http-alien
@@ -18,4 +19,11 @@ LABEL dsl-http-alien
        # for alien
        KERNEL pxeknife/dsl/linux24 httpfs=http://145.116.233.189/dsl.iso
        APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=pxeknife/dsl/minirt24.gz nomce noapic quiet BOOT_IMAGE=knoppix
+    IPAPPEND 3
+
+LABEL dsl-http-localhost
+       MENU LABEL DSL (local webserver)
+       KERNEL pxeknife/dsl/linux24 httpfs=http://192.168.0.1/dsl.iso
+       APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=pxeknife/dsl/minirt24.gz nomce noapic quiet BOOT_IMAGE=knoppix
+    IPAPPEND 3
 
index 25141db..7def832 100755 (executable)
@@ -14,8 +14,8 @@ mount minirt24 -o loop mpoint/
 
 echo "coping the needed files..."
 cp modules/* mpoint/modules/
-cp httpfs/static/udhcpc mpoint/static/
-cp httpfs/static/udhcpc.sh mpoint/static/
+#cp httpfs/static/udhcpc mpoint/static/
+#cp httpfs/static/udhcpc.sh mpoint/static/
 cp busybox mpoint/static/
 
 cp httpfs/server/httpfs mpoint/static/
@@ -48,6 +48,7 @@ ln -s busybox dmesg
 ln -s busybox dd 
 ln -s busybox mount
 ln -s busybox umount
+ln -s busybox cut 
 
 
 
index d124c4e..dd96100 100755 (executable)
@@ -23,7 +23,20 @@ insmod /modules/loop.o >/dev/null 2>&1
 
 ifconfig lo 127.0.0.1 up
 ifconfig eth0 up
-udhcpc -s /static/udhcpc.sh  >/dev/null 2>&1 
+myip=`echo $ip | cut -d: -f1`
+echo "Using ip address $myip"
+mynm=`echo $ip | cut -d: -f4`
+echo "Using Netmask $mynm"
+mygw=`echo $ip | cut -d: -f3`
+echo "Using gateway ip $mygw"
+ifconfig eth0 $myip netmask $mynm 2> /output
+echo "verify the ip address"
+ifconfig eth0
+
+echo "setting route"
+route add default gw $mygw 2> /outputroute
+
+#udhcpc -s /static/udhcpc.sh  >/dev/null 2>&1 
 insmod /modules/fuse.o >/dev/null 2>&1 
 
 ISO_PATH=$1
index 243edc2..818975f 100755 (executable)
@@ -16,8 +16,6 @@ mount minirt -o loop mpoint/
 
 echo "coping the needed files..."
 cp modules/* mpoint/modules/
-cp httpfs/static/udhcpc mpoint/static/
-cp httpfs/static/udhcpc.sh mpoint/static/
 cp busybox mpoint/static/
 
 cp httpfs/server/httpfs mpoint/static/
@@ -50,6 +48,7 @@ ln -s busybox dmesg
 ln -s busybox dd 
 ln -s busybox mount
 ln -s busybox umount
+ln -s busybox cut 
 
 cd ..
 cd ..
index 6bf0b61..01af1aa 100755 (executable)
@@ -23,7 +23,19 @@ insmod /modules/loop.ko >/dev/null 2>&1
 
 ifconfig lo 127.0.0.1 up
 ifconfig eth0 up
-udhcpc -s /static/udhcpc.sh  >/dev/null 2>&1 
+myip=`echo $ip | cut -d: -f1`
+echo "Using ip address $myip"
+mynm=`echo $ip | cut -d: -f4`
+echo "Using Netmask $mynm"
+mygw=`echo $ip | cut -d: -f3`
+echo "Using gateway ip $mygw"
+ifconfig eth0 $myip netmask $mynm 2> /output
+echo "verify the ip address"
+ifconfig eth0
+
+echo "setting route"
+route add default gw $mygw 2> /outputroute
+
 
 ISO_PATH=$1
 echo "The location of dsl.iso is $ISO_PATH"
index 976e690..e7d0f46 100755 (executable)
@@ -8,9 +8,17 @@ label knoppix502-rom
        MENU LABEL Knoppix 5.0.1 - from rom (US Mirror)
        kernel pxeknife/knoppix/5.0.1/linux httpfs=http://140.211.167.171/share/pravin/KNOPPIX_V5.1.1CD-2007-01-04-EN.iso
        append nodhcp lang=us ramdisk_size=100000 init=/etc/init apm=power-off nomce vga=791 initrd=pxeknife/knoppix/5.0.1/minirt.gz quiet BOOT_IMAGE=knoppix
+    IPAPPEND 3
 
 label knoppix502-alien
        MENU LABEL Knoppix 5.0.1 - from alien  (Europe Mirror)
        kernel pxeknife/knoppix/5.0.1/linux httpfs=http://145.116.233.189/KNOPPIX_V5.1.1CD-2007-01-04-EN.iso
        append nodhcp lang=us ramdisk_size=100000 init=/etc/init apm=power-off nomce vga=791 initrd=pxeknife/knoppix/5.0.1/minirt.gz quiet BOOT_IMAGE=knoppix
+    IPAPPEND 3
+
+label knoppix502-local
+       MENU LABEL Knoppix 5.0.1 - local webserver
+       kernel pxeknife/knoppix/5.0.1/linux httpfs=http://192.168.0.1/KNOPPIX_V5.1.1CD-2007-01-04-EN.iso
+       append nodhcp lang=us ramdisk_size=100000 init=/etc/init apm=power-off nomce vga=791 initrd=pxeknife/knoppix/5.0.1/minirt.gz quiet BOOT_IMAGE=knoppix
+    IPAPPEND 3
 
index 1527dc2..4e07287 100755 (executable)
@@ -18,11 +18,6 @@ cd ..
 
 echo "coping the needed tools..."
 
-cp httpfs/static/udhcpc mpoint/bin/
-chmod 777 mpoint/bin/udhcpc
-
-cp httpfs/static/udhcpc.sh mpoint/bin/
-chmod 777 mpoint/bin/udhcpc.sh
 
 cp mount_http_iso.sh mpoint/bin/
 chmod 777 mpoint/bin/mount_http_iso.sh
index c4201e9..0c0b7b8 100755 (executable)
@@ -21,9 +21,23 @@ insmod /modules/fuse.ko >/dev/null 2>&1
 
 ifconfig lo 127.0.0.1 up
 ifconfig eth0 up
-udhcpc -s /bin/udhcpc.sh  >/dev/null 2>&1 
+tempIP=$1
 
-ISO_PATH=$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
+
+echo "setting route"
+route add default gw $mygw 2> /outputroute
+
+ISO_PATH=$2
 echo "The location of fedora.iso is $ISO_PATH"
 echo "mounting CDROM"
 mkdir /iso
index 64fd143..37237c1 100755 (executable)
@@ -36,6 +36,7 @@ live_locale=""
 live_dir="LiveOS"
 overlay="off"
 HTTPFS=""
+given_ip=""
 
 # Parse kernel commandline options
 #
@@ -83,6 +84,9 @@ for o in `cat /proc/cmdline` ; do
     check)
         check_iso=1
         ;;
+    ip=*)
+        given_ip=${o#ip=}
+        ;;
     httpfs=*)
         HTTPFS=${o#httpfs=}
         ;;
@@ -357,7 +361,7 @@ if [ -z ${HTTPFS} ] ; then
     RES=$?
 else
     echo " mounting httpfs filesystem from ${HTTPFS}"
-    mount_http_iso.sh ${HTTPFS}
+    mount_http_iso.sh ${given_ip} ${HTTPFS}
     RES=$?
 fi
 
index 23aa701..5076ace 100755 (executable)
@@ -9,14 +9,17 @@ label fedora_11_live_cd_rom
        MENU LABEL Fedora 11 Live CD - from rom (US Mirror)
        kernel pxeknife/red_hat/fedora_11_live_cd/vmlinuz0
        append root=CDLABEL=Fedora-11-i686-Live httpfs=http://140.211.167.171/share/pravin/Fedora-11-i686-Live.iso initrd=pxeknife/red_hat/fedora_11_live_cd/initrd0.img  rootfstype=auto ro liveimg rhgb 
+    IPAPPEND 3
 
 label fedora_11_live_cd_alien
        MENU LABEL Fedora 11 Live CD - from alien (Europe Mirror)
        kernel pxeknife/red_hat/fedora_11_live_cd/vmlinuz0
        append root=CDLABEL=Fedora-11-i686-Live httpfs=http://145.116.233.189/Fedora-11-i686-Live.iso initrd=pxeknife/red_hat/fedora_11_live_cd/initrd0.img  rootfstype=auto ro liveimg rhgb 
+    IPAPPEND 3
 
 label fedora_11_live_cd_local
        MENU LABEL Fedora 11 Live CD - (Testing)
        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 single
+       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 
+    IPAPPEND 3
 
index 9158392..19abb07 100644 (file)
@@ -225,7 +225,6 @@ do_httpfsmount() {
     rc=1
 
     echo "HTTP Boot: inserting network modules" >> /status
-#    insmod /modules/crc32c.ko >/dev/null 2>&1  
     insmod /lib/modules/2.6.28-11-generic/kernel/drivers/net/8390.ko  
     insmod /lib/modules/2.6.28-11-generic/kernel/drivers/net/mii.ko   
     insmod /lib/modules/2.6.28-11-generic/kernel/drivers/net/ne2k-pci.ko 
@@ -236,21 +235,31 @@ do_httpfsmount() {
     insmod /lib/modules/2.6.28-11-generic/kernel/drivers/net/sis900.ko 
     insmod /lib/modules/2.6.28-11-generic/kernel/drivers/net/via-rhine.ko 
     insmod /lib/modules/2.6.28-11-generic/kernel/drivers/net/8139too.ko   
-#    insmod /modules/af_packet.ko  
-#    insmod /modules/loop.ko >/dev/null 2>&1 
 
        ifconfig lo 127.0.0.1 up
        ifconfig eth0 up
-       udhcpc -s /bin/udhcpc.sh  >/dev/null 2>&1 
+    echo "The ip configuration is $ip"
+    myip=`echo $ip | cut -d: -f1`
+    echo "Using ip address $myip"
+    mynm=`echo $ip | cut -d: -f4`
+    echo "Using Netmask $mynm"
+    mygw=`echo $ip | cut -d: -f3`
+    echo "Using gateway ip $mygw"
+    ifconfig eth0 $myip netmask $mynm 2> /output
+    echo "verify the ip address"
+    ifconfig eth0
+
+    echo "setting route"
+    route add default gw $mygw 2> /outputroute
+
+
        echo  "passed on path is ${HTTPFS}" >> status
        ISO_PATH="${HTTPFS}"
-#      ISO_PATH="http://192.168.0.1/ubuntu-9.04-desktop-i386.iso"
        echo "The location of ubuntu iso  is $ISO_PATH" >> status
        echo "mounting CDROM" >> status
        mkdir /iso
        httpfs $ISO_PATH /iso
        FILEPATH=`ls /iso/*.iso`
-#      FILEPATH="/iso/ubuntu-9.04-desktop-i386.iso"
        echo  "File path is $FILEPATH" >> status
        losetup -r /dev/loop0 $FILEPATH
        busybox mount -t iso9660 $FILEPATH "${mountpoint}" -o loop -o ro
index c5567dd..5ac5e08 100755 (executable)
@@ -17,12 +17,6 @@ cd ..
 
 echo "coping the needed files..."
 
-cp httpfs/static/udhcpc mpoint/bin/
-chmod 777 mpoint/bin/udhcpc
-
-cp httpfs/static/udhcpc.sh mpoint/bin/
-chmod 777 mpoint/bin/udhcpc.sh
-
 
 cp httpfs/server/httpfs mpoint/bin/
 chmod 777 mpoint/bin/httpfs
index 9e8d897..c9d8168 100755 (executable)
@@ -9,14 +9,17 @@ label ubuntu904desktopi386-noppix502-rom
        MENU LABEL Ubuntu 9.04 Desktop i386 - from rom (for US)
        kernel pxeknife/ubuntu/ubuntu-9.04-desktop-i386/vmlinuz
        append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://140.211.167.171/share/pravin/ubuntu-9.04-desktop-i386.iso  initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrd.gz
+    IPAPPEND 3
 
 label ubuntu904desktopi386-alien
        MENU LABEL Ubuntu 9.04 Desktop i386 - from alien  (for Europe)
        kernel pxeknife/ubuntu/ubuntu-9.04-desktop-i386/vmlinuz
        append  file=/cdrom/preseed/ubuntu.seed netboot=http boot=casper httpfs=http://145.116.233.189/ubuntu-9.04-desktop-i386.iso  initrd=pxeknife/ubuntu/ubuntu-9.04-desktop-i386/initrd.gz
+    IPAPPEND 3
 
 label ubuntu904desktopi386-laptop
        MENU LABEL Ubuntu 9.04 Desktop i386 - laptop (local webserver)
        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
+    IPAPPEND 3