sonic-buildimage/platform/broadcom/sonic-platform-modules-juniper/debian/sonic-platform-juniper-qfx5210.postinst
ciju-juniper f126258d5f [Juniper][QFX5210] Platform monitoring updates (#3899)
As part of this commit, there are a few enhancements being
made for EM policy implementation: a) Introduced hysteresis
algorithm to prevent fan hunting b) Reading ASIC temperature
to make decision for fan speed.

As part of the PR# 3599, Workaround for the boot problem
from secondary bios was addressed. When the SONiC image is
upgraded, this resulted in creating multiple entries for
BOOTX64.EFI. To fix the problem, as part of this changeset,
introducing a check to see if there is already an UEFI entry
for BOOTX64.EFI and accordingly creating / skipping the UEFI
entry.

Signed-off-by: Ciju Rajan K <crajank@juniper.net>
2019-12-13 09:06:05 -08:00

32 lines
1.1 KiB
Bash

#!/bin/bash
systemctl enable qfx5210-platform-init.service
systemctl start qfx5210-platform-init.service
# There are primary and secondary bios in qfx5210 platform.
# There is a problem with bios which prevents the OS booting from the
# secondary bios when the OS was installed using primary bios.
# Secondary bios fails to detect the UEFI partition. Right now
# the workaround is to have a folder structure /EFI/BOOT/BOOT64x.efi
SONIC_VERSION=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v build_version)
FIRST_BOOT_FILE="/host/image-${SONIC_VERSION}/platform/firsttime"
if [ -f $FIRST_BOOT_FILE ]; then
mkdir /tmp/sda1
mount /dev/sda1 /tmp/sda1
cd /tmp/sda1/EFI
mkdir BOOT > /dev/null 2>&1
cp SONiC-OS/grubx64.efi BOOT/BOOTX64.EFI
cd /tmp
umount sda1
# This code block ensures that no additional entries
# are added. This is applicable during SONiC image
# upgrades.
entries=`efibootmgr -v | grep "BOOTX64"`
if [ -z "$entries" ]; then
# Creating the UEFI entry for the first time.
efibootmgr -c -L "SONiC" -l "\EFI\BOOT\BOOTX64.EFI" > /var/tmp/efi_log 2>&1
fi
fi