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.

34 lines
747 B

  1. #!/bin/sh
  2. set -e
  3. . /usr/share/debconf/confmodule
  4. ROOT="$1"
  5. [ "$ROOT" ] || exit 1
  6. [ -e /var/lib/install-cd.id ] || exit 0
  7. logoutput="log-output -t load-install-cd"
  8. check_id() {
  9. cd_id=$($logoutput --pass-stdout chroot $ROOT \
  10. apt-cdrom ident | grep "^Identifying" | cut -d" " -f2)
  11. # Only needed with Etch version of apt-cdrom
  12. $logoutput umount /target/cdrom/ || true
  13. if [ "$cd_id" = "$(head -n1 /var/lib/install-cd.id)" ]; then
  14. return 0
  15. fi
  16. return 1
  17. }
  18. cd_label=$(tail -n1 /var/lib/install-cd.id)
  19. db_subst apt-setup/cdrom/media-change LABEL "$cd_label"
  20. while ! check_id; do
  21. db_input high apt-setup/cdrom/media-change || true
  22. db_go || exit 10
  23. done
  24. db_get cdrom-detect/cdrom_device
  25. $logoutput mount -t iso9660 -o ro,exec $RET /cdrom