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

[RFC] Detecting type of CD image and using that to make apt-setup smarter



joeyh, sledge, others,

After working with d-cd a lot over the past week, I think I've come up 
with a solution that will allow us to detect if the user is installing 
from netinst CD, full CD or DVD.
This would allow us to let apt-setup ask the "use a mirror" question based 
on the type of CD.

In debian-cd/tools/add_debs add something like (pseudocode):
if [ $COMPLETE = 1 ]; then
   if [ $DEFBINSIZE -gt 1000]; then
      echo "dvd" > .disk/cd_type
   else
      echo "full_cd" > .disk/cd_type
   fi
else
   echo "not_complete" > .disk/cd_type
fi

Note: we can (and do) already distinguish between businesscard and netinst 
using .disk/base_installable.

For apt-setup I'd propose the following logic:

CD_TYPE=""
if [ ! -f /cdrom/.disk/cd_type ]; then
   CD_TYPE=$(cat /cdrom/.disk/cd_type)
fi
case $CD_TYPE in
   not_complete)
      # default to use mirror; don't ask; don't add CD as source
      # rationale: CD only contains base which is already installed;
      # the few additional uninstalled packages on the CD can be better
      # installed from the mirror
   full_cd)
      # default to not use mirror (unless preseeded), ask at high priority
      # rationale for asking: full CD image lacks loads of components
      # for desktop; this could be changed when we support installing
      # from multiple CDs
   dvd)
      # default to not use mirror (unless preseeded), ask at low priority
   *)
      # keep current behavior
esac

For businesscard CDs a mirror will already have been selected earlier in 
the installation. Using

Comments welcome,
FJP

Attachment: pgp6IZpvOUvDA.pgp
Description: PGP signature


Reply to: