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
45 kver="$(echo "$abi" | cut -d- -f1,2)"
46 kbase="$(echo "$abi" | cut -d- -f1)"
48 for leaf in "$abi" "$kver" "$kbase"
50 update_dir="$path/ubuntu-drivers/$leaf"
52 [ -d "$update_dir" ] || continue
54 if [ "$(echo ${update_dir}/*_${DPKG_ARCH}.deb)" != \
55 "${update_dir}/*_${DPKG_ARCH}.deb" ]
67 sysfs_path="${1#/sys}"
69 if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb))"
79 # FIXME: do something better like the scan of supported filesystems
83 vfat|iso9660|udf|ext2|ext3|ntfs)
96 if [ -z "${devname}" ]
98 devname=$(sys2dev "${sysdev}")
101 fstype=$(get_fstype "${devname}")
103 if is_supported_fs ${fstype}
105 mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
107 if is_updates_path ${mountpoint}
118 find_driver_updates ()
120 for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram)
122 devname=$(sys2dev "${sysblock}")
123 fstype=$(get_fstype "${devname}")
125 if /lib/udev/cdrom_id ${devname} > /dev/null
127 if check_dev_updates "null" "${devname}"
131 elif is_nice_device "${sysblock}"
133 for dev in $(subdevices "${sysblock}")
135 if check_dev_updates "${dev}"
148 if [ -x /sbin/usplash_write ]
150 /sbin/usplash_write "PULSATE"
156 for x in $(cat /proc/cmdline)
159 debian-installer/driver-update=*)
160 updates=${x#debian-installer/driver-update=}
165 if [ "${updates}" != "true" ]
171 # Not sure what to do for network installs. I assume there isn't even a CD
172 # for this anyway, so fail.
173 if [ -n "${NETBOOT}" ]
179 #if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]
181 # GDMCONF=/etc/gdm/gdm-cdd.conf
183 # GDMCONF=/etc/gdm/gdm.conf
186 if [ -x /usr/bin/eject ]
191 log_wait_msg "Insert a driver CD and press ENTER (${DPKG_ARCH})"
193 log_begin_msg "Looking for driver update CD"
195 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13
197 updates_root=$(find_driver_updates)
199 if [ "${updates_root}" ]
209 if [ -z "${updates_root}" ]
211 log_begin_msg "Could not find driver updates"
212 log_wait_msg "Re-insert install CD and press ENTER"
216 log_begin_msg "Copying driver updates to temporary location"
218 mkdir -p /tmp/driver-updates
219 cp ${updates_root}/*_${DPKG_ARCH}.deb /tmp/driver-updates/
222 if [ -x /usr/bin/eject ]
229 log_wait_msg "Re-insert install CD and press ENTER."