Skip to content

Commit 70ea51d

Browse files
committed
bfb-install: BFB format conversion for runtime upgrade
This commit has some fixes for 91385a6. RM #4449636
1 parent 91385a6 commit 70ea51d

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

man/bfb-install.8

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ host side.
4545
-b, --bfb
4646

4747
This is the BFB image to use, which is pushed as the boot stream.
48+
When doing runtime upgrade, bundle BFB with initramfs will be converted
49+
to flat bfb with FW images only before pushed as the boot stream.
4850

4951
.TP
5052
-c, --config
@@ -143,4 +145,4 @@ When using remote mode nc or ncpipe, there's a short window of time when there
143145
is a netcat server running on the local or remote host on the specified TCP port
144146
(default 9527). This could be a potential security risk. So these two methods
145147
should only be used on a secure network and the security implications are
146-
understood.
148+
understood.

scripts/bfb-install

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,17 @@ if [ $verbose -eq 1 ]; then
800800
echo " RSHIM Device Node: $rshim_node"
801801
fi
802802

803+
# Root access check.
804+
check_root_cmd="[ \$(id -u) -eq 0 ]"
805+
echo "Checking if local host has root access..."
806+
if ! eval "$check_root_cmd"; then
807+
echo " Warning: No host root access. Trying sudo"
808+
sudo_prefix="sudo"
809+
fi
810+
811+
# rshim is ready to use.
812+
run_cmd_local_ready=1
813+
803814
# Setup checks
804815

805816
# Check BF chip version and adjust register offsets.
@@ -876,6 +887,10 @@ elif [ ${runtime} -eq 1 ]; then
876887
is_bundle=$(mlx-mkbfb -d "${bfb}" | grep "In-memory filesystem")
877888
if [ -n "${is_bundle}" -a -n "$pcie_bd" ]; then
878889
echo "Convert $(basename "${bfb}") to flat format for runtime upgrade"
890+
if ! which flint &> /dev/null; then
891+
echo "Error: flint not found."
892+
exit 1
893+
fi
879894
psid=$(flint -d "$pcie_bd".0 q | grep PSID | awk '{print $2}')
880895
if [ -z "${psid}" ]; then
881896
echo "Error: failed to get PSID."
@@ -916,15 +931,6 @@ if [ -n "${cfg}" ] && [ ! -e "${cfg}" ]; then
916931
exit 1
917932
fi
918933

919-
check_root_cmd="[ \$(id -u) -eq 0 ]"
920-
echo "Checking if local host has root access..."
921-
if ! eval "$check_root_cmd"; then
922-
echo " Warning: No host root access. Trying sudo"
923-
sudo_prefix="sudo"
924-
fi
925-
926-
run_cmd_local_ready=1
927-
928934
rshim_check_cmd="[ -e ${rshim_node}/boot ]"
929935

930936
if [ $mode == "local" ]; then

0 commit comments

Comments
 (0)