[Android-virt] [PATCH 5/6] Makefile, boot.S: Allow kernel command line to be set in makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow the kernel command line to be set in the makefile rather
than forcing the user to edit boot.S every time.

Signed-off-by: Peter Maydell <peter.maydell at linaro.org>
---
 Makefile |   14 +++++++++++++-
 boot.S   |    5 +++++
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 0e07bf1..160cabd 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,18 @@ endif
 #CPPFLAGS	+= -march=armv7-m
 #CPPFLAGS	+= -mthumb -Wa,-mthumb -Wa,-mimplicit-it=always
 
+# Kernel command line
+# MPS:
+# KCMD = "rdinit=/bin/sh console=ttyAMA3 mem=4M earlyprintk"
+# not-vexpress (ie EB, RealviewPB, etc), with initrd
+# KCMD = "console=ttyAMA0 mem=256M earlyprintk"
+# not-vexpress, without initrd:
+# KCMD = "root=/dev/nfs nfsroot=10.1.77.43:/work/debootstrap/arm ip=dhcp console=ttyAMA0 mem=256M earlyprintk"
+# Vexpress, with initrd:
+# KCMD = "console=ttyAMA0 mem=512M mem=512M at 0x880000000 earlyprintk ip=192.168.27.200::192.168.27.1:255.255.255.0:angstrom:eth0:off"
+# VExpress, without initrd:
+KCMD ?= "console=ttyAMA0 mem=512M mem=512M at 0x880000000 earlyprintk root=/dev/nfs nfsroot=172.31.252.250:/srv/arm-oneiric-root,tcp rw ip=dhcp nfsrootdebug"
+
 MONITOR		= monitor.S
 BOOTLOADER	= boot.S
 KERNEL_SRC	= ../linux-kvm-arm
@@ -54,7 +66,7 @@ $(IMAGE): boot.o monitor.o model.lds $(KERNEL) $(FILESYSTEM) Makefile
 	$(LD) -o $@ --script=model.lds
 
 boot.o: $(BOOTLOADER)
-	$(CC) $(CPPFLAGS) -c -o $@ $<
+	$(CC) $(CPPFLAGS) -DKCMD='$(KCMD)' -c -o $@ $<
 
 monitor.o: $(MONITOR)
 	$(CC) $(CPPFLAGS) -c -o $@ $<
diff --git a/boot.S b/boot.S
index 6de3721..e1c8d78 100644
--- a/boot.S
+++ b/boot.S
@@ -142,6 +142,10 @@ atags:
 	@ ATAG_CMDLINE
 	.long	(1f - .) >> 2
 	.long	0x54410009
+#ifdef KCMD
+        /* User-specified command line always overrides */
+        .asciz KCMD
+#else
 #ifdef MACH_MPS
 	.asciz	"rdinit=/bin/sh console=ttyAMA3 mem=4M earlyprintk"
 #elif defined(VEXPRESS)
@@ -161,6 +165,7 @@ atags:
 #endif
 
 #endif
+#endif
 	.align	2
 1:
 
-- 
1.7.5.4



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux