|
| 1 | +#ifndef _TOW_BOOT_ENV_H |
| 2 | +#define _TOW_BOOT_ENV_H |
| 3 | + |
| 4 | +#ifdef CONFIG_CMD_POWEROFF |
| 5 | +#define TOW_BOOT_MAYBE_POWEROFF "tb_menu add 'Shutdown' 'Powers off the device' 'poweroff';" |
| 6 | +#else |
| 7 | +#define TOW_BOOT_MAYBE_POWEROFF |
| 8 | +#endif |
| 9 | + |
| 10 | +#ifdef CONFIG_CMD_USB |
| 11 | +#define TOW_BOOT_MAYBE_USB "tb_menu add 'Rescan USB' 'Look for new USB devices' \"usb reset; $menucmd\";" |
| 12 | +#else |
| 13 | +#define TOW_BOOT_MAYBE_USB |
| 14 | +#endif |
| 15 | + |
| 16 | +#define TOW_BOOT_ENV \ |
| 17 | + /* Used internally to check updater runs on the right board. */ \ |
| 18 | + "board_identifier=@boardIdentifier@\0" \ |
| 19 | + \ |
| 20 | + /* By default, no setup for LEDs */ \ |
| 21 | + "setup_leds=echo\0" \ |
| 22 | + "bootcmd=run setup_leds; run distro_bootcmd\0" \ |
| 23 | + "target_name_mmc0=" CONFIG_TOW_BOOT_MMC0_NAME "\0" \ |
| 24 | + "target_name_mmc1=" CONFIG_TOW_BOOT_MMC1_NAME "\0" \ |
| 25 | + "target_name_mmc2=" CONFIG_TOW_BOOT_MMC2_NAME "\0" \ |
| 26 | + "target_name_usb0=USB\0" \ |
| 27 | + "target_name_nvme0=NVME\0" \ |
| 28 | + "target_name_pxe=PXE\0" \ |
| 29 | + "target_name_dhcp=DHCP\0" \ |
| 30 | + \ |
| 31 | + \ |
| 32 | + "towboot_menu=" \ |
| 33 | + /* Builds the boot options in the same order distro_bootcmd uses. */ \ |
| 34 | + "tb_menu new;" \ |
| 35 | + "for target in ${boot_targets}; do" \ |
| 36 | + /* # Skip fel as it has no value for end-users */ \ |
| 37 | + " if test \"$target\" != fel; then" \ |
| 38 | + " env indirect target_name target_name_${target} \"(${target})\";" \ |
| 39 | + " tb_menu add \"Boot from ${target_name}\" '' \"run bootcmd_${target}; echo ${target_name} Boot failed.; pause; $menucmd\" ;" \ |
| 40 | + " fi;" \ |
| 41 | + "done;" \ |
| 42 | + \ |
| 43 | + "tb_menu separator;" \ |
| 44 | + TOW_BOOT_MAYBE_USB \ |
| 45 | + /* In the future, this would be "Firmware Options". */ \ |
| 46 | + "tb_menu add 'Firmware Console' 'Go to the console' 'cls; echo; echo \"Use `run menucmd` to return to the menu.\" ; echo' ;" \ |
| 47 | + "tb_menu separator;" \ |
| 48 | + /* `reset` is universal. Power off is optional */ \ |
| 49 | + "tb_menu add 'Reboot' 'Reboots the device' 'reset';" \ |
| 50 | + TOW_BOOT_MAYBE_POWEROFF \ |
| 51 | + /* Show this menu! */ \ |
| 52 | + "tb_menu show" \ |
| 53 | + "\0" \ |
| 54 | + \ |
| 55 | + \ |
| 56 | + "menucmd=run towboot_menu\0" \ |
| 57 | + |
| 58 | +#endif |
0 commit comments