u-boot

Post Reply
markosgreece
Posts: 21
Joined: Mon Jun 28, 2021 2:58 pm

u-boot

Post by markosgreece »

On WRT 3200 acm
Change the boot order as you prefer.
For your needs change the paths to a) scsi or usb , b) 0 or 0:1 depends from your partition scheme, c)/workingfolder/rango.img
Rename your Firmware image to rango.img (WRT3200acm codename) and put it to the right path /workingfolder.

...This the trick

-nandboot 1st try from scsi port ,if fails then try to boot from usb port ,if fails boot from nand2 = /dev/mtdblock8 = Dd-wrt
-altnandboot 1st try from nand 2 =Dd-wrt ,if fails then boot from nand1 /dev/mtdblock6 = Original Linksys firmware.
-uboot =Better never need it! But i believe will be uselless that time.~~



______________________________________________________________________________________________________________________________

setenv nandboot 'run Extboot'
______

setenv Extboot 'scsi reset;ext4ls scsi 0:2 image ; run nandbootExtboot || echo ;echo -----------------> boot Fail from E-sata port, lets try with Usb...;sleep 5 ; usb reset ;ext4ls usb 0 boot/kernel/image ; || echo ;echo ----------> External Partitions Failed E-sata and Usb; echo -----------------> Lets try nand2 mtd8 Dd-wrt;echo ;sleep 5; run altnandboot;'
______

setenv nandbootExtboot 'setenv bootargs console=ttyS0,115200 panic=5 root=/dev/sda1 rw rootdelay=5 rootfstype=ext4 init=/sbin/init earlyprintk $mtdparts; usb reset; scsi reset; ext4load scsi 0:2 $defaultLoadAddr /image/rango.img; echo " "; echo "^"; echo "^^"; echo "-> Booting Debian from E-SATA port"; echo "^^"; echo "^"; echo " "; sleep 5; bootm $defaultLoadAddr ; || setenv bootargs console=ttyS0,115200 panic=5 root=/dev/sda1 rw rootdelay=5 rootfstype=ext4 init=/sbin/init earlyprintk $mtdparts; scsi reset; usb reset; ext4load usb 0 boot/kernel/image $defaultLoadAddr /boot/kernel/image/rango.img; echo " "; echo "^"; echo "^^"; echo "Failed to boot from E-sata port"; echo "-> Booting Debian from Usb port"; echo "^^"; echo "^"; echo " "; sleep 5; bootm $defaultLoadAddr'
______

setenv altnandboot 'setenv bootargs console=ttyS0,115200 rootwait panic=5 root=/dev/mtdblock8 ro rootdelay=1 rootfstype=jffs2 earlyprintk $mtdparts; nand read $defaultLoadAddr $altKernAddr $altKernSize; echo " "; echo "^"; echo "^^"; echo "-----------------> altnandboot"; echo "-----------------------------> Booting from mtdblock8 (nand2/alternativeKernel), DD-WRT firmware"; echo "^^"; echo "^"; echo " "; sleep 5; bootm $defaultLoadAddr || setenv bootargs console=ttyS0,115200 root=/dev/mtdblock6 ro rootdelay=1 rootfstype=jffs2 earlyprintk $mtdparts; nand read $defaultLoadAddr $priKernAddr $priKernSize; echo " "; echo "^"; echo "^^"; echo "-----------------> altnandboot"; echo "Failed to boot DD-WRT"; echo "-----------------------------> Booting from mtdblock6 (nand1/primary Kernel), Linksys original firmware"; echo "^^"; echo "^"; echo " "; sleep 5; bootm $defaultLoadAddr'
______

setenv uboot 'scsi reset ;ext4ls scsi 0:2 uboot ;echo ;echo Found mtd0.bin on E-sata; echo ;sleep 5;ext4write scsi 0:2 /u-boot/mtd0.bin 0x2000000 0x200000 ; || usb reset ;ext4ls usb 0 boot/kernel/u-boot ;echo ;echo Found mtd0.bin on Usb; echo ;ext4write usb 0 /boot/kernel/u-boot/mtd0.bin 0x2000000 0x200000 ; || echo Caution no mtd0.bin found...; sleep 10 ;'
______

# If you prefer to give a try without to save the changes

run nandboot
Or
run altnandboot

# Finally save your new boot order.

saveenv



______________________________________________________________________________________________________________________________

->Notice : If above commands rejected, write with hand
setenv NAME 'and after paste the rest' with no spaces to the end

# Choice from where to boot.

run nandboot
run altnandboot

# Reset if you make a mistake ,and restart the unit without saving your changes.
reset

# Erase an variable
setenv -f uboot

-Of course if everything fails
# Revert to stock settings
setenv default -a

______________________________________________________________________________________________________________________________

A McDebian pill for a:

BRICKLESS
Or better
UNBRICKABLE

WRT 1200_1900_3200_32xx.
LINKSYS hardware board.
Post Reply