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

Bug#255128: cdrom-detect: Bad handling of mount error



On Sun, Jun 27, 2004 at 01:12:11PM -0400, Joey Hess wrote:
> Osamu Aoki wrote:
> > Busybox does not have "sleep" on this version.  (Why?)
> 
> Just to save space, though I understand it's in sid now.
> 
> > I will put updated patch, iso-image example, syslog-commented, etc at
> > 
> >   http://people.debian.org/~osamu/pub/d-i/

I have updated patch cosmetically and iso so md5sum.txt should be correct.
(Put in tar.gz with quick build script Makefile.)
CD integrity is good now.

> > It works but I think following messages after Detecting CD needs to be
> > understood before applying.
> > 
> > | Jun 26 19:34:27 (none) user.notice cdrom-detect: Detected CD with 'testing' distribution
> > | Jun 26 19:34:27 (none) user.info main-menu[297]: (process:454): mount: Mounting /dev/cdroms/cdrom0 on /cdrom failed: Not a directory
> > | Jun 26 19:34:27 (none) user.info main-menu[297]: (process:454): umount:
> > | Jun 26 19:34:27 (none) user.info main-menu[297]: (process:454): /cdrom
> > | Jun 26 19:34:27 (none) user.info main-menu[297]: (process:454): : Invalid argument
> 
> Hmm, I didn't think that main-menu did stderr interception and logging
> any more. It should just be redirected to the messages file these days.

Anyway these do not happen with this new patch.  Let's apply.
I am having good success.

--- cdrom-detect.postinst.org	1970-01-01 01:00:00.000000000 +0100
+++ cdrom-detect.postinst	2004-06-29 23:29:06.000000000 +0200
@@ -42,9 +42,26 @@
     do
         if mount -t iso9660 -o ro,exec $device /cdrom 2>/dev/null
         then
+            log "CDROM-mount succeeded: device=$device"
             mounted=1
 	    db_set cdrom-detect/cdrom_device $device
             break
+        else
+            log "CDROM-mount failed (error=$?): device=$device"
+            log "Unmounting CD just to be sure."
+            umount /cdrom 2>/dev/null || true
+            log "Trying it again."
+            if mount -t iso9660 -o ro,exec $device /cdrom
+            then
+                log "CDROM-mount succeeded: device=$device"
+                mounted=1
+                db_set cdrom-detect/cdrom_device $device
+                break
+            else
+                log "CDROM-mount failed again (error=$?): device=$device"
+                log "Unmounting CD just to be sure and giving it up."
+                umount /cdrom 2>/dev/null || true
+            fi
         fi
     done
 
@@ -111,8 +128,13 @@
 	fi
 	if mount -t iso9660 -o ro,exec $device /cdrom
 	then
+            log "CDROM-mount succeeded: device=$device"
 	    mounted=1
 	    break
+        else
+            log "CDROM-mount failed (error=$?): device=$device"
+            log "Unmounting CD just to be sure and giving it up."
+            umount /cdrom 2>/dev/null || true
 	fi
     else
 	fail


Let's apply this patch.

Osamu

Attachment: signature.asc
Description: Digital signature


Reply to: