You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

  1. #! /bin/sh
  2. set -e
  3. . /usr/share/debconf/confmodule
  4. # Can be preseed to true to force cdrom entries to be disabled
  5. db_get apt-setup/disable-cdrom-entries
  6. disable_cdrom_entries="$RET"
  7. # Always disable various sources in sources.list after installation,
  8. # if any other sources are present:
  9. # 1. netinst
  10. # 2. live image
  11. # 3. single-desktop CD image
  12. if [ -e /cdrom/.disk/base_installable ] && \
  13. [ -e /cdrom/.disk/cd_type ] && \
  14. ( [ "$(cat /cdrom/.disk/cd_type)" = not_complete ] || \
  15. [ "$(cat /cdrom/.disk/cd_type)" = live ] || \
  16. [ "$(cat /cdrom/.disk/cd_type)" = "full_cd/single" ]
  17. ) && \
  18. grep -q "^deb \(ht\|f\)tp" /target/etc/apt/sources.list; then
  19. disable_cdrom_entries="true"
  20. fi
  21. # Comment out the cdrom entries and update APT's cache
  22. if [ "$disable_cdrom_entries" = "true" ]; then
  23. logger -t finish-install "Disabling CDROM entries in sources.list"
  24. sed -i "/^deb cdrom:/s/^/#/" /target/etc/apt/sources.list
  25. cat >> /target/etc/apt/sources.list <<EOF
  26. # This system was installed using small removable media
  27. # (e.g. netinst, live or single CD). The matching "deb cdrom"
  28. # entries were disabled at the end of the installation process.
  29. # For information about how to configure apt package sources,
  30. # see the sources.list(5) manual.
  31. EOF
  32. log-output -t finish-install chroot /target apt-get update
  33. fi