distro bootcmd: auto write GPT table in scan_dev_for_boot_part
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 <[email protected]>
--- include/config_distro_bootcmd.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/config_distro_bootcmd.h +8 -0
@@ -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 " \
Signature · 1 line
2.7.4
Quoted 17 lines · Eddie Cai
scan_dev_for_boot_partwill fail when there is no GPT table. So add auto write GPT table if fail to get it.Signed-off-by Eddie Cai <[email protected]>--- include/config_distro_bootcmd.h | 8 ++++++++ 1 file changed, 8 insertions(+)include/config_distro_bootcmd.h +1
-0@@ -368,6 +368,14 @@"\0" \ \"scan_dev_for_boot_part=" \ +"part list ${devtype} ${devnum} -bootable test; " \
include/config_distro_bootcmd.h line 381
Quoted 10 lines
include/config_distro_bootcmd.h +7
-0+"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 " \
Er, this feels rather risky to me. Why are we writing a table? How do we know it exists?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170307/aa300201/attachment.sig>