x86: theadorable-x86: Generate and pass root=PARTUUID instead of /dev/sdaX
authorStefan Roese <sr@denx.de>
Mon, 22 Oct 2018 12:07:55 +0000 (14:07 +0200)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 28 Oct 2018 13:02:15 +0000 (21:02 +0800)
To enable the root device selection (kernel cmd-line) via PARTUUID, this
patch enables CMD_PART on all missing theadorable-x86 boards and
changes the default environment to generate the root=PARTUUID string
automatically.

This fixes problems that have been noticed on systems with multiple
SATA/AHCI controller connected via PCIe, where the device name for the
root device / partition (/dev/sdaX) was incorrect.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig
configs/theadorable-x86-conga-qa3-e3845_defconfig
include/configs/theadorable-x86-common.h

index a3865024e84256ef66abb42c27744098353ede18..e9febb465b8fea59700c02a6d05af944abc61750 100644 (file)
@@ -26,6 +26,7 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
index 8cd170feb7b0c90e64e15f2ac03f024dd4b36cfe..ee3d7f01abaa44010362a7b22e0e55eadd0da4bf 100644 (file)
@@ -25,6 +25,7 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
index dd2bfb0a100afbc038482ded4dcb56176d4a42fb..e0a033bec1c71711d61eedadfaa7bf5ad68d293c 100644 (file)
                "then run swupdate;"                            \
                "else run yocto_boot;run swupdate;"             \
                "fi\0"                                          \
+       "setroot=part uuid scsi 0:${partnr} uuid;"              \
+               "setenv root PARTUUID=${uuid}\0"                \
+       "setroot_ubuntu=setenv partnr ${ubuntu_part};run setroot\0" \
+       "setroot_yocto=setenv partnr ${yocto_part};run setroot\0" \
        "ubuntu_args=setenv bootargs "                          \
-               "root=/dev/sda${ubuntu_part} ro\0"              \
+               "root=${root} ro\0"                             \
        "ubuntu_args_quiet=setenv bootargs "                    \
-               "root=/dev/sda${ubuntu_part} ro quiet\0"        \
+               "root=${root} ro quiet\0"                       \
        "ubuntu_load=load scsi 0:${ubuntu_part} 03000000 "      \
                "/boot/vmlinuz-${kernel-ver};"                  \
                "load scsi 0:${ubuntu_part} 04000000 "          \
                "/boot/initrd.img-${kernel-ver}\0"              \
-       "ubuntu_boot=run ubuntu_args_quiet addmtd addmisc "     \
-               "ubuntu_load boot\0"                            \
-       "ubuntu_boot_console=run ubuntu_args addtty_ubuntu "    \
+       "ubuntu_boot=run setroot_ubuntu ubuntu_args_quiet "     \
                "addmtd addmisc ubuntu_load boot\0"             \
-       "net_args=setenv bootargs root=/dev/sda${ubuntu_part} ro\0" \
-       "net_boot=run start_eth net_args addtty_yocto addmtd addmisc;" \
+       "ubuntu_boot_console=run setroot_ubuntu ubuntu_args "   \
+               "addtty_ubuntu addmtd addmisc ubuntu_load boot\0" \
+       "net_args=setenv bootargs root=${root} ro\0"            \
+       "net_boot=run start_eth setroot_ubuntu net_args "       \
+               "addtty_ubuntu addmtd addmisc;"                 \
                "tftp 03000000 ${tftpdir}/bzImage;"             \
                "load scsi 0:${ubuntu_part} 04000000 "          \
                "/boot/initrd.img-${kernel-ver};"               \
                "run boot\0"                                    \
-       "yocto_args=setenv bootargs root=/dev/sda${yocto_part} " \
-               "panic=1\0"                             \
-       "yocto_args_fast=setenv bootargs root=/dev/sda${yocto_part} " \
+       "yocto_args=setenv bootargs root=${root} "              \
+               "panic=1\0"                                     \
+       "yocto_args_fast=setenv bootargs root=${root} "         \
                "quiet panic=1\0"                               \
-       "yocto_boot=run yocto_args addmtd addmisc addtty_yocto;" \
+       "yocto_boot=run setroot_yocto yocto_args addmtd addmisc " \
+               "addtty_yocto;" \
                "if run yocto_load;then zboot 03000000;fi\0"    \
-       "yocto_boot_fast=run yocto_args_fast addmtd addmisc "   \
-               "addtty_yocto yocto_load;zboot 03000000\0"      \
-       "yocto_boot_tftp=run yocto_args addmtd addmisc addtty_yocto " \
+       "yocto_boot_fast=run setroot_yocto yocto_args_fast addmtd " \
+               "addmisc addtty_yocto yocto_load;zboot 03000000\0" \
+       "yocto_boot_tftp=run setroot_yocto yocto_args addmtd "  \
+               "addmisc addtty_yocto "                         \
                "start_eth yocto_load_tftp;zboot 03000000\0"    \
        "yocto_kernel=bzImage\0"                                \
        "yocto_load=load scsi 0:${yocto_part} 03000000 "        \