Guest User

Untitled

a guest
Oct 9th, 2023
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. 'Vç,Ðze$x’KA†•boot scriptŠ
  2. #
  3. # flash-kernel: bootscr.uboot-generic
  4. #
  5.  
  6. # Bootscript using the new unified bootcmd handling
  7. # introduced with u-boot v2014.10
  8. #
  9. # Expects to be called with the following environment variables set:
  10. #
  11. # devtype e.g. mmc/scsi etc
  12. # devnum The device number of the given type
  13. # bootpart The partition containing the boot files
  14. # distro_bootpart The partition containing the boot files
  15. # (introduced in u-boot mainline 2016.01)
  16. # prefix Prefix within the boot partiion to the boot files
  17. # kernel_addr_r Address to load the kernel to
  18. # fdt_addr_r Address to load the FDT to
  19. # ramdisk_addr_r Address to load the initrd to.
  20. #
  21. # The uboot must support the booti and generic filesystem load commands.
  22.  
  23. # Workaround lack of baudrate included with console on various iMX
  24. # systems (e.g. wandboard, cubox-i, hummingboard)
  25. if test "${console}" = "ttymxc0" && test -n "${baudrate}"; then
  26. setenv console "${console},${baudrate}"
  27. fi
  28.  
  29. if test -n "${console}"; then
  30. setenv bootargs "${bootargs} console=${console}"
  31. fi
  32.  
  33. setenv bootargs "ro no_console_suspend cma=512M pci=nomsi ${bootargs} console=ttymxc0,115200 console=tty1"
  34.  
  35. # Default bootargs for Linux are set here and can be overwritten using
  36. # LINUX_KERNEL_CMDLINE in /etc/default/flash-kernel or by setting them in
  37. # u-boot itself via the setenv command.
  38. setenv bootargs "ro no_console_suspend cma=512M@3G cryptomgr.notests ${bootargs}"
  39.  
  40. # Board-specific bootargs cannot be overwritten by above methods. If you
  41. # really need to overwrite below lines, create
  42. # /etc/flash-kernel/ubootenv.d/00reform2_ubootenv and fill it with what you
  43. # would like to replace the contents of this file with.
  44. if test "${board}" = "nitrogen8m_som"; then
  45. setenv bootargs "${bootargs} console=ttymxc0,115200 pci=nomsi"
  46. elif test "${board}" = "MNT Reform 2.0"; then
  47. # some imx8mq Reforms have this board value
  48. setenv bootargs "${bootargs} console=ttymxc0,115200 pci=nomsi"
  49. elif test "${board}" = "u200"; then
  50. # amlogic internal name for a311d dev board
  51. setenv bootargs "${bootargs} console=ttyAML0,115200 pci=pcie_bus_perf libata.force=noncq nvme_core.default_ps_max_latency_us=0"
  52. elif test "${board}" = "ls1028a"; then
  53. setenv bootargs "${bootargs} console=ttyS0,115200 iommu.passthrough=1 arm-smmu.disable_bypass=0"
  54. fi
  55.  
  56. # console=tty1 needs to go at the end of the kernel cmdline because the luks
  57. # passphrase prompt will show up on the last console which must not be the
  58. # serial terminal but the tty displayed to the screen
  59. setenv bootargs "${bootargs} console=tty1"
  60.  
  61. if test -z "${fk_kvers}"; then
  62. setenv fk_kvers '6.5.0-1-reform2-arm64'
  63. fi
  64.  
  65. # These two blocks should be the same apart from the use of
  66. # ${fk_kvers} in the first, the syntax supported by u-boot does not
  67. # lend itself to removing this duplication.
  68.  
  69. if test -n "${fdtfile}"; then
  70. setenv fdtpath dtbs/${fk_kvers}/${fdtfile}
  71. else
  72. setenv fdtpath dtb-${fk_kvers}
  73. fi
  74.  
  75. if test -z "${distro_bootpart}"; then
  76. setenv partition ${bootpart}
  77. else
  78. setenv partition ${distro_bootpart}
  79. fi
  80.  
  81.  
  82. # We need to set ${fdtfile} in uboot to select a default dtb for boot mediums
  83. # that are supposed to boot on multiple devices like the Debian installer.
  84. #
  85. # But if ${fdtfile} is set, then bootscr.uboot-generic will use that instead of
  86. # the dtb-${fk_kvers} symlink maintained by flash-kernel which will point to
  87. # either the normal or the hdmi dtb for the reform.
  88. #
  89. # This preboot script overwrites ${fdtpath} such that even when ${fdtfile} is
  90. # set to a reasonable default, u-boot will still use dtb-${fk_kvers} if it
  91. # exists -- which it does with sysimage-v3 after running flash-kernel.
  92.  
  93. if test -e ${devtype} ${devnum}:${partition} ${prefix}dtb-${fk_kvers}; then
  94. setenv fdtpath dtb-${fk_kvers}
  95. fi
  96.  
  97.  
  98. if test -z "${fk_image_locations}"; then
  99. setenv fk_image_locations ${prefix}
  100. fi
  101.  
  102. for pathprefix in ${fk_image_locations}
  103. do
  104. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz-${fk_kvers}
  105. then
  106. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz-${fk_kvers} \
  107. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}${fdtpath} \
  108. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img-${fk_kvers} \
  109. && echo "Booting Debian ${fk_kvers} from ${devtype} ${devnum}:${partition}..." \
  110. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  111. fi
  112. done
  113.  
  114. for pathprefix in ${fk_image_locations}
  115. do
  116. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz
  117. then
  118. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz \
  119. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}dtb \
  120. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img \
  121. && echo "Booting Debian from ${devtype} ${devnum}:${partition}..." \
  122. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  123. fi
  124. done
  125.  
Advertisement
Add Comment
Please, Sign In to add comment