Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2014 |
| 3 | * NVIDIA Corporation <www.nvidia.com> |
| 4 | * |
| 5 | * Copyright 2014 Red Hat, Inc. |
| 6 | * |
| 7 | * SPDX-License-Identifier: GPL-2.0+ |
| 8 | */ |
| 9 | |
| 10 | #ifndef _CONFIG_CMD_DISTRO_BOOTCMD_H |
| 11 | #define _CONFIG_CMD_DISTRO_BOOTCMD_H |
| 12 | |
Stephen Warren | 90b7caa | 2015-03-10 15:40:58 -0600 | [diff] [blame] | 13 | /* |
| 14 | * A note on error handling: It is possible for BOOT_TARGET_DEVICES to |
| 15 | * reference a device that is not enabled in the U-Boot configuration, e.g. |
| 16 | * it may include MMC in the list without CONFIG_CMD_MMC being enabled. Given |
| 17 | * that BOOT_TARGET_DEVICES is a macro that's expanded by the C pre-processor |
| 18 | * at compile time, it's not possible to detect and report such problems via |
| 19 | * a simple #ifdef/#error combination. Still, the code needs to report errors. |
| 20 | * The best way I've found to do this is to make BOOT_TARGET_DEVICES expand to |
| 21 | * reference a non-existent symbol, and have the name of that symbol encode |
| 22 | * the error message. Consequently, this file contains references to e.g. |
| 23 | * BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC. Given the |
| 24 | * prevalence of capitals here, this looks like a pre-processor macro and |
| 25 | * hence seems like it should be all capitals, but it's really an error |
| 26 | * message that includes some other pre-processor symbols in the text. |
| 27 | */ |
| 28 | |
Hans de Goede | af21f2f | 2015-02-07 13:38:19 +0100 | [diff] [blame] | 29 | /* We need the part command */ |
| 30 | #define CONFIG_PARTITION_UUIDS |
| 31 | #define CONFIG_CMD_PART |
| 32 | |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 33 | #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \ |
| 34 | "if " #devtypel " dev ${devnum}; then " \ |
| 35 | "setenv devtype " #devtypel "; " \ |
Sjoerd Simons | 735b1cf | 2015-01-05 18:13:38 +0100 | [diff] [blame] | 36 | "run scan_dev_for_boot_part; " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 37 | "fi\0" |
| 38 | |
| 39 | #define BOOTENV_SHARED_BLKDEV(devtypel) \ |
| 40 | #devtypel "_boot=" \ |
| 41 | BOOTENV_SHARED_BLKDEV_BODY(devtypel) |
| 42 | |
| 43 | #define BOOTENV_DEV_BLKDEV(devtypeu, devtypel, instance) \ |
| 44 | "bootcmd_" #devtypel #instance "=" \ |
| 45 | "setenv devnum " #instance "; " \ |
| 46 | "run " #devtypel "_boot\0" |
| 47 | |
| 48 | #define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \ |
| 49 | #devtypel #instance " " |
| 50 | |
Sjoerd Simons | d0bce0d | 2015-04-13 22:54:24 +0200 | [diff] [blame] | 51 | #ifdef CONFIG_SANDBOX |
| 52 | #define BOOTENV_SHARED_HOST BOOTENV_SHARED_BLKDEV(host) |
| 53 | #define BOOTENV_DEV_HOST BOOTENV_DEV_BLKDEV |
| 54 | #define BOOTENV_DEV_NAME_HOST BOOTENV_DEV_NAME_BLKDEV |
| 55 | #else |
| 56 | #define BOOTENV_SHARED_HOST |
| 57 | #define BOOTENV_DEV_HOST \ |
| 58 | BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX |
| 59 | #define BOOTENV_DEV_NAME_HOST \ |
| 60 | BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX |
| 61 | #endif |
| 62 | |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 63 | #ifdef CONFIG_CMD_MMC |
| 64 | #define BOOTENV_SHARED_MMC BOOTENV_SHARED_BLKDEV(mmc) |
| 65 | #define BOOTENV_DEV_MMC BOOTENV_DEV_BLKDEV |
| 66 | #define BOOTENV_DEV_NAME_MMC BOOTENV_DEV_NAME_BLKDEV |
| 67 | #else |
| 68 | #define BOOTENV_SHARED_MMC |
| 69 | #define BOOTENV_DEV_MMC \ |
| 70 | BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC |
| 71 | #define BOOTENV_DEV_NAME_MMC \ |
| 72 | BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC |
| 73 | #endif |
| 74 | |
Roy Spliet | 40d2154 | 2015-09-17 18:46:59 -0400 | [diff] [blame] | 75 | #ifdef CONFIG_CMD_UBIFS |
| 76 | #define BOOTENV_SHARED_UBIFS \ |
| 77 | "ubifs_boot=" \ |
| 78 | "if ubi part UBI && ubifsmount ubi${devnum}:boot; then " \ |
| 79 | "setenv devtype ubi; " \ |
| 80 | "setenv bootpart 0; " \ |
| 81 | "run scan_dev_for_boot; " \ |
| 82 | "fi\0" |
| 83 | #define BOOTENV_DEV_UBIFS BOOTENV_DEV_BLKDEV |
| 84 | #define BOOTENV_DEV_NAME_UBIFS BOOTENV_DEV_NAME_BLKDEV |
| 85 | #else |
| 86 | #define BOOTENV_SHARED_UBIFS |
| 87 | #define BOOTENV_DEV_UBIFS \ |
| 88 | BOOT_TARGET_DEVICES_references_UBIFS_without_CONFIG_CMD_UBIFS |
| 89 | #define BOOTENV_DEV_NAME_UBIFS \ |
| 90 | BOOT_TARGET_DEVICES_references_UBIFS_without_CONFIG_CMD_UBIFS |
| 91 | #endif |
| 92 | |
Alexander Graf | 74522c8 | 2016-03-10 00:26:15 +0100 | [diff] [blame] | 93 | #ifdef CONFIG_EFI_LOADER |
| 94 | #if defined(CONFIG_ARM64) |
| 95 | #define BOOTEFI_NAME "bootaa64.efi" |
| 96 | #elif defined(CONFIG_ARM) |
| 97 | #define BOOTEFI_NAME "bootarm.efi" |
| 98 | #endif |
| 99 | #endif |
| 100 | |
| 101 | #ifdef BOOTEFI_NAME |
| 102 | #define BOOTENV_SHARED_EFI \ |
| 103 | "boot_efi_binary=" \ |
| 104 | "load ${devtype} ${devnum}:${distro_bootpart} " \ |
| 105 | "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \ |
| 106 | "bootefi ${kernel_addr_r}\0" \ |
| 107 | \ |
| 108 | "load_efi_dtb=" \ |
| 109 | "load ${devtype} ${devnum}:${distro_bootpart} " \ |
Alexander Graf | da3e620 | 2016-03-04 01:10:11 +0100 | [diff] [blame^] | 110 | "${fdt_addr_r} ${prefix}${fdtfile}; " \ |
Alexander Graf | 74522c8 | 2016-03-10 00:26:15 +0100 | [diff] [blame] | 111 | "fdt addr ${fdt_addr_r}\0" \ |
| 112 | \ |
| 113 | "efi_dtb_prefixes=/ /dtb/ /dtb/current/\0" \ |
| 114 | "scan_dev_for_efi=" \ |
| 115 | "for prefix in ${efi_dtb_prefixes}; do " \ |
| 116 | "if test -e ${devtype} " \ |
| 117 | "${devnum}:${distro_bootpart} " \ |
Alexander Graf | da3e620 | 2016-03-04 01:10:11 +0100 | [diff] [blame^] | 118 | "${prefix}${fdtfile}; then " \ |
Alexander Graf | 74522c8 | 2016-03-10 00:26:15 +0100 | [diff] [blame] | 119 | "run load_efi_dtb; " \ |
| 120 | "fi;" \ |
| 121 | "done;" \ |
| 122 | "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ |
| 123 | "efi/boot/"BOOTEFI_NAME"; then " \ |
| 124 | "echo Found EFI removable media binary " \ |
| 125 | "efi/boot/"BOOTEFI_NAME"; " \ |
| 126 | "run boot_efi_binary; " \ |
| 127 | "echo EFI LOAD FAILED: continuing...; " \ |
| 128 | "fi; \0" |
| 129 | #define SCAN_DEV_FOR_EFI "run scan_dev_for_efi;" |
| 130 | #else |
| 131 | #define BOOTENV_SHARED_EFI |
| 132 | #define SCAN_DEV_FOR_EFI |
| 133 | #endif |
| 134 | |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 135 | #ifdef CONFIG_CMD_SATA |
| 136 | #define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata) |
| 137 | #define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV |
| 138 | #define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV |
| 139 | #else |
| 140 | #define BOOTENV_SHARED_SATA |
| 141 | #define BOOTENV_DEV_SATA \ |
| 142 | BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA |
| 143 | #define BOOTENV_DEV_NAME_SATA \ |
| 144 | BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA |
| 145 | #endif |
| 146 | |
| 147 | #ifdef CONFIG_CMD_SCSI |
Hans de Goede | a03bdaa | 2014-09-16 09:26:23 +0200 | [diff] [blame] | 148 | #define BOOTENV_RUN_SCSI_INIT "run scsi_init; " |
| 149 | #define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; " |
| 150 | #define BOOTENV_SHARED_SCSI \ |
| 151 | "scsi_init=" \ |
| 152 | "if ${scsi_need_init}; then " \ |
| 153 | "setenv scsi_need_init false; " \ |
| 154 | "scsi scan; " \ |
| 155 | "fi\0" \ |
| 156 | \ |
| 157 | "scsi_boot=" \ |
| 158 | BOOTENV_RUN_SCSI_INIT \ |
| 159 | BOOTENV_SHARED_BLKDEV_BODY(scsi) |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 160 | #define BOOTENV_DEV_SCSI BOOTENV_DEV_BLKDEV |
| 161 | #define BOOTENV_DEV_NAME_SCSI BOOTENV_DEV_NAME_BLKDEV |
| 162 | #else |
Hans de Goede | a03bdaa | 2014-09-16 09:26:23 +0200 | [diff] [blame] | 163 | #define BOOTENV_RUN_SCSI_INIT |
| 164 | #define BOOTENV_SET_SCSI_NEED_INIT |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 165 | #define BOOTENV_SHARED_SCSI |
| 166 | #define BOOTENV_DEV_SCSI \ |
| 167 | BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI |
| 168 | #define BOOTENV_DEV_NAME_SCSI \ |
| 169 | BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI |
| 170 | #endif |
| 171 | |
| 172 | #ifdef CONFIG_CMD_IDE |
| 173 | #define BOOTENV_SHARED_IDE BOOTENV_SHARED_BLKDEV(ide) |
| 174 | #define BOOTENV_DEV_IDE BOOTENV_DEV_BLKDEV |
| 175 | #define BOOTENV_DEV_NAME_IDE BOOTENV_DEV_NAME_BLKDEV |
| 176 | #else |
| 177 | #define BOOTENV_SHARED_IDE |
| 178 | #define BOOTENV_DEV_IDE \ |
| 179 | BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE |
| 180 | #define BOOTENV_DEV_NAME_IDE \ |
| 181 | BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE |
| 182 | #endif |
| 183 | |
Stephen Warren | 986691f | 2016-01-26 11:10:13 -0700 | [diff] [blame] | 184 | #if defined(CONFIG_CMD_PCI_ENUM) || defined(CONFIG_DM_PCI) |
| 185 | #define BOOTENV_RUN_NET_PCI_ENUM "run boot_net_pci_enum; " |
| 186 | #define BOOTENV_SHARED_PCI \ |
| 187 | "boot_net_pci_enum=pci enum\0" |
| 188 | #else |
| 189 | #define BOOTENV_RUN_NET_PCI_ENUM |
| 190 | #define BOOTENV_SHARED_PCI |
| 191 | #endif |
| 192 | |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 193 | #ifdef CONFIG_CMD_USB |
Stephen Warren | 3483b75 | 2016-01-26 11:10:12 -0700 | [diff] [blame] | 194 | #define BOOTENV_RUN_NET_USB_START "run boot_net_usb_start; " |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 195 | #define BOOTENV_SHARED_USB \ |
Stephen Warren | 3483b75 | 2016-01-26 11:10:12 -0700 | [diff] [blame] | 196 | "boot_net_usb_start=usb start\0" \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 197 | "usb_boot=" \ |
Stephen Warren | 3483b75 | 2016-01-26 11:10:12 -0700 | [diff] [blame] | 198 | "usb start; " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 199 | BOOTENV_SHARED_BLKDEV_BODY(usb) |
| 200 | #define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV |
| 201 | #define BOOTENV_DEV_NAME_USB BOOTENV_DEV_NAME_BLKDEV |
| 202 | #else |
Stephen Warren | 3483b75 | 2016-01-26 11:10:12 -0700 | [diff] [blame] | 203 | #define BOOTENV_RUN_NET_USB_START |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 204 | #define BOOTENV_SHARED_USB |
| 205 | #define BOOTENV_DEV_USB \ |
| 206 | BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB |
| 207 | #define BOOTENV_DEV_NAME_USB \ |
| 208 | BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB |
| 209 | #endif |
| 210 | |
| 211 | #if defined(CONFIG_CMD_DHCP) |
| 212 | #define BOOTENV_DEV_DHCP(devtypeu, devtypel, instance) \ |
| 213 | "bootcmd_dhcp=" \ |
Stephen Warren | 3483b75 | 2016-01-26 11:10:12 -0700 | [diff] [blame] | 214 | BOOTENV_RUN_NET_USB_START \ |
Stephen Warren | 986691f | 2016-01-26 11:10:13 -0700 | [diff] [blame] | 215 | BOOTENV_RUN_NET_PCI_ENUM \ |
Stephen Warren | cc11b39 | 2015-01-19 16:39:11 -0700 | [diff] [blame] | 216 | "if dhcp ${scriptaddr} ${boot_script_dhcp}; then " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 217 | "source ${scriptaddr}; " \ |
| 218 | "fi\0" |
| 219 | #define BOOTENV_DEV_NAME_DHCP(devtypeu, devtypel, instance) \ |
| 220 | "dhcp " |
| 221 | #else |
| 222 | #define BOOTENV_DEV_DHCP \ |
| 223 | BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP |
| 224 | #define BOOTENV_DEV_NAME_DHCP \ |
| 225 | BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP |
| 226 | #endif |
| 227 | |
| 228 | #if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE) |
| 229 | #define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \ |
| 230 | "bootcmd_pxe=" \ |
Stephen Warren | 3483b75 | 2016-01-26 11:10:12 -0700 | [diff] [blame] | 231 | BOOTENV_RUN_NET_USB_START \ |
Stephen Warren | 986691f | 2016-01-26 11:10:13 -0700 | [diff] [blame] | 232 | BOOTENV_RUN_NET_PCI_ENUM \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 233 | "dhcp; " \ |
| 234 | "if pxe get; then " \ |
| 235 | "pxe boot; " \ |
| 236 | "fi\0" |
| 237 | #define BOOTENV_DEV_NAME_PXE(devtypeu, devtypel, instance) \ |
| 238 | "pxe " |
| 239 | #else |
| 240 | #define BOOTENV_DEV_PXE \ |
| 241 | BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE |
| 242 | #define BOOTENV_DEV_NAME_PXE \ |
| 243 | BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE |
| 244 | #endif |
| 245 | |
| 246 | #define BOOTENV_DEV_NAME(devtypeu, devtypel, instance) \ |
| 247 | BOOTENV_DEV_NAME_##devtypeu(devtypeu, devtypel, instance) |
| 248 | #define BOOTENV_BOOT_TARGETS \ |
| 249 | "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0" |
| 250 | |
| 251 | #define BOOTENV_DEV(devtypeu, devtypel, instance) \ |
| 252 | BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance) |
| 253 | #define BOOTENV \ |
Sjoerd Simons | d0bce0d | 2015-04-13 22:54:24 +0200 | [diff] [blame] | 254 | BOOTENV_SHARED_HOST \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 255 | BOOTENV_SHARED_MMC \ |
Stephen Warren | 986691f | 2016-01-26 11:10:13 -0700 | [diff] [blame] | 256 | BOOTENV_SHARED_PCI \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 257 | BOOTENV_SHARED_USB \ |
| 258 | BOOTENV_SHARED_SATA \ |
| 259 | BOOTENV_SHARED_SCSI \ |
| 260 | BOOTENV_SHARED_IDE \ |
Roy Spliet | 40d2154 | 2015-09-17 18:46:59 -0400 | [diff] [blame] | 261 | BOOTENV_SHARED_UBIFS \ |
Alexander Graf | 74522c8 | 2016-03-10 00:26:15 +0100 | [diff] [blame] | 262 | BOOTENV_SHARED_EFI \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 263 | "boot_prefixes=/ /boot/\0" \ |
| 264 | "boot_scripts=boot.scr.uimg boot.scr\0" \ |
Stephen Warren | cc11b39 | 2015-01-19 16:39:11 -0700 | [diff] [blame] | 265 | "boot_script_dhcp=boot.scr.uimg\0" \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 266 | BOOTENV_BOOT_TARGETS \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 267 | \ |
| 268 | "boot_extlinux=" \ |
Sjoerd Simons | 59d03cb | 2015-08-28 15:01:54 +0200 | [diff] [blame] | 269 | "sysboot ${devtype} ${devnum}:${distro_bootpart} any " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 270 | "${scriptaddr} ${prefix}extlinux/extlinux.conf\0" \ |
| 271 | \ |
| 272 | "scan_dev_for_extlinux=" \ |
Sjoerd Simons | 59d03cb | 2015-08-28 15:01:54 +0200 | [diff] [blame] | 273 | "if test -e ${devtype} " \ |
| 274 | "${devnum}:${distro_bootpart} " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 275 | "${prefix}extlinux/extlinux.conf; then " \ |
| 276 | "echo Found ${prefix}extlinux/extlinux.conf; " \ |
| 277 | "run boot_extlinux; " \ |
| 278 | "echo SCRIPT FAILED: continuing...; " \ |
| 279 | "fi\0" \ |
| 280 | \ |
| 281 | "boot_a_script=" \ |
Sjoerd Simons | 59d03cb | 2015-08-28 15:01:54 +0200 | [diff] [blame] | 282 | "load ${devtype} ${devnum}:${distro_bootpart} " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 283 | "${scriptaddr} ${prefix}${script}; " \ |
| 284 | "source ${scriptaddr}\0" \ |
| 285 | \ |
| 286 | "scan_dev_for_scripts=" \ |
| 287 | "for script in ${boot_scripts}; do " \ |
Sjoerd Simons | 59d03cb | 2015-08-28 15:01:54 +0200 | [diff] [blame] | 288 | "if test -e ${devtype} " \ |
| 289 | "${devnum}:${distro_bootpart} " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 290 | "${prefix}${script}; then " \ |
| 291 | "echo Found U-Boot script " \ |
| 292 | "${prefix}${script}; " \ |
| 293 | "run boot_a_script; " \ |
| 294 | "echo SCRIPT FAILED: continuing...; " \ |
| 295 | "fi; " \ |
| 296 | "done\0" \ |
| 297 | \ |
| 298 | "scan_dev_for_boot=" \ |
Sjoerd Simons | 59d03cb | 2015-08-28 15:01:54 +0200 | [diff] [blame] | 299 | "echo Scanning ${devtype} " \ |
| 300 | "${devnum}:${distro_bootpart}...; " \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 301 | "for prefix in ${boot_prefixes}; do " \ |
| 302 | "run scan_dev_for_extlinux; " \ |
| 303 | "run scan_dev_for_scripts; " \ |
Alexander Graf | 74522c8 | 2016-03-10 00:26:15 +0100 | [diff] [blame] | 304 | "done;" \ |
| 305 | SCAN_DEV_FOR_EFI \ |
| 306 | "\0" \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 307 | \ |
Sjoerd Simons | 735b1cf | 2015-01-05 18:13:38 +0100 | [diff] [blame] | 308 | "scan_dev_for_boot_part=" \ |
Sjoerd Simons | f643d92 | 2015-02-25 23:23:52 +0100 | [diff] [blame] | 309 | "part list ${devtype} ${devnum} -bootable devplist; " \ |
| 310 | "env exists devplist || setenv devplist 1; " \ |
Sjoerd Simons | 59d03cb | 2015-08-28 15:01:54 +0200 | [diff] [blame] | 311 | "for distro_bootpart in ${devplist}; do " \ |
| 312 | "if fstype ${devtype} " \ |
| 313 | "${devnum}:${distro_bootpart} " \ |
Sjoerd Simons | 735b1cf | 2015-01-05 18:13:38 +0100 | [diff] [blame] | 314 | "bootfstype; then " \ |
| 315 | "run scan_dev_for_boot; " \ |
| 316 | "fi; " \ |
| 317 | "done\0" \ |
| 318 | \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 319 | BOOT_TARGET_DEVICES(BOOTENV_DEV) \ |
| 320 | \ |
Sjoerd Simons | 453c6cc | 2015-01-05 18:13:39 +0100 | [diff] [blame] | 321 | "distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT \ |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 322 | "for target in ${boot_targets}; do " \ |
| 323 | "run bootcmd_${target}; " \ |
| 324 | "done\0" |
| 325 | |
Sjoerd Simons | 453c6cc | 2015-01-05 18:13:39 +0100 | [diff] [blame] | 326 | #ifndef CONFIG_BOOTCOMMAND |
| 327 | #define CONFIG_BOOTCOMMAND "run distro_bootcmd" |
| 328 | #endif |
| 329 | |
Dennis Gilmore | 2a43201 | 2014-07-30 16:37:14 -0600 | [diff] [blame] | 330 | #endif /* _CONFIG_CMD_DISTRO_BOOTCMD_H */ |