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)"
47 for leaf in "$abi" "$kver" "$kbase"; do
48 update_dir="$path/ubuntu-drivers/$leaf"
49 [ -d "$update_dir" ] || continue
50 if [ "$(echo ${update_dir}/*_${DPKG_ARCH}.deb)" != \
51 "${update_dir}/*_${DPKG_ARCH}.deb" ]
63 sysfs_path="${1#/sys}"
65 if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-(ide|scsi|usb))"
75 # FIXME: do something better like the scan of supported filesystems
79 vfat|iso9660|udf|ext2|ext3|ntfs)
92 if [ -z "${devname}" ]
94 devname=$(sys2dev "${sysdev}")
97 fstype=$(get_fstype "${devname}")
99 if is_supported_fs ${fstype}
101 mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
103 if is_updates_path ${mountpoint}
114 find_driver_updates ()
116 for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram)
118 devname=$(sys2dev "${sysblock}")
119 fstype=$(get_fstype "${devname}")
121 if /lib/udev/cdrom_id ${devname} > /dev/null
123 if check_dev_updates "null" "${devname}"
127 elif is_nice_device "${sysblock}"
129 for dev in $(subdevices "${sysblock}")
131 if check_dev_updates "${dev}"
144 if [ -x /sbin/usplash_write ]
146 /sbin/usplash_write "PULSATE"
152 for x in $(cat /proc/cmdline)
155 debian-installer/driver-update=*)
156 updates=${x#debian-installer/driver-update=}
161 if [ "${updates}" != "true" ]
167 # Not sure what to do for network installs. I assume there isn't even a CD
168 # for this anyway, so fail.
169 if [ -n "${NETBOOT}" ]
175 #if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]
177 # GDMCONF=/etc/gdm/gdm-cdd.conf
179 # GDMCONF=/etc/gdm/gdm.conf
182 if [ -x /usr/bin/eject ]
187 log_wait_msg "Insert a driver CD and press ENTER (${DPKG_ARCH})"
189 log_begin_msg "Looking for driver update CD"
191 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13
193 updates_root=$(find_driver_updates)
195 if [ "${updates_root}" ]
205 if [ -z "${updates_root}" ]
207 log_begin_msg "Could not find driver updates"
208 log_wait_msg "Re-insert install CD and press ENTER"
212 log_begin_msg "Copying driver updates to temporary location"
214 mkdir -p /tmp/driver-updates
215 cp ${updates_root}/*_${DPKG_ARCH}.deb /tmp/driver-updates/
218 if [ -x /usr/bin/eject ]
225 log_wait_msg "Re-insert install CD and press ENTER."