diff --git a/modules/hardware/allwinner/0001-sunxi-Use-mmc_get_env_dev-only-if-relevant.patch b/modules/hardware/allwinner/0001-sunxi-Use-mmc_get_env_dev-only-if-relevant.patch new file mode 100644 index 00000000..b90e6e38 --- /dev/null +++ b/modules/hardware/allwinner/0001-sunxi-Use-mmc_get_env_dev-only-if-relevant.patch @@ -0,0 +1,34 @@ +From 30da7f7745f15ead3a5bbc7e99a421bdb9009855 Mon Sep 17 00:00:00 2001 +From: Samuel Dionne-Riel +Date: Tue, 22 Feb 2022 10:51:33 -0500 +Subject: [PATCH] sunxi: Use mmc_get_env_dev only if relevant + +When build is made with environment elsewhere than on MMC, the reference +to `CONFIG_SYS_MMC_ENV_DEV` will not exist, and thus this fails. +--- + board/sunxi/board.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +index 1a46100e408..689034355e8 100644 +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -637,6 +637,7 @@ int board_mmc_init(struct bd_info *bis) + return 0; + } + ++#ifdef CONFIG_SYS_MMC_ENV_DEV + #if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1 + int mmc_get_env_dev(void) + { +@@ -651,6 +652,7 @@ int mmc_get_env_dev(void) + } + #endif + #endif ++#endif + + #ifdef CONFIG_SPL_BUILD + +-- +2.34.0 + diff --git a/modules/hardware/allwinner/default.nix b/modules/hardware/allwinner/default.nix index fbef9d4f..78ce0d2e 100644 --- a/modules/hardware/allwinner/default.nix +++ b/modules/hardware/allwinner/default.nix @@ -79,6 +79,9 @@ in mmc bootbus ${mmcBootIndex} 1 0 0 mmc partconf ${mmcBootIndex} 1 1 1 ''; + patches = [ + ./0001-sunxi-Use-mmc_get_env_dev-only-if-relevant.patch + ]; }; }) (mkIf (anyAllwinner64) {