Fix eval of DEV_NUM_PARTITIONS

Using 'let' in these scripts fails when evaluating to zero
for some reason, so replace with '$(())' which works as intended.

Test: Boot device selection menu shown properly when
new/unpartitioned drive installed.

Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
Matt DeVillier 2020-02-27 14:39:13 -06:00
parent 244de9de94
commit 0afa599491
No known key found for this signature in database
GPG Key ID: 2BBB776A35B978FD
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ while true; do
> /tmp/boot_device_list.txt
for i in `cat /tmp/disklist.txt`; do
# remove block device from list if numeric partitions exist, since not bootable
let DEV_NUM_PARTITIONS=`ls -1 $i* | wc -l`-1
DEV_NUM_PARTITIONS=$((`ls -1 $i* | wc -l`-1))
if [ ${DEV_NUM_PARTITIONS} -eq 0 ]; then
echo $i >> /tmp/boot_device_list.txt
else

View File

@ -322,7 +322,7 @@ detect_boot_device()
> /tmp/boot_device_list
for i in `cat /tmp/disklist`; do
# remove block device from list if numeric partitions exist, since not bootable
let DEV_NUM_PARTITIONS=`ls -1 $i* | wc -l`-1
DEV_NUM_PARTITIONS=$((`ls -1 $i* | wc -l`-1))
if [ ${DEV_NUM_PARTITIONS} -eq 0 ]; then
echo $i >> /tmp/boot_device_list
else