diff -rupN debian-testing-amd64-netinst.orig/bin/check-missing-firmware debian-testing-amd64-netinst/bin/check-missing-firmware
--- debian-testing-amd64-netinst.orig/bin/check-missing-firmware	2013-08-16 15:10:00.000000000 +0200
+++ debian-testing-amd64-netinst/bin/check-missing-firmware	2013-10-07 17:42:12.120620713 +0200
@@ -246,6 +246,15 @@ check_for_firmware() {
 }
 
 while check_missing && ask_load_firmware; do
+	# If LOOPMOUNT is used, check the (busy) device from which the ISO is loaded
+	db_get cdrom-detect/cdrom_loopdev || true
+	if [ "$RET" ]; then
+		log "Check on /loop for firmware"
+		if [ -d /loop/firmware ]; then
+			check_for_firmware /loop/firmware/*.deb /loop/firmware/*.udeb
+		fi
+	fi
+
 	# first, check if needed firmware (u)debs are available on the
 	# PXE initrd or the installation CD.
 	if [ -d /firmware ]; then
diff -rupN debian-testing-amd64-netinst.orig/var/lib/dpkg/info/cdrom-detect.postinst debian-testing-amd64-netinst/var/lib/dpkg/info/cdrom-detect.postinst
--- debian-testing-amd64-netinst.orig/var/lib/dpkg/info/cdrom-detect.postinst	2013-08-17 11:10:50.000000000 +0200
+++ debian-testing-amd64-netinst/var/lib/dpkg/info/cdrom-detect.postinst	2013-10-07 14:26:02.946124525 +0200
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
 
 set -e
 . /usr/share/debconf/confmodule
@@ -14,26 +14,43 @@ fail() {
 	exit 1
 }
 
+list_devices_by_id()
+{
+	local dir disk="$(echo "$1" | sed 's/ /\\x20/g')"
+	for dir in /dev/disk/by-label /dev/disk/by-uuid ; do
+		[ -e ${dir}/${disk} ] && echo ${dir}/${disk} || true
+	done
+}
+
+get_fstype ()
+{
+	/sbin/blkid -s TYPE -o value $1 2>/dev/null
+}
+
 try_mount() {
 	local device=$1
 	local type=$2
+	local options=$3
+	local loopdev=$4
 
 	local ret=1
-	if mount -t $type -o $OPTIONS $device /cdrom; then
-		log "CD-ROM mount succeeded: device=$device fstype=$type"
+	if mount -o ${loopdev:+loop,}$options -t $type $device /cdrom; then
+		log "CD-ROM ${loopdev:+loop-}mount succeeded: device=$loopdev${device#/loop} fstype=$type"
 		if [ -e /cdrom/.disk/info ]; then
 			CDNAME=$(cat /cdrom/.disk/info)
 			log "Detected CD '$CDNAME'"
 			db_set cdrom-detect/cdrom_device $device
 			db_set cdrom-detect/cdrom_fs $type
+			db_set cdrom-detect/cdrom_options ${loopdev:+loop,}$options
+			db_set cdrom-detect/cdrom_loopdev $loopdev
 			ret=0
 		else
-			log "The CD in $device is not a Debian CD!"
+			log "The CD in $loopdev${device#/loop} is not a Debian CD!"
 			umount /cdrom 2>/dev/null || true
 			WRONG=1
 		fi
 	else
-		log "CD-ROM mount failed: device=$device fstype=$type"
+		log "CD-ROM ${loopdev:+loop-}mount failed: device=$loopdev${device#/loop} fstype=$type"
 	fi
 
 	return $ret
@@ -77,9 +94,8 @@ case "$OS" in
 	*)
 		log "Unknown OS '$OS', exiting"
 		exit 0
-		
 esac
- 
+
 # Is a cdrom already mounted? If so, assume it's the right one.
 mount | grep -q 'on /cdrom' && set_suite_and_codename && exit 0
 if [ -e /cdrom/.disk/info ]; then
@@ -95,42 +111,106 @@ log "Searching for Debian installation m
 
 mkdir /cdrom 2>/dev/null || true
 
+# Check whether the boot parameter 'loopmount=' is used
+for arg in $(cat /proc/cmdline); do
+	case $arg in
+	loopmount=*)
+		LOOPMOUNT=${arg#loopmount=}
+		LOOPFILE=${LOOPMOUNT#*:}
+		[ "$LOOPFILE" != "$LOOPMOUNT" ] && LOOPDEV=${LOOPMOUNT%:*}
+		;;
+	esac
+done
+
+if [ "$LOOPMOUNT" ]; then
+	# Create mount point for loop mount
+	mkdir /loop 2>/dev/null || true
+fi
+
 # Need to wait for the usb device scan to complete
 if [ "$OS" = "linux" ]; then
-  for count in 1 2 3 4 5 6 8 9 10; do
-    devices="$(list-devices cd; list-devices maybe-usb-floppy)"
-    log "Devices: '$devices'"
-    if [ -n "$devices" ]; then
-      break 2
-    else
-      sleep 1
-    fi
-  done
+	for count in 1 2 3 4 5 6 8 9 10; do
+		devices="$(list-devices cd; list-devices maybe-usb-floppy)"
+		log "CD/maybe-usb-floppy devices: '$devices'"
+		if [ "$devices" ]; then
+			break
+		else
+			sleep 1
+		fi
+	done
 fi
 
+# This is for apt-cdrom-setup, that needs to know, whether or not it should try to automatically (u)mount the device.
+cd_mountable=true
+
 while true; do
-	WRONG=
+	WRONG=''
+
+	if [ "$LOOPMOUNT" ]; then
+		mounted=0
+		log "Searching for Debian ISO: LOOPDEV='$LOOPDEV' LOOPFILE='$LOOPFILE'"
+		loopfile=/loop/${LOOPFILE#/}
+		log "Unmounting /loop just to be sure"
+		umount /loop 2>/dev/null || true
+
+		if [ "$LOOPDEV" ] ; then
+			dev_given="device_given"
+		else
+			dev_given=""
+		fi
+
+		# First look for the given device (if given) and then on USB devices, since the ISO is probably on them
+		for fs in $dev_given "usb-partition" "cd" "partition"; do
+			if [ "$fs" = "device_given" ]; then
+				devices="$(list_devices_by_id "$LOOPDEV")"
+			else
+				devices="$(list-devices $fs)"
+			fi
+			log "Trying loopmount ($fs) on '$devices' ..."
+			for loopdev in $devices; do
+				# Determine the filesystem of the device
+				LOOPFS=$(get_fstype "$loopdev")
+				# Mount the device and try to mount the ISO specified by 'loopmount='
+				log "Try to mount device=$loopdev fstype=$LOOPFS"
+				if mount -o $OPTIONS -t $LOOPFS $loopdev /loop; then
+					log "Try to loop mount file=$loopfile fstype=$CDFS"
+					if [ -f $loopfile ] && try_mount $loopfile $CDFS $OPTIONS $loopdev; then
+						mounted=1
+						cd_mountable=false
+						break 2
+					else
+						umount /loop
+					fi
+				fi
+			done
+		done
+		if [ $mounted -eq 1 ]; then
+			log "Succesfully mounted the ISO: no need to check further devices"
+			break
+		fi
+	fi
 
 	devices="$(list-devices cd; list-devices maybe-usb-floppy)"
 	for device in $devices; do
-		if try_mount $device $CDFS; then
+		if try_mount $device $CDFS $OPTIONS; then
 			break 2
 		fi
 	done
-	
+
 	devices="$(list-devices usb-partition)"
 	for device in $devices; do
-		if try_mount $device $CDFS; then
+		if try_mount $device $CDFS $OPTIONS; then
 			db_set cdrom-detect/hybrid true
+			cd_mountable=false
 			break 2
 		fi
-		if try_mount $device $FATFS; then
+		if try_mount $device $FATFS $OPTIONS; then
 			db_set cdrom-detect/usb-hdd true
+			cd_mountable=false
 			break 2
 		fi
 	done
 
-
 	if [ "$WRONG" ]; then
 		db_input critical cdrom-detect/wrong-cd || [ $? -eq 30 ]
 		db_go
@@ -138,7 +218,7 @@ while true; do
 	fi
 
 	# If a device was detected but the mount failed, ask for the CD.
-	if [ -n "$devices" ]; then
+	if [ "$devices" ]; then
 		db_input critical cdrom-detect/retry || [ $? -eq 30 ]
 		db_go
 		db_get cdrom-detect/retry
@@ -150,7 +230,7 @@ while true; do
 			fail
 		fi
 	fi
- 
+
 	# If no device was detected, perhaps a driver floppy is needed.
 	if [ -e /usr/lib/debian-installer/retriever/media-retriever ]; then
 		db_input critical cdrom-detect/load_media
@@ -162,7 +242,7 @@ while true; do
 			continue
 		fi
 	fi
-    
+
 	# Otherwise manual configuration may be needed
 	db_input critical cdrom-detect/manual_config || [ $? -eq 30 ]
 	db_go
@@ -266,4 +346,12 @@ else
 	anna-install $RET-support || true
 fi
 
+# Check for hd-media folder, which implies that it is not booted from CD.
+if [ -d /hd-media ]; then
+	cd_mountable=false
+fi
+
+# This is for apt-cdrom-setup, that needs to know, whether or not it should try to automatically (u)mount the device.
+db_set cdrom-detect/cdrom_mountable $cd_mountable
+
 exit 0
diff -rupN debian-testing-amd64-netinst.orig/var/lib/dpkg/info/cdrom-detect.templates debian-testing-amd64-netinst/var/lib/dpkg/info/cdrom-detect.templates
--- debian-testing-amd64-netinst.orig/var/lib/dpkg/info/cdrom-detect.templates	2013-10-07 02:06:30.000000000 +0200
+++ debian-testing-amd64-netinst/var/lib/dpkg/info/cdrom-detect.templates	2013-10-07 14:42:21.982081451 +0200
@@ -1097,6 +1097,12 @@ Default: iso9660
 Description: for internal use only
  File system used on cdrom-detect/cdrom_device.
 
+Template: cdrom-detect/cdrom_options
+Type: string
+Default: ro,exec
+Description: for internal use only
+ Options used to mount the cdrom-detect/cdrom_device.
+
 Template: cdrom-detect/hybrid
 Type: boolean
 Default: false
@@ -1109,6 +1115,17 @@ Default: false
 Description: for internal use only
  Set if the CD appears to be a live USB-HDD image.
 
+Template: cdrom-detect/cdrom_loopdev
+Type: string
+Description: for internal use only
+ Set if a ISO is loopmounted.
+
+Template: cdrom-detect/cdrom_mountable
+Type: boot
+Default: true
+Description: for internal use (communication with apt-cdrom-setup) only
+ This should be false, if the mounted device is not a removable disk in a drive.
+
 Template: cdrom-detect/scanning_progress_title
 Type: text
 Description: Scanning CD-ROM
