paul@60 | 1 | #!/bin/sh |
paul@60 | 2 | |
paul@89 | 3 | # To use the installed stage1 payload... |
paul@89 | 4 | |
paul@89 | 5 | if [ "$1" = '--default1' ]; then |
paul@89 | 6 | if xbboot -u 0x81c00000 stage2/stage2.bin ; then |
paul@89 | 7 | exit 0 |
paul@89 | 8 | else |
paul@89 | 9 | exit 1 |
paul@89 | 10 | fi |
paul@89 | 11 | |
paul@89 | 12 | # To use usbboot, which is less elegant but sometimes more reliable... |
paul@89 | 13 | |
paul@89 | 14 | elif [ "$1" = '--usbboot' ]; then |
paul@89 | 15 | if usbboot -c 'boot' -1 stage1/stage1.bin -2 stage2/stage2.bin ; then |
paul@89 | 16 | exit 0 |
paul@89 | 17 | else |
paul@89 | 18 | exit 1 |
paul@89 | 19 | fi |
paul@89 | 20 | fi |
paul@89 | 21 | |
paul@89 | 22 | # Otherwise, use the generated payloads with xbboot. |
paul@89 | 23 | |
paul@89 | 24 | xbboot set_addr 0x80002000 |
paul@89 | 25 | xbboot bulk_write stage1/stage1.bin |
paul@89 | 26 | xbboot start1 0x80002000 |
paul@89 | 27 | xbboot get_info |
paul@89 | 28 | xbboot set_addr 0x81c00000 |
paul@89 | 29 | xbboot bulk_write stage2/stage2.bin |
paul@89 | 30 | xbboot flush_cache |
paul@89 | 31 | xbboot start2 0x81c00000 |