Skip to content

Commit

Permalink
storage-init.sh: Fix /dev/root checking
Browse files Browse the repository at this point in the history
storage-init.sh considers that /dev/root will be always a symbolic link,
which is not true for some platforms, such as in some NVIDIA devices, where
/dev/root it's just a regular file block device. This commit adds a check
for special block device for /dev/root.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
  • Loading branch information
rene committed Jan 21, 2025
1 parent 2189eeb commit f8eaada
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/storage-init/storage-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ for BLK_DEVICE in $BLK_DEVICES; do
done

#Recording SMART details to a file
if [ -L /dev/root ] ; then
if [ -L /dev/root ] || [ -b /dev/root ] ; then
DEV_TO_CHECK_SMART=/dev/root
else
DEV_TO_CHECK_SMART=$(grep -m 1 /persist < /proc/mounts | cut -d ' ' -f 1)
Expand Down

0 comments on commit f8eaada

Please sign in to comment.