Posted to tcl by hirnpfirsich at Mon Jan 09 00:42:33 GMT 2023view raw
- hirnpfirsich@eima:~/ap_11_flashing$ cat flash-aruba-instant-on-11
- #!/usr/bin/expect -f
- set FIRMWARE_FILE "openwrt-22.03.2-ipq40xx-generic-aruba_ap-303-squashfs-sysupgrade.bin"
- lappend UBOOT_COMMANDS "setenv bootargs_openwrt \"setenv bootargs console=ttyMSM1,9600n8\""
- lappend UBOOT_COMMANDS "setenv nandboot_openwrt \"run bootargs_openwrt; ubi part aos1; ubi read 0x85000000 kernel; set fdt_high 0x87000000; bootm 0x85000000\""
- lappend UBOOT_COMMANDS "setenv ramboot_openwrt \"run bootargs_openwrt; setenv ipaddr 192.168.1.105; setenv serverip 192.168.1.75; netget; set fdt_high 0x87000000; bootm\""
- lappend UBOOT_COMMANDS "setenv bootcmd \"run nandboot_openwrt\""
- lappend UBOOT_COMMANDS "saveenv"
- expect_before {
- timeout { puts "timeout"; exit 1 }
- #timeout { interact ~. exit 0 }
- }
- # set the portID and open it for reading and writing
- set device [lindex $argv 0]
- set portID [open $device r+]
- set baud 9600
- # Configure the port with the baud rate
- # and dont block on read, dont buffer output
- fconfigure $portID -mode "9600,n,8,1"
- fconfigure $portID -blocking 0 -buffering none
- spawn -open $portID
- set serialID $spawn_id
- # stop autobooting procedure
- expect "Hit <Enter> to stop autoboot"
- send "\r"
- # configure uboot to be able to boot OpenWrt
- foreach command $UBOOT_COMMANDS {
- send -i $serialID "$command\r"
- expect -i $serialID "apboot>"
- }
- [...]
- hirnpfirsich@eima:~/ap_11_flashing$ sudo ./flash-aruba-instant-on-11 /dev/ttyUSB0
- spawn [open ...]
- APBoot 2.5.0.2 (build 70487)
- Built: 2019-05-14 at 12:27:57
- Model: AP11
- DRAM: 512 MiB
- Flash: Detected MX25R3235F: with write protection total 4 MiB
- NAND: 128 MiB
- Power: DC
- Net: eth0
- Radio: ipq4019#0, ipq4019#1
- FIPS: passed
- Hit <Enter> to stop autoboot: 0
- apboot> setenv bootargs_openwrt "setenv bootargs console=ttyMSM1,9600n8"
- þÚÚڂíííííííííííííííííííííííííííí
- ^Chirnpfirsich@eima:~/ap_11_flashing$
Comments
Posted by hirnpfirsich at Mon Jan 09 01:20:22 GMT 2023 [text] [code]
just printing them works fine hirnpfirsich@eima:~/ap_11_flashing$ sudo ./flash-aruba-instant-on-11 /dev/ttyUSB0 spawn [open ...] 0 apboot> APBoot 2.5.0.2 (build 70487) Built: 2019-05-14 at 12:27:57 Model: AP11 DRAM: 512 MiB Flash: Detected MX25R3235F: with write protection total 4 MiB NAND: 128 MiB Power: DC Net: eth0 Radio: ipq4019#0, ipq4019#1 FIPS: passed Hit <Enter> to stop autoboot: 2 Would send command: setenv bootargs_openwrt "setenv bootargs console=ttyMSM1,9600n8" Would send command: setenv nandboot_openwrt "run bootargs_openwrt; ubi part aos1; ubi read 0x85000000 kernel; set fdt_high 0x87000000; bootm 0x85000000" Would send command: setenv ramboot_openwrt "run bootargs_openwrt; setenv ipaddr 192.168.1.105; setenv serverip 192.168.1.75; netget; set fdt_high 0x87000000; bootm" Would send command: setenv bootcmd "run nandboot_openwrt" Would send command: saveenv