Re: [RFC] Detecting type of CD image and using that to make apt-setup smarter
On Thu, Nov 16, 2006 at 08:54:36AM +0100, Frans Pop wrote:
>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.
Hmmmm. I've been working on a slightly different setup in my devel
branch - specifying the type of media up-front instead of the size,
then setting the size from there. Same overall effect, just slightly
different code. Mine in CONF.sh looks like:
# Set your disk type here. Known types are:
# BC (businesscard): 650 MiB max (should be limited elsewhere,
# should never fill a CD anyway)
# NETINST: 650 MiB max (ditto)
# CD: standard 74-min CD (650 MiB)
# CD700: (semi-)standard 80-min CD (700 MiB)
# DVD: standard 4.7 GB DVD
# CUSTOM: up to you - specify a size to go with it (in 2K
blocks)
export DISKTYPE=CD
#export DISKTYPE=CUSTOM
#export CUSTOMSIZE=XXXX
The DISKTYPE setting is then used later on (for example in setting the
output filename) and the disk size is calculated from the disk type
when building trees later. I don't (currently) put anything in
.disk/<foo> yet, but that'd be easy to add...
>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
Using...?
Otherwise sounds sensible.
--
Steve McIntyre, Cambridge, UK. steve@einval.com
"It's actually quite entertaining to watch ag129 prop his foot up on
the desk so he can get a better aim." [ seen in ucam.chat ]
Reply to: