| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | set -e |
| 3 | |
| 4 | deb_packagescip-shell shell shell-project 0.0.0 deb_package(). () { |
| 5 | udpkg -f "$1" | grepscip-shell system . . grep. '^Package:' | sedscip-shell system . . sed. -e 's/^Package: *//' |
| 6 | } |
| 7 | |
| 8 | # install cached firmware debs |
| 9 | if [scip-shell system . . `[`. -d /var/cache/firmwarescip-shell filesystem . . `/var/cache/firmware`. ]; then |
| 10 | n=0 |
| 11 | for deb in /var/cache/firmware/*.deb; do |
| 12 | if [scip-shell system . . `[`. -f "$deb" ]; then |
| 13 | cpscip-shell system . . cp. -a "$deb" /target/tmpscip-shell filesystem . . `/target/tmp`. |
| 14 | # TODO debconf passthrough |
| 15 | if ! in-target dpkg --no-triggers -i "/tmp/$(basenamescip-shell system . . basename. "$deb")"; then |
| 16 | # dpkg failed, force removal of package |
| 17 | in-target dpkg --force-depends --remove "$(deb_packagescip-shell shell shell-project 0.0.0 deb_package(). "$deb")" || truescip-shell system . . true. |
| 18 | else |
| 19 | n=$((n+1)) |
| 20 | fi |
| 21 | rmscip-shell system . . rm. -f "/target/tmp/$(basenamescip-shell system . . basename. "$deb")" |
| 22 | fi |
| 23 | done |
| 24 | if [scip-shell system . . `[`. $n -gt 0 ]; then |
| 25 | loggerscip-shell system . . logger. -t install-firmware "processing triggers (after $n installations)" |
| 26 | in-target dpkg --triggers-only -a |
| 27 | fi |
| 28 | fi |