Guest User

Untitled

a guest
Jul 18th, 2024
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. 'VsOfֆfTboot 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 ${bootargs}
  37. # in u-boot itself via the setenv command.
  38. setenv bootargs "ro no_console_suspend cryptomgr.notests loglevel=3 ${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. #
  45. # This block is only needed for boards which might still run with an older
  46. # version of u-boot and thus might not yet set ${bootargs} correctly.
  47. if test "${board}" = "nitrogen8m_som"; then
  48. setenv bootargs "${bootargs} console=ttymxc0,115200 cma=512M pci=nomsi"
  49. elif test "${board}" = "MNT Reform 2.0"; then
  50. # some imx8mq Reforms have this board value
  51. setenv bootargs "${bootargs} console=ttymxc0,115200 cma=512M pci=nomsi"
  52. elif test "${board}" = "u200"; then
  53. # amlogic internal name for a311d dev board
  54. setenv bootargs "${bootargs} console=ttyAML0,115200 pci=pcie_bus_perf libata.force=noncq nvme_core.default_ps_max_latency_us=0"
  55. elif test "${board}" = "ls1028a"; then
  56. setenv bootargs "${bootargs} console=ttyS0,115200 cma=512M@3G iommu.passthrough=1 arm-smmu.disable_bypass=0"
  57. fi
  58.  
  59. # console=tty1 needs to go at the end of the kernel cmdline because the luks
  60. # passphrase prompt will show up on the last console which must not be the
  61. # serial terminal but the tty displayed to the screen
  62. setenv bootargs "${bootargs} console=tty1"
  63.  
  64. if test -z "${fk_kvers}"; then
  65. setenv fk_kvers '6.9.9-mnt-reform-arm64'
  66. fi
  67.  
  68. # These two blocks should be the same apart from the use of
  69. # ${fk_kvers} in the first, the syntax supported by u-boot does not
  70. # lend itself to removing this duplication.
  71.  
  72. if test -n "${fdtfile}"; then
  73. setenv fdtpath dtbs/${fk_kvers}/${fdtfile}
  74. else
  75. setenv fdtpath dtb-${fk_kvers}
  76. fi
  77.  
  78. if test -z "${distro_bootpart}"; then
  79. setenv partition ${bootpart}
  80. else
  81. setenv partition ${distro_bootpart}
  82. fi
  83.  
  84.  
  85. # place here any u-boot commands to be executed before boot
  86.  
  87. if test -z "${fk_image_locations}"; then
  88. setenv fk_image_locations ${prefix}
  89. fi
  90.  
  91. for pathprefix in ${fk_image_locations}
  92. do
  93. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz-${fk_kvers}
  94. then
  95. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz-${fk_kvers} \
  96. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}${fdtpath} \
  97. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img-${fk_kvers} \
  98. && echo "Booting Debian ${fk_kvers} from ${devtype} ${devnum}:${partition}..." \
  99. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  100. fi
  101. done
  102.  
  103. for pathprefix in ${fk_image_locations}
  104. do
  105. if test -e ${devtype} ${devnum}:${partition} ${pathprefix}vmlinuz
  106. then
  107. load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${pathprefix}vmlinuz \
  108. && load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${pathprefix}dtb \
  109. && load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img \
  110. && echo "Booting Debian from ${devtype} ${devnum}:${partition}..." \
  111. && booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  112. fi
  113. done
Advertisement
Add Comment
Please, Sign In to add comment