diff options
| -rwxr-xr-x | bin/platform_meta_test | 2 | ||||
| -rwxr-xr-x | bin/platform_meta_test_bios_id | 24 |
2 files changed, 23 insertions, 3 deletions
diff --git a/bin/platform_meta_test b/bin/platform_meta_test index 56a6b9a..b5b72c3 100755 --- a/bin/platform_meta_test +++ b/bin/platform_meta_test @@ -13,7 +13,7 @@ platform_tag=$(ubuntu-report show | grep DCD | awk -F'+' '{print $2}') [ -n "${platform_tag}" ] || failed "no platform tag in ubuntu-report" -dpkg -l ${platform_tag}-meta > /dev/null || dpkg -l oem-${platform_tag}-meta > /dev/null || failed "no platform meta is installed." +dpkg -l ${platform_tag}-meta > /dev/null 2>&1 || dpkg -l oem-${platform_tag}-meta > /dev/null 2>&1 || failed "no platform meta is installed." grep ${platform_tag} /etc/apt/sources.list.d/* > /dev/null || failed "no platform archive in source list" diff --git a/bin/platform_meta_test_bios_id b/bin/platform_meta_test_bios_id index 136696c..1df2048 100755 --- a/bin/platform_meta_test_bios_id +++ b/bin/platform_meta_test_bios_id @@ -3,8 +3,13 @@ # 1. Platform meta pacakge: PLATFORM_NAME-meta, e.g. turis-vegas-mlk-glk-meta # 2. BIOS ID meta package: dell-BIOS_ID-RELEASE-meta or dell-BIOS_ID-meta. # e.g. dell-086b-bionic-meta +# From somerville bionic-osp1 and after, the BIOS ID package is deprecated and replaced +# by modaliases in platform meta package. +# 1. Platform meta pacakge: oem-PLATFORM_NAME-meta, e.g. oem-beaver-osp1-worm-meta +# 2. BIOS ID modaliases in platform meta package: +# e.g. Modaliases: hwe(pci:*sv00001028sd0000096E*, pci:*sv00001028sd0000096F*) -echo "Beginning Platform Metapackage Test" 1>&2 +echo "Beginning Platform Metapackage BIOS ID Test" 1>&2 biosid=`lspci -s 00:00.0 -nnv | grep Subsystem | grep -o -E "[[:xdigit:]]{4}:[[:xdigit:]]{4}" | cut -d ":" -f 2` release=`lsb_release -c | awk '{print $2}'` @@ -17,5 +22,20 @@ for meta in $(dpkg -l |grep ".*-meta" |awk '{print ($2)}'); do fi done -echo "Platform Metapackage cannot be found" +ptag=$(ubuntu-report show | grep DCD | awk -F'+' '{print $2}') + +if [ -n "$ptag" ]; then + if dpkg-query -W oem-$ptag-meta >/dev/null 2>&1; then + pmeta="oem-$ptag-meta" + elif dpkg-query -W $ptag-meta; then + pmeta="$ptag-meta" + fi +fi + +if [ -n "$pmeta" ] && apt-cache show $pmeta | grep ^Modaliases | grep -i sv00001028sd0000$biosid; then + echo "Found platform meta package '$pmeta' containing BIOS ID '$biosid'" + exit 0 +fi + +echo "Platform Metapackage BIOS ID cannot be found" exit 1 |
