mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-18 02:39:59 +00:00
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:
parent
244de9de94
commit
0afa599491
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user