mvbc_p_autoscript 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. echo
  2. echo "==== running autoscript ===="
  3. echo
  4. setenv bootdtb bootm \${kernel_boot} \${mv_initrd_addr_ram} \${mv_dtb_addr_ram}
  5. setenv ramkernel setenv kernel_boot \${loadaddr}
  6. setenv flashkernel setenv kernel_boot \${mv_kernel_addr}
  7. setenv cpird cp \${mv_initrd_addr} \${mv_initrd_addr_ram} \${mv_initrd_length}
  8. setenv bootfromflash run flashkernel cpird ramparam addcons e1000para addprofile bootdtb
  9. setenv getdtb tftp \${mv_dtb_addr_ram} \${dtb_name}
  10. setenv cpdtb cp \${mv_dtb_addr} \${mv_dtb_addr_ram} 0x2000
  11. setenv rundtb fdt addr \${mv_dtb_addr_ram}\;fdt boardsetup
  12. setenv bootfromnet tftp \${mv_initrd_addr_ram} \${initrd_name}\;run ramkernel
  13. if test ${console} = yes;
  14. then
  15. setenv addcons setenv bootargs \${bootargs} console=ttyPSC\${console_nr},\${baudrate}N8
  16. else
  17. setenv addcons setenv bootargs \${bootargs} console=tty0
  18. fi
  19. setenv e1000para setenv bootargs \${bootargs} e1000.TxDescriptors=256 e1000.SmartPowerDownEnable=1
  20. setenv set_static_ip setenv ipaddr \${static_ipaddr}
  21. setenv set_static_nm setenv netmask \${static_netmask}
  22. setenv set_static_gw setenv gatewayip \${static_gateway}
  23. setenv set_ip setenv ip \${ipaddr}::\${gatewayip}:\${netmask}
  24. setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs
  25. if test ${oprofile} = yes;
  26. then
  27. setenv addprofile setenv bootargs \${bootargs} profile=\${profile}
  28. fi
  29. if test ${autoscript_boot} != no;
  30. then
  31. if test ${netboot} = yes;
  32. then
  33. bootp
  34. if test $? = 0;
  35. then
  36. echo "=== bootp succeeded -> netboot ==="
  37. run set_ip
  38. run getdtb rundtb bootfromnet ramparam addcons e1000para addprofile bootdtb
  39. else
  40. echo "=== netboot failed ==="
  41. fi
  42. fi
  43. run set_static_ip set_static_nm set_static_gw set_ip
  44. echo "=== bootfromflash ==="
  45. run cpdtb rundtb bootfromflash
  46. else
  47. echo "=== boot stopped with autoscript_boot no ==="
  48. fi