Skip to contentSkip to conversation

x86: Add ramboot and nfsboot commands in x86-common.h

PATCH New Bin Meng 2 participants 2 messages Mar 12, 2015 – Mar 20, 2015

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 x86: Add ramboot and nfsboot commands in x86-common.h

It is very common in the debug stage to test U-Boot loading a linux kernel. The commands to boot linux kernel with ramdisk and nfs as the root are common to all x86 targets, so it makes sense to add them as the U-Boot default environment in x86-common.h.

---

 include/configs/x86-common.h | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)
include/configs/x86-common.h +29 -2
index 062e6c2..eeda774 100644
@@ -249,7 +249,34 @@
 
 #define CONFIG_CMD_USB
 
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	CONFIG_STD_DEVICES_SETTINGS
+/* Default environment */
+#define CONFIG_ROOTPATH		"/opt/nfsroot"
+#define CONFIG_HOSTNAME		"x86"
+#define CONFIG_BOOTFILE		"bzImage"
+#define CONFIG_LOADADDR		0x1000000
+
+#define CONFIG_EXTRA_ENV_SETTINGS			\
+	CONFIG_STD_DEVICES_SETTINGS			\
+	"netdev=eth0\0"					\
+	"consoledev=ttyS0\0"				\
+	"othbootargs=acpi=off\0"			\
+	"ramdiskaddr=0x2000000\0"			\
+	"ramdiskfile=initramfs.gz\0"
+
+#define CONFIG_RAMBOOTCOMMAND				\
+	"setenv bootargs root=/dev/ram rw "		\
+	"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
+	"console=$consoledev,$baudrate $othbootargs;"	\
+	"tftpboot $loadaddr $bootfile;"			\
+	"tftpboot $ramdiskaddr $ramdiskfile;"		\
+	"zboot $loadaddr 0 $ramdiskaddr $filesize"
+
+#define CONFIG_NFSBOOTCOMMAND				\
+	"setenv bootargs root=/dev/nfs rw "		\
+	"nfsroot=$serverip:$rootpath "			\
+	"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
+	"console=$consoledev,$baudrate $othbootargs;"	\
+	"tftpboot $loadaddr $bootfile;"			\
+	"zboot $loadaddr"
 
 #endif	/* __CONFIG_H */
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH 1/1 x86: Add ramboot and nfsboot commands in x86-common.h

Quoted 10 lines · Bin Meng

It is very common in the debug stage to test U-Boot loading a linux kernel. The commands to boot linux kernel with ramdisk and nfs as the root are common to all x86 targets, so it makes sense to add them as the U-Boot default environment in x86-common.h.

---

 include/configs/x86-common.h | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)