Debian is working fine for image.squashfs mounts
authorPravin Shinde <pravin@black-perl.(none)>
Thu, 9 Jul 2009 23:12:40 +0000 (01:12 +0200)
committerPravin Shinde <pravin@black-perl.(none)>
Thu, 9 Jul 2009 23:12:40 +0000 (01:12 +0200)
but for iso mounts, some cleanup is failing and hance, it is panicing

pxeknife/debian/debian-live-501-i386/generate_initrd.sh
pxeknife/debian/debian-live-501-i386/live
pxeknife/debian/debian-live-501-i386/modules/loop.ko [new file with mode: 0644]
pxeknife/debian/debian.conf

index bff3e1d..9018b08 100755 (executable)
@@ -29,6 +29,8 @@ chmod 0777 mpoint/init
 cp live mpoint/scripts/
 chmod 0777 mpoint/scripts/live
 
+mkdir mpoint/modules
+cp modules/* mpoint/modules/
 
 cd mpoint
 echo "creating initrd from new system filesystem"
index 095cc31..c0bf1c5 100755 (executable)
@@ -84,6 +84,7 @@ Arguments ()
                        httpfs=*)
                                HTTPFS="${ARGUMENT#httpfs=}"
                                export HTTPFS
+                echo "found argument httpfs here ${HTTPFS}"
                                ;;
 
                        hostname=*)
@@ -726,12 +727,15 @@ do_netmount ()
                NFSROOT=${ROOTSERVER}:${ROOTPATH}
        fi
     
-    echo "I am here 729"
+    echo "I am here 729 and httpfs is --- ${HTTPFS} ---"
+
        if ( [ -n "${FETCH}" ] || [ -n "${HTTPFS}" ] || [ -n "${FTPFS}" ] ) && do_httpmount
        then
+        echo "do_httpmount successful"
                rc=0
                return ${rc}
        fi
+    echo "do_httpmount failed..."
 
        if [ "${NFSROOT#*:}" = "${NFSROOT}" ] && [ "$NETBOOT" != "cifs" ]
        then
@@ -761,11 +765,31 @@ do_httpmount ()
        mount -t ramfs ram "${mountpoint}"
        mkdir -p "${dest}"
 
+    echo "inside httpmount"
        for webfile in HTTPFS FTPFS FETCH
        do
                url="$(eval echo \"\$\{${webfile}\}\")"
                extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
 
+        if [ "${extension}" = "iso" ] 
+        then
+            echo "Mounting iso"
+                       modprobe fuse
+            modprobe /modules/loop.ko
+            mknod /dev/loop0 b 7 0
+            mkdir /dev/iso
+            echo "trying httpfs with ${url} and ${mountpoint}"
+                       httpfs "${url}" /dev/iso 
+               FILEPATH=`ls /dev/iso/*.iso`
+               echo  "File path is $FILEPATH" 
+               losetup /dev/loop0 $FILEPATH
+               mount -t iso9660 $FILEPATH "${mountpoint}" -o loop -o ro
+            return 0
+        else
+            echo "not BKO http mount, proceding in normal way"
+        fi
+
+        echo "webfile is $webfile and url is $url" 
                if [ -n "$url" ]
                then
                        case "${extension}" in
@@ -794,6 +818,7 @@ do_httpmount ()
                                                        FUSE_MOUNT="httpfs"
                                                fi
                                                modprobe fuse
+                        echo "trying $$FUSE_MOUNT with ${url} and ${dest}"
                                                $FUSE_MOUNT "${url}" "${dest}"
                                        fi
                                        [ ${?} -eq 0 ] && rc=0
@@ -801,6 +826,16 @@ do_httpmount ()
                                        break
                                        ;;
 
+                               iso|ISO|Iso)
+                    echo "Mounting iso"
+                                       FUSE_MOUNT="httpfs"
+                                       modprobe fuse
+                    echo "trying $$FUSE_MOUNT with ${url} and ${dest}"
+                                       $FUSE_MOUNT "${url}" "${dest}"
+                    rc=${?}
+
+                  break 
+                  ;;
                                *)
                                        log_begin_msg "Unrecognized archive extension for ${url}"
                                        ;;
diff --git a/pxeknife/debian/debian-live-501-i386/modules/loop.ko b/pxeknife/debian/debian-live-501-i386/modules/loop.ko
new file mode 100644 (file)
index 0000000..5555391
Binary files /dev/null and b/pxeknife/debian/debian-live-501-i386/modules/loop.ko differ
index 6a54b35..b644d10 100755 (executable)
@@ -8,18 +8,36 @@ LABEL rootmenu
 label debian-live-501-rom
        MENU LABEL Debian live 501 i386 - from rom (for US)
        kernel pxeknife/debian/debian-live-501-i386/vmlinuz1
-       append  netboot=http boot=live union=aufs httpfs=http://140.211.167.171/share/pravin/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://140.211.167.171/share/pravin/filesystem.squashfs  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
     IPAPPEND 3
 
 label debian-live-501-alien
        MENU LABEL Debian live 501 i386 - from rom (for EU)
        kernel pxeknife/debian/debian-live-501-i386/vmlinuz1
-       append  netboot=http boot=live union=aufs httpfs=http://145.116.233.189/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://145.116.233.189/filesystem.squashfs  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
     IPAPPEND 3
 
 label debian-live-501-local
        MENU LABEL Debian live 501 i386 - from rom (for localhost)
        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.0.1/filesystem.squashfs  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
+    IPAPPEND 3
+
+label debian-live-501-rom-iso
+       MENU LABEL Debian live 501 i386 - iso (for US)
+       kernel pxeknife/debian/debian-live-501-i386/vmlinuz1
+       append  netboot=http boot=live union=aufs httpfs=http://140.211.167.171/share/pravin/debian-live-501-i386-gnome-desktop.iso  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
+    IPAPPEND 3
+
+label debian-live-501-alien
+       MENU LABEL Debian live 501 i386 - iso (for EU)
+       kernel pxeknife/debian/debian-live-501-i386/vmlinuz1
+       append  netboot=http boot=live union=aufs httpfs=http://145.116.233.189/debian-live-501-i386-gnome-desktop.iso  initrd=pxeknife/debian/debian-live-501-i386/initrd1.img
+    IPAPPEND 3
+
+label debian-live-501-local
+       MENU LABEL Debian live 501 i386 - iso (for localhost)
+       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
     IPAPPEND 3