meta-quanta: gbs: fix bios update script minior issue
- check the FIU node for different kernel version
- replace sh by bash for the script
Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: I20f72f2979f75cb6d22a9870c48619a507891005
diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh
index 3a215fa..36dfa45 100644
--- a/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh
+++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright 2020 Google LLC
# Copyright 2020 Quanta Computer Inc.
#
@@ -20,11 +20,23 @@
SPI_SW_SELECT=169
# Kernel control string for bind/unbind
-KERNEL_FIU_ID="c0000000.fiu"
+KERNEL_FIU_ID="c0000000.spi"
# Kernel sysfs path for bind/unbind
KERNEL_SYSFS_FIU="/sys/bus/platform/drivers/NPCM-FIU"
+# the node of FIU is spi for kernel 5.10, but
+# for less than or equal kernel 5.4, the node
+# is fiu
+for fname in $(find ${KERNEL_SYSFS_FIU} -type l)
+do
+ if [ "${fname##*\.}" == "fiu" ]
+ then
+ KERNEL_FIU_ID="c0000000.fiu"
+ break
+ fi
+done
+
IMAGE_FILE="/tmp/image-bios"
# Taken from /run/initramfs/update