Advertisement
Guest User

bootscr.uboot-generic

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