4 . /scripts/live-functions
5 . /scripts/live-helpers
23 # Driver packages are stored in ubuntu-drivers/<kver>/
24 # subdirectory. Each package contains a module for a specific
27 kbase=$(uname -r | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\)-.*/\1/')
28 update_dir="$path/ubuntu-drivers/$kbase"
29 if [ -d "$update_dir" ]; then
30 if [ "$(echo $update_dir/*_$DPKG_ARCH.deb)" != \
31 "$update_dir/*_$DPKG_ARCH.deb" ]; then
40 sysfs_path="${1#/sys}"
41 if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])"; then
48 # FIXME: do something better like the scan of supported filesystems
51 vfat|iso9660|udf|ext2|ext3|ntfs)
62 if [ -z "${devname}" ]; then
63 devname=$(sys2dev "${sysdev}")
66 fstype=$(get_fstype "${devname}")
67 if is_supported_fs ${fstype}; then
68 mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
69 if is_updates_path $mountpoint; then
79 find_driver_updates() {
80 for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram); do
81 devname=$(sys2dev "${sysblock}")
82 fstype=$(get_fstype "${devname}")
83 if /lib/udev/cdrom_id ${devname} > /dev/null; then
84 if check_dev_updates "null" "${devname}" ; then
87 elif is_nice_device "${sysblock}" ; then
88 for dev in $(subdevices "${sysblock}"); do
89 if check_dev_updates "${dev}" ; then
99 if [ -x /sbin/usplash_write ]; then
100 /sbin/usplash_write "PULSATE"
107 for x in $(cat /proc/cmdline); do
109 debian-installer/driver-update=*)
110 updates=${x#debian-installer/driver-update=}
115 if [ "$updates" != "true" ]; then
120 # Not sure what to do for network installs. I assume there isn't even a CD
121 # for this anyway, so fail.
122 if [ -n "${NETBOOT}" ]; then
127 #if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]; then
128 # GDMCONF=/etc/gdm/gdm-cdd.conf
130 # GDMCONF=/etc/gdm/gdm.conf
133 if [ -x /usr/bin/eject ]
138 log_wait_msg "Insert a driver CD and press ENTER ($DPKG_ARCH)"
140 log_begin_msg "Looking for driver update CD"
142 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
143 updates_root=$(find_driver_updates)
144 if [ "${updates_root}" ]; then
152 if [ -z "${updates_root}" ]; then
153 log_begin_msg "Could not find driver updates"
154 log_wait_msg "Re-insert install CD and press ENTER"
158 log_begin_msg "Copying driver updates to temporary location"
160 mkdir -p /tmp/driver-updates
161 cp $updates_root/*_$DPKG_ARCH.deb /tmp/driver-updates/
164 if [ -x /usr/bin/eject ]
171 log_wait_msg "Re-insert install CD and press ENTER."