Adding live-initramfs 1.87.2-1.
[live-boot-grml.git] / scripts / live-bottom / 40install_driver_updates
1 #! /bin/sh
2
3 PREREQ=""
4 DESCRIPTION="Installing driver updates..."
5
6 . /scripts/live-functions
7
8 prereqs()
9 {
10        echo "$PREREQ"
11 }
12
13 case $1 in
14 # get pre-requisites
15 prereqs)
16        prereqs
17        exit 0
18        ;;
19 esac
20
21 if [ ! -d /tmp/driver-updates ]; then
22         exit 0
23 fi
24
25 log_begin_msg "$DESCRIPTION"
26
27 install_dir=/var/cache/driver-updates
28
29 mkdir "/root$install_dir"
30 cp -a /tmp/driver-updates/*.deb "/root$install_dir/"
31
32 # We cannot leave packages in a bad state. So if the install fails, remove
33 # it. This will get caught in casper.log.
34 for deb in "/root$install_dir"/*; do
35         if ! chroot /root dpkg -i "$install_dir/$deb"; then
36                 chroot /root dpkg -P "${deb%%_*}"
37         fi
38 done
39
40 log_end_msg