5 # initramfs-tools header
21 # live-initramfs header
28 . /scripts/live-functions
29 . /scripts/live-helpers
31 log_begin_msg "Adding live session user..."
33 # live-initramfs script
39 # Driver packages are stored in ubuntu-drivers/<kver>/
40 # subdirectory. Each package contains a module for a specific
44 kbase=$(uname -r | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\)-.*/\1/')
45 update_dir="$path/ubuntu-drivers/$kbase"
47 if [ -d "$update_dir" ]
49 if [ "$(echo $update_dir/*_$DPKG_ARCH.deb)" != \
50 "$update_dir/*_$DPKG_ARCH.deb" ]
62 sysfs_path="${1#/sys}"
64 if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb))"
74 # FIXME: do something better like the scan of supported filesystems
78 vfat|iso9660|udf|ext2|ext3|ntfs)
91 if [ -z "${devname}" ]
93 devname=$(sys2dev "${sysdev}")
96 fstype=$(get_fstype "${devname}")
98 if is_supported_fs ${fstype}
100 mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
102 if is_updates_path $mountpoint
113 find_driver_updates ()
115 for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram)
117 devname=$(sys2dev "${sysblock}")
118 fstype=$(get_fstype "${devname}")
120 if /lib/udev/cdrom_id ${devname} > /dev/null
122 if check_dev_updates "null" "${devname}"
126 elif is_nice_device "${sysblock}"
128 for dev in $(subdevices "${sysblock}")
130 if check_dev_updates "${dev}"
143 if [ -x /sbin/usplash_write ]
145 /sbin/usplash_write "PULSATE"
151 for x in $(cat /proc/cmdline)
154 debian-installer/driver-update=*)
155 updates=${x#debian-installer/driver-update=}
160 if [ "$updates" != "true" ]
166 # Not sure what to do for network installs. I assume there isn't even a CD
167 # for this anyway, so fail.
168 if [ -n "${NETBOOT}" ]
174 #if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]
176 # GDMCONF=/etc/gdm/gdm-cdd.conf
178 # GDMCONF=/etc/gdm/gdm.conf
181 if [ -x /usr/bin/eject ]
186 log_wait_msg "Insert a driver CD and press ENTER ($DPKG_ARCH)"
188 log_begin_msg "Looking for driver update CD"
190 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13
192 updates_root=$(find_driver_updates)
194 if [ "${updates_root}" ]
204 if [ -z "${updates_root}" ]
206 log_begin_msg "Could not find driver updates"
207 log_wait_msg "Re-insert install CD and press ENTER"
211 log_begin_msg "Copying driver updates to temporary location"
213 mkdir -p /tmp/driver-updates
214 cp $updates_root/*_$DPKG_ARCH.deb /tmp/driver-updates/
217 if [ -x /usr/bin/eject ]
224 log_wait_msg "Re-insert install CD and press ENTER."