Skip to content

Commit

Permalink
configs: apple: Override scan_dev_for_boot_part from distro_bootcmds
Browse files Browse the repository at this point in the history
Asahi explores the idea of using a distinct EFI system partition per
installation. This will only work if u-boot boots only a specific ESP.
The override for scan_dev_for_boot_part tests for a UUID match before it
tries to boot from a partition.

The optional UUID for the ESP can be specified by m1n1 by setting the
"boot_esp" environment variable in the "/config" "bootcmd" property.

/ {
	config {
		bootcmd = "setenv boot_esp $UUID; run distro_bootcmd; env delete boot_esp; run distro_bootcmd;";
	};
};

Signed-off-by: Janne Grunau <j@jannau.net>
  • Loading branch information
jannau committed Feb 20, 2022
1 parent 0a50f5d commit d490a5c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion include/configs/apple.h
Expand Up @@ -27,8 +27,27 @@

#include <config_distro_bootcmd.h>

#define BOOTENV_OVERRIDE \
"scan_dev_for_boot_part=" \
"part list ${devtype} ${devnum} -bootable devplist; " \
"env exists devplist || setenv devplist 1; " \
"for distro_bootpart in ${devplist}; do " \
"part uuid ${devtype} ${devnum}:${distro_bootpart} " \
"bootuuid; " \
"if test U${bootuuid} = U${boot_esp} -o -z ${boot_esp}; then " \
"echo bootuuid=${bootuuid} boot_esp=${boot_esp}; "\
"if fstype ${devtype} " \
"${devnum}:${distro_bootpart} " \
"bootfstype; then " \
"run scan_dev_for_boot; " \
"fi; " \
"fi; " \
"done; " \
"setenv devplist\0"

#define CONFIG_EXTRA_ENV_SETTINGS \
ENV_DEVICE_SETTINGS \
BOOTENV
BOOTENV \
BOOTENV_OVERRIDE

#endif

0 comments on commit d490a5c

Please sign in to comment.