3
. /usr/share/debconf/confmodule
6
logger -t cdrom-detect "$@"
9
if test -x /target/usr/bin/eject ; then
10
# Cannot just tell eject to eject /cdrom as it is not compatible
11
# with busybox umount. Instead, unmount the cdrom first, and then
13
CDDEV=$(mount | grep "on /cdrom" | cut -d ' ' -f 1)
14
if [ -n "$CDDEV" ]; then
15
log "Unmounting and ejecting '$CDDEV'"
18
db_get cdrom-detect/eject
19
if [ "$RET" = false ]; then
20
log "Not ejecting CD, per debconf setting."
22
/target/usr/bin/eject $CDDEV || true
25
log "Not ejecting CD, as nothing is mounted."
29
ARCH="`udpkg --print-architecture`"
30
if [ "$ARCH" = i386 ]; then
31
# Set CD-ROM drive parameters for post-reboot.
33
db_get cdrom-detect/cdrom_device
36
db_get cdrom-detect/cdrom_hdparm
39
if [ "$device" ] && [ "$params" ]; then
40
mappeddevice="`mapdevfs "$device"`"
41
cat >>/target/etc/hdparm.conf <<EOF
43
# Added by debian-installer
54
name="`printf '%s' "$name" | sed 's/^\(-.\).*/\1/'`"
66
-a) mappedname=read_ahead_sect ;;
67
-A) mappedname=lookahead; boolvalue=yes ;;
68
-b) mappedname=bus; boolvalue=yes ;;
70
-c) mappedname=io32_support ;;
71
-d) mappedname=dma; boolvalue=yes ;;
72
-D) mappedname=defect_mana; boolvalue=yes ;;
73
-E) mappedname=cd_speed ;;
74
-m) mappedname=mult_sect_io ;;
75
-P) mappedname=prefetch_sect ;;
76
-S) mappedname=spindown_time ;;
77
-u) mappedname=interrupt_unmask; boolvalue=yes ;;
78
-X) mappedname=transfer_mode ;;
81
if [ "$boolvalue" = yes ]; then
90
printf '\t%s = %s\n' "$mappedname" "$mappedvalue" \
91
>>/target/etc/hdparm.conf
93
echo '}' >>/target/etc/hdparm.conf