From: Eddie Cai Date: Mon, 6 Mar 2017 14:38:54 +0800 Subject: [U-Boot] distro bootcmd: auto write GPT table in scan_dev_for_boot_part Message-ID: <1488782334-31000-1-git-send-email-eddie.cai.linux@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de scan_dev_for_boot_part will fail when there is no GPT table. So add auto write GPT table if fail to get it. Signed-off-by: Eddie Cai --- include/config_distro_bootcmd.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 0e01e82..3be8ffa 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -368,6 +368,14 @@ "\0" \ \ "scan_dev_for_boot_part=" \ + "part list ${devtype} ${devnum} -bootable test; " \ + "if env exists test; then " \ + "echo Found valid partition table; " \ + "else " \ + "echo No valid partition table, write the original partition table; " \ + "gpt write ${devtype} ${devnum} ${partitions}; " \ + "mmc rescan;" \ + "fi;" \ "part list ${devtype} ${devnum} -bootable devplist; " \ "env exists devplist || setenv devplist 1; " \ "for distro_bootpart in ${devplist}; do " \ -- 2.7.4