2009/9/4 Michal Suchanek <hramr...@centrum.cz>:
> Hello
>
> 2009/9/2 Daniel Baumann <dan...@debian.org>:
>> [ CC'ed to ensure you're not missing the answer ;), will follow up on
>> list only though. ]
>>
>> Pravin wrote:
>>> I also managed to boot debian over iscsi.
>>> I had to add open-iscsi tools into initramfs for enabling iscsi booting,
>>> but booting over iscsi is 3 times faster than booting over HTTPFS :-)
>>
>> i would be very, very much interested in patches to live-initramfs to
>> make iscsi booting out-of-the-box possible, and to live-manual to
>> document it.
>>
>>> I would be glad if I can help in improving network booting of Debian.
>>> Can you please guide me how and and where should I submit these 
>>> modifications
>>> for review and testing?
>>
>> please post it on this list.
>
> I put together a small patch that is supposed to allow booting iso
> images from the web.
>
> This is quite helpful as it would obviate the need to store separate
> iso images for download and squashfs images for http boot.
>
Updated the patch to run with stock run-init.

All moinpoints have to be moved under /root for run-init to work so I
added one more move since unpacking an iso requires an additional
mountpoint.

Thanks

Michal
--- usr/share/initramfs-tools/scripts/live.orig	2009-09-03 23:25:10.000000000 +0200
+++ usr/share/initramfs-tools/scripts/live	2009-09-03 23:26:30.000000000 +0200
@@ -768,7 +768,7 @@
 		if [ -n "$url" ]
 		then
 			case "${extension}" in
-				squashfs|tgz|tar)
+				iso|squashfs|tgz|tar)
 					if [ "${webfile}" = "FETCH" ]
 					then
 						case "$url" in
@@ -797,6 +797,12 @@
 					fi
 					[ ${?} -eq 0 ] && rc=0
 					[ "${extension}" = "tgz" ] && live_dest="ram"
+					if [ "${extension}" = "iso" ]
+					then
+					    isoloop=$(setup_loop "${dest}/$(basename "${url}")" "loop" "/sys/block/loop*" "" '')
+					    mount -t iso9660 "${isoloop}" "${mountpoint}"
+					    rc=${?}
+					fi
 					break
 					;;
 
--- usr/share/initramfs-tools/scripts/live~	2009-09-07 05:36:51.000000000 +0200
+++ usr/share/initramfs-tools/scripts/live	2009-09-07 16:08:41.000000000 +0200
@@ -8,6 +8,7 @@
 echo "/root/usr/lib" >> /etc/ld.so.conf
 
 mountpoint="/live/image"
+ext_mountpoint="/ext_volume"
 LIVE_MEDIA_PATH="live"
 
 root_persistence="live-rw"
@@ -756,19 +757,25 @@
 do_httpmount ()
 {
 	rc=1
-	dest="${mountpoint}/${LIVE_MEDIA_PATH}"
-	mount -t ramfs ram "${mountpoint}"
-	mkdir -p "${dest}"
 
 	for webfile in HTTPFS FTPFS FETCH
 	do
-		url="$(eval echo \"\$\{${webfile}\}\")"
-		extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
+		local url="$(eval echo \"\$\{${webfile}\}\")"
+		local extension="$(echo "${url}" | sed 's/\(.*\)\.\(.*\)/\2/')"
 
 		if [ -n "$url" ]
 		then
 			case "${extension}" in
 				iso|squashfs|tgz|tar)
+					if [ "${extension}" = "iso" ]
+					then
+						mkdir -p "${ext_mountpoint}"
+						dest="${ext_mountpoint}"
+					else
+						local dest="${mountpoint}/${LIVE_MEDIA_PATH}"
+						mount -t ramfs ram "${mountpoint}"
+						mkdir -p "${dest}"
+					fi
 					if [ "${webfile}" = "FETCH" ]
 					then
 						case "$url" in
@@ -799,9 +806,9 @@
 					[ "${extension}" = "tgz" ] && live_dest="ram"
 					if [ "${extension}" = "iso" ]
 					then
-					    isoloop=$(setup_loop "${dest}/$(basename "${url}")" "loop" "/sys/block/loop*" "" '')
-					    mount -t iso9660 "${isoloop}" "${mountpoint}"
-					    rc=${?}
+						isoloop=$(setup_loop "${dest}/$(basename "${url}")" "loop" "/sys/block/loop*" "" '')
+						mount -t iso9660 "${isoloop}" "${mountpoint}"
+						rc=${?}
 					fi
 					break
 					;;
@@ -815,7 +822,12 @@
 
 	if [ ${rc} != 0 ]
 	then
-	    umount "${mountpoint}"
+		if [ -d "${ext_mountpoint}" ]
+		then
+		        umount "${ext_mountpoint}"
+			rmdir "${ext_mountpoint}"
+		fi
+		umount "${mountpoint}"
 	fi
 
 	return ${rc}
--- usr/share/initramfs-tools/scripts/live-bottom/05mountpoints~	2009-09-07 16:23:01.000000000 +0200
+++ usr/share/initramfs-tools/scripts/live-bottom/05mountpoints	2009-09-07 16:25:02.000000000 +0200
@@ -33,4 +33,10 @@
 	mount --move /live/image /root/live/image
 fi
 
+if [ -d /ext_volume ]
+then
+      mkdir -p /root/live/ext_volume
+      mount --move /ext_volume /root/live/ext_volume
+fi
+
 log_end_msg

Reply via email to