The bail out on !iso9660 was added in r60433, "Don't try and run apt-cdrom for vfat "CD-ROMs"". That may have made sense at the time? Now it seems to make more sense to treat those disks the same as hd-media, or possibly isohybrid, are treated. But, while looking at this, bailing out when the filesystem is not iso9660 seems to have other problems too. kFreeBSD calls the filesystem cd9660, and so while I have not been able to check, this seems like it would prevent apt-setup using kFreeBSD CDs too! It seems likely to me that either nobody has tested fullsize kFreeBSD CDs yet, or nobody noticed that d-i ignored the CD after apt-setup, and downloaded everything from the mirror. I've attached two patches. In cdrom-detect, I set cdrom-detect/usb-hdd when a FAT filesystem "CD" is found. Clearly safe and apparently correct. In apt-setup, the hardcoded iso9660 check is removed, and usb-hdd is treated the same as hd-media and isohybrid. I am not able to test this, but the end result should be the same as the earlier "40cdrom.usb.patch" sent to this bug, which has been reported to work on usb-hdd. And my patch should not be able to affect any other image type. -- see shy jo
Index: generators/40cdrom =================================================================== --- generators/40cdrom (revision 66241) +++ generators/40cdrom (working copy) @@ -41,19 +41,19 @@ db_get cdrom-detect/hybrid || true if [ "$RET" = true ] || [ -d /hd-media ]; then cd_mountable="" +else + db-get cdrom-detect/usb-hdd || true + if [ "$RET" = true ]; then + cd_mountable="" + fi fi -fs=iso9660 -if db_get cdrom-detect/cdrom_fs && [ "$RET" ]; then - fs="$RET" -fi - -if [ "$fs" != iso9660 ]; then - exit 0 -fi - remount_cd() { if [ "$ROOT" ] && [ "$cd_mountable" ]; then + fs=iso9660 + if db_get cdrom-detect/cdrom_fs && [ "$RET" ]; then + fs="$RET" + fi db_get cdrom-detect/cdrom_device $logoutput mount -t "$fs" -o ro,exec $RET /cdrom || true fi
Index: debian/cdrom-detect.templates =================================================================== --- debian/cdrom-detect.templates (revision 66241) +++ debian/cdrom-detect.templates (working copy) @@ -71,6 +71,12 @@ Description: for internal use only Set if the CD appears to be on a USB stick. +Template: cdrom-detect/usb-hdd +Type: boolean +Default: false +Description: for internal use only + Set if the CD appears to be a live USB-HDD image. + Template: cdrom-detect/scanning_progress_title Type: text # :sl1: Index: debian/changelog =================================================================== --- debian/changelog (revision 66241) +++ debian/changelog (working copy) @@ -1,3 +1,10 @@ +cdrom-detect (1.38) UNRELEASED; urgency=low + + * Set cdrom-detect/usb-hdd when the "CD" is really a live USB-HDD + filesystem. + + -- Joey Hess <joeyh@debian.org> Sat, 15 Jan 2011 14:32:29 -0400 + cdrom-detect (1.37) unstable; urgency=low [ Colin Watson ] Index: debian/cdrom-detect.postinst =================================================================== --- debian/cdrom-detect.postinst (revision 66241) +++ debian/cdrom-detect.postinst (working copy) @@ -122,6 +122,7 @@ break 2 fi if try_mount $device $FATFS; then + db_set cdrom-detect/usb-hdd true break 2 fi done
Attachment:
signature.asc
Description: Digital signature