X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-premount%2F10driver_updates;h=eda8bbf3372b8c33e0ac15e4835a9f5157c9b706;hb=28140b27fe2dc64ad521706352397cb0f2e4d654;hp=0a88724b5c933275637dbfa63f550112d4210f0c;hpb=cb896241d0ec8eb2bba0cecd11de3500869176a6;p=live-boot-grml.git diff --git a/scripts/live-premount/10driver_updates b/scripts/live-premount/10driver_updates index 0a88724..eda8bbf 100755 --- a/scripts/live-premount/10driver_updates +++ b/scripts/live-premount/10driver_updates @@ -40,21 +40,26 @@ is_updates_path () # subdirectory. Each package contains a module for a specific # kernel flavour. - path=$1 - kbase=$(uname -r | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\)-.*/\1/') - update_dir="$path/ubuntu-drivers/$kbase" + path=${1} + abi="$(uname -r)" + kver="$(echo "$abi" | cut -d- -f1,2)" + kbase="$(echo "$abi" | cut -d- -f1)" - if [ -d "$update_dir" ] - then - if [ "$(echo $update_dir/*_$DPKG_ARCH.deb)" != \ - "$update_dir/*_$DPKG_ARCH.deb" ] + for leaf in "$abi" "$kver" "$kbase" + do + update_dir="$path/ubuntu-drivers/$leaf" + + [ -d "$update_dir" ] || continue + + if [ "$(echo ${update_dir}/*_${DPKG_ARCH}.deb)" != \ + "${update_dir}/*_${DPKG_ARCH}.deb" ] then - echo "$update_dir" - return 0; + echo "${update_dir}" + return 0 fi - fi + done - return 1; + return 1 } is_nice_device () @@ -99,11 +104,11 @@ check_dev_updates () then mount -t ${fstype} -o ro "${devname}" $mountpoint || continue - if is_updates_path $mountpoint + if is_updates_path ${mountpoint} then return 0 else - umount $mountpoint + umount ${mountpoint} fi fi @@ -150,14 +155,14 @@ updates="false" for x in $(cat /proc/cmdline) do - case $x in + case ${x} in debian-installer/driver-update=*) updates=${x#debian-installer/driver-update=} ;; esac done -if [ "$updates" != "true" ] +if [ "${updates}" != "true" ] then log_end_msg exit 0 @@ -183,7 +188,7 @@ then eject fi -log_wait_msg "Insert a driver CD and press ENTER ($DPKG_ARCH)" +log_wait_msg "Insert a driver CD and press ENTER (${DPKG_ARCH})" log_begin_msg "Looking for driver update CD" @@ -211,8 +216,8 @@ fi log_begin_msg "Copying driver updates to temporary location" mkdir -p /tmp/driver-updates -cp $updates_root/*_$DPKG_ARCH.deb /tmp/driver-updates/ -umount $mountpoint +cp ${updates_root}/*_${DPKG_ARCH}.deb /tmp/driver-updates/ +umount ${mountpoint} if [ -x /usr/bin/eject ] then