17
17
# Is a cdrom already mounted? If so, assume it's the right one..
18
18
mount | grep -q 'on /cdrom' && exit 0
19
if [ -e /cdrom/.disk/info ] ; then
19
if [ -e /cdrom/.disk/info ]; then
20
20
CDNAME=`cat /cdrom/.disk/info`
21
21
log "Detected CD '$CDNAME'"
157
157
# Set the suite and codename used by base-installer and base-config
158
# to the suite/codename that is on the CD. This assumes that there
159
# will be no more than one distribution on the CD, and that one of
160
# the testing, stable, or unstable links will point to it. Since the
161
# CDs currently have many links, parse the Release file to get the
162
# actual suite name to use.
163
for distlink in stable testing unstable ; do
164
relfile=/cdrom/dists/$distlink/Release
165
if [ -e $relfile ] ; then
166
suite=$(sed -n 's/^Suite: *//p' $relfile)
167
codename=$(sed -n 's/^Codename: *//p' $relfile)
158
# to the suite/codename that is on the CD. In case there are multiple
159
# suites, prefer the one in default-release.
160
for dir in $(cat /etc/default-release) $(ls -1 /cdrom/dists/); do
161
relfile="/cdrom/dists/$dir/Release"
162
if [ -e $relfile ]; then
163
suite=$(sed -n 's/^Suite: *//p' "$relfile")
164
codename=$(sed -n 's/^Codename: *//p' "$relfile")
168
165
log "Detected CD with '$suite' ($codename) distribution"
169
db_set cdrom/suite $suite
170
db_set cdrom/codename $codename
166
db_set cdrom/suite "$suite"
167
db_set cdrom/codename "$codename"
176
if [ -z "$suite" ] ; then
173
if [ -z "$suite" ]; then
177
174
log "Error reading Release file; unable to determine distribution"
178
175
db_input critical cdrom-detect/no-release || [ $? -eq 30 ]
183
# Ask for eject to be installed into /target/, to be able to use it in
184
# the finish-install script.
185
apt-install eject || true
180
# Install eject-udeb, to be able to use it in the finish-install script.
181
anna-install eject-udeb || true
187
183
# Hey, we're done
188
184
db_subst cdrom-detect/success cdname "$CDNAME"