fi
}
-wait_for_file()
-{
- for a in `seq 10`
- do
- if test -e "$1"
- then
- return 0
- fi
- sleep .5
- done
- return 1
-}
-
mkdir /mnt/ubifs 2> /dev/null || true
return 0
fi
- # presence of uImage* is a sign that we can wipe whole boot partition,
- # but first get rid of potentially bad autoboot.txt
- rm -f /mnt/ubifs/autoboot.txt
-
for kernel in $kernels
do
if ! cmp $kernel /mnt/ubifs/$kernel 2> /dev/null
cp -a bootmenu.txt /mnt/ubifs/bootmenu.txt || return 1
fi
fi
+ if [ -e autoboot.txt ]
+ then
+ if ! cmp autoboot.txt /mnt/ubifs/autoboot.txt 2> /dev/null
+ then
+ log "updating autoboot.txt"
+ cp -a autoboot.txt /mnt/ubifs/autoboot.txt || return 1
+ fi
+ else
+ # get rid of potentially bad autoboot.txt
+ rm -f /mnt/ubifs/autoboot.txt
+ fi
}
ubiattach /dev/ubi_ctrl -m 3 || true