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