Do you want me to look at it or do you want me to actually test it?
It LOOKS okay. I can test it tomorrow with another SD card if you like.
A different take: (only works if u-boot.mmc is identical to present u-boot)
Code:
recovery() {
dd if=/dev/mmcblk0 bs=128k count=1 skip=6 of=/tmp/u-boot.cur
for uboot in /etc/u-boot/*/u-boot.mmc
do
cmp /tmp/u-boot.cur $uboot \
&& dd if=$(dirname $uboot)/u-boot.recovery of=/dev/mmcblk0 bs=128k count=1 seek=6 \
&& success
done
failure
}
Could also use /mnt/sd/u-boot.backup instead of /tmp/u-boot.cur so - if it doesn't actually boot afterwards you could undo by writing u-boot.backup back to the internal microsd.
Quote:
There are people around who could tell just by reading the script!
|
I'm not so sure. I remember I tried this recovery u-boot at some point and even though I think I did the same things rcS does, it didn't actually work for me. Maybe my mistake, maybe something missing, but testing is important in any case.