From c1989599dfeaef5166c22fe1cae085a2966a8e2e Mon Sep 17 00:00:00 2001 From: George Hung Date: Wed, 2 Jun 2021 10:53:27 +0800 Subject: 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 Change-Id: I20f72f2979f75cb6d22a9870c48619a507891005 --- .../recipes-gbs/gbs-bios-update/files/bios-update.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'meta-quanta/meta-gbs/recipes-gbs') 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 3a215fa50..36dfa452c 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 -- cgit v1.2.3