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.

47 lines
891 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_ids=$(LC_ALL=C $logoutput --pass-stdout chroot $ROOT \
  10. apt-cdrom ident < /dev/null | grep "^Identifying" | cut -d" " -f2)
  11. for cd_id in $cd_ids; do
  12. if [ "$cd_id" = "$(head -n1 /var/lib/install-cd.id)" ]; then
  13. return 0
  14. fi
  15. done
  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 critical apt-setup/cdrom/media-change || true
  22. db_go || exit 10
  23. done
  24. fs=iso9660
  25. if db_get cdrom-detect/cdrom_fs && [ "$RET" ]; then
  26. fs="$RET"
  27. fi
  28. OS=$(udpkg --print-os)
  29. case "$OS" in
  30. hurd)
  31. OPTIONS=ro
  32. ;;
  33. *)
  34. OPTIONS=ro,exec
  35. ;;
  36. esac
  37. db_get cdrom-detect/cdrom_device
  38. $logoutput mount -t "$fs" -o $OPTIONS $RET /cdrom