Browse Source

Comment out single-desktop CDs like we do netinsts

If installing from a single-desktop single CD image, comment it out
from sources.list after installation like we do with the netinst
images.

When commenting sources like this, add a helpful comment in
sources.list too.
tags/1%0.137
Steve McIntyre 3 years ago
parent
commit
0627a0a26b
2 changed files with 26 additions and 2 deletions
  1. +11
    -0
      debian/changelog
  2. +15
    -2
      finish-install.d/10apt-cdrom-setup

+ 11
- 0
debian/changelog View File

@@ -1,3 +1,14 @@
apt-setup (1:0.136) UNRELEASED; urgency=medium

[ Steve McIntyre ]
* If installing from a single-desktop single CD image, comment it out
from sources.list after installation like we do with the netinst
images.
* When commenting sources like this, add a helpful comment in
sources.list too.

-- Steve McIntyre <93sam@debian.org> Fri, 12 Jan 2018 17:15:44 +0000

apt-setup (1:0.135) unstable; urgency=medium

[ Updated translations ]


+ 15
- 2
finish-install.d/10apt-cdrom-setup View File

@@ -7,11 +7,16 @@ set -e
db_get apt-setup/disable-cdrom-entries
disable_cdrom_entries="$RET"

# Always disable netinst&live CD image in sources.list if any other sources are present
# Always disable various sources in sources.list after installation,
# if any other sources are present:
# 1. netinst
# 2. live image
# 3. single-desktop CD image
if [ -e /cdrom/.disk/base_installable ] && \
[ -e /cdrom/.disk/cd_type ] && \
( [ "$(cat /cdrom/.disk/cd_type)" = not_complete ] || \
[ "$(cat /cdrom/.disk/cd_type)" = live ]
[ "$(cat /cdrom/.disk/cd_type)" = live ] || \
[ "$(cat /cdrom/.disk/cd_type)" = "full_cd/single" ]
) && \
grep -q "^deb \(ht\|f\)tp" /target/etc/apt/sources.list; then
disable_cdrom_entries="true"
@@ -21,5 +26,13 @@ fi
if [ "$disable_cdrom_entries" = "true" ]; then
logger -t finish-install "Disabling CDROM entries in sources.list"
sed -i "/^deb cdrom:/s/^/#/" /target/etc/apt/sources.list
cat >> /target/etc/apt/sources.list <<EOF

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
EOF
log-output -t finish-install chroot /target apt-get update
fi

Loading…
Cancel
Save