[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#668100: fromiso rewriting based on findiso structure



It seems I made a mistake when submitting the patch.

I attach the correct patch which only patches what I had originally described.

Sorry for that.

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff --git a/scripts/live b/scripts/live
index 97f548d..31df5e4 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1276,15 +1276,15 @@ check_dev ()
 
 		if [ "$ISO_DEVICE" = "/" ]
 		then
-			echo "Warning: device for bootoption isofrom= ($FROMISO) not found.">>/live-boot.log
+			echo "Warning: device for bootoption fromiso= ($FROMISO) not found.">>/live-boot.log
 		else
 			fs_type=$(get_fstype "${ISO_DEVICE}")
 			if is_supported_fs ${fs_type}
 			then
-				mkdir /isofrom
-				mount -t $fs_type "$ISO_DEVICE" /isofrom
+				mkdir /live/fromiso
+				mount -t $fs_type "$ISO_DEVICE" /live/fromiso
 				ISO_NAME="$(echo $FROMISO | sed "s|$ISO_DEVICE||")"
-				loopdevname=$(setup_loop "/isofrom/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
+				loopdevname=$(setup_loop "/live/fromiso/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
 				devname="${loopdevname}"
 			else
 				echo "Warning: unable to mount $ISO_DEVICE." >>/live-boot.log
@@ -1611,13 +1611,26 @@ mountroot ()
 		log_end_msg
 	fi
 
+	# Move fromiso directory to the new root filesystem so that programs there can get at it.
+	if [ -d /live/fromiso ] && [ ! -d /root/live/fromiso ]
+	then
+		mkdir -p /root/live/fromiso
+		mount -n --move /live/fromiso /root/live/fromiso
+	fi
+
 	# if we do not unmount the ISO we can't run "fsck /dev/ice" later on
 	# because the mountpoint is left behind in /proc/mounts, so let's get
 	# rid of it when running from RAM
 	if [ -n "$FROMISO" ] && [ "${TORAM}" ]
 	then
-	  losetup -d /dev/loop0
-	  grep -q /isofrom /proc/mounts && umount /isofrom
+		losetup -d /dev/loop0
+
+		if is_mountpoint /root/live/fromiso
+		then
+			umount /root/live/fromiso
+			rmdir --ignore-fail-on-non-empty /root/live/fromiso \
+				>/dev/null 2>&1 || true
+		fi
 	fi
 
 	if [ -n "${MODULETORAMFILE}" ] || [ -n "${PLAIN_ROOT}" ]

Reply to: