Guest User

boot.scr

a guest
May 29th, 2023
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. 'VBdu|*
  2. 5ldboot script
  3. -
  4. #
  5. # flash-kernel: bootscr.uboot-generic
  6. #
  7.  
  8. # Bootscript using the new unified bootcmd handling
  9. # introduced with u-boot v2014.10
  10. #
  11. # Expects to be called with the following environment variables set:
  12. #
  13. # devtype e.g. mmc/scsi etc
  14. # devnum The device number of the given type
  15. # bootpart The partition containing the boot files
  16. # distro_bootpart The partition containing the boot files
  17. # (introduced in u-boot mainline 2016.01)
  18. # prefix Prefix within the boot partiion to the boot files
  19. # kernel_addr_r Address to load the kernel to
  20. # fdt_addr_r Address to load the FDT to
  21. # ramdisk_addr_r Address to load the initrd to.
  22. #
  23. # The uboot must support the booti and generic filesystem load commands.
  24.  
  25. # Workaround lack of baudrate included with console on various iMX
  26. # systems (e.g. wandboard, cubox-i, hummingboard)
  27. if test "${console}" = "ttymxc0" && test -n "${baudrate}"; then
  28. setenv console "${console},${baudrate}"
  29. fi
  30.  
  31. if test -n "${console}"; then
  32. setenv bootargs "${bootargs} console=${console}"
  33. fi
  34.  
  35. setenv bootargs "ro no_console_suspend cma=512M pci=nomsi ${bootargs} console=ttymxc0,115200 console=tty1"
  36.  
  37. # setenv bootpart "1"
  38. # setenv prefix "/"
  39. # setenv kernel_addr_r "0x40480000"
  40. # setenv fdt_addr_r "0x50000000"
  41. # setenv ramdisk_addr_r "0x51000000"
  42.  
  43. if test -z "${fk_kvers}"; then
  44. setenv fk_kvers '6.1.0-9-reform2-arm64'
  45. fi
  46.  
  47. # These two blocks should be the same apart from the use of
  48. # ${fk_kvers} in the first, the syntax supported by u-boot does not
  49. # lend itself to removing this duplication.
  50.  
  51. if test -n "${fdtfile}"; then
  52. setenv fdtpath dtbs/${fk_kvers}/${fdtfile}
  53. else
  54. setenv fdtpath dtb-${fk_kvers}
  55. fi
  56.  
  57. if test -z "${distro_bootpart}"; then
  58. setenv partition ${bootpart}
  59. else
  60. setenv partition ${distro_bootpart}
  61. fi
  62.  
  63.  
  64. # place here any u-boot commands to be executed before boot
  65.  
  66. if test -z "${fk_image_locations}"; then
  67. setenv fk_image_locations ${prefix}
  68. fi
  69.  
  70. for pathprefix in ${fk_image_locations}
  71. do
  72. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz-${fk_kvers}
  73. then
  74. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz-${fk_kvers} \
  75. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}${fdtpath} \
  76. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img-${fk_kvers} \
  77. && echo "Booting Debian ${fk_kvers} from ${devtype} ${devnum}:${partition}..." \
  78. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  79. fi
  80. done
  81.  
  82. for pathprefix in ${fk_image_locations}
  83. do
  84. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz
  85. then
  86. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz \
  87. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}dtb \
  88. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img \
  89. && echo "Booting Debian from ${devtype} ${devnum}:${partition}..." \
  90. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  91. fi
  92. done
Advertisement
Add Comment
Please, Sign In to add comment