Skip to content

Commit

Permalink
Try to install the platform factory meta package automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
fourdollars committed Jul 6, 2020
1 parent d3f2ec1 commit 623dd04
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions late/chroot_scripts/03-ubuntu-drivers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

. /usr/share/dell/scripts/fifuncs ""

Expand All @@ -12,8 +12,17 @@ done
if [ -n "$UBUNTU_DRIVERS_BLACKLIST" ]; then
echo "UBUNTU_DRIVERS_BLACKLIST: $UBUNTU_DRIVERS_BLACKLIST"
fi
BIOSID=$(cat /sys/devices/virtual/dmi/id/product_sku)
for pkg in $(ubuntu-drivers list | awk -F'[ ,]' '{print $1}'); do
if dpkg-query -W -f='${Status}\n' "$pkg" | grep "install ok installed" >/dev/null 2>&1; then
if apt-cache show "$pkg" | grep ^Modaliases | grep -i "sv00001028sd0000$BIOSID" >/dev/null 2>&1; then
factory="${pkg/oem-somerville/oem-somerville-factory}"
if dpkg-query -W -f='${Status}\n' "$factory" 2>&1 | grep "install ok installed" >/dev/null 2>&1; then
echo "$factory has been installed."
else
apt-get install --yes "$factory" || true
fi
fi
if dpkg-query -W -f='${Status}\n' "$pkg" 2>&1 | grep "install ok installed" >/dev/null 2>&1; then
echo "$pkg has been installed."
else
if [ -n "$UBUNTU_DRIVERS_BLACKLIST" ] && echo "$UBUNTU_DRIVERS_BLACKLIST" | grep "$pkg" >/dev/null 2>&1; then
Expand Down

0 comments on commit 623dd04

Please sign in to comment.