summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-12-17 10:10:25 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2009-12-17 10:10:25 +0000
commitccc9098a6f1b1fc2bbefd21ce0e2037263e104dd (patch)
treec8a40d50abb1a353e96285795feadb823e642ec4
parent83c4d2a2019555ef8c6e74885496563c6e171225 (diff)
Modifications to pass the USE_INITRD and THUMB2_KERNEL options via top
Makefile.
-rw-r--r--Makefile16
-rw-r--r--boot.S5
-rw-r--r--model.lds.S (renamed from model.lds.in)6
3 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 4ba311b..4bdaa7d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,14 @@
# Build an ELF linux+filesystem image
+#CPPFLAGS += -DUSE_INITRD
+#CPPFLAGS += -DTHUMB2_KERNEL
+
BOOTLOADER = boot.S
KERNEL = uImage
FILESYSTEM = filesystem.cpio.gz
IMAGE = linux-system.axf
-LD_SCRIPT = model.lds
+LD_SCRIPT = model.lds.S
CROSS_COMPILE = arm-none-linux-gnueabi-
@@ -15,10 +18,13 @@ LD = $(CROSS_COMPILE)ld
all: $(IMAGE)
clean:
- rm -f $(IMAGE) boot.o
+ rm -f $(IMAGE) boot.o model.lds
-$(IMAGE): boot.o $(LD_SCRIPT) $(KERNEL) $(FILESYSTEM)
- $(LD) -o $@ --script=$(LD_SCRIPT)
+$(IMAGE): boot.o model.lds $(KERNEL) $(FILESYSTEM)
+ $(LD) -o $@ --script=model.lds
boot.o: $(BOOTLOADER)
- $(CC) -c -o $@ $<
+ $(CC) $(CPPFLAGS) -c -o $@ $<
+
+model.lds: $(LD_SCRIPT)
+ $(CC) $(CPPFLAGS) -E -P -C -o $@ $<
diff --git a/boot.S b/boot.S
index a88d642..e977a39 100644
--- a/boot.S
+++ b/boot.S
@@ -17,9 +17,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define USE_INITRD
-#undef THUMB2_KERNEL
-
.text
.globl _start
@@ -81,7 +78,7 @@ atags:
#ifdef USE_INITRD
.asciz "console=ttyAMA0 mem=256M earlyprintk"
#else
- .asciz "root=/dev/nfs nfsroot=10.1.68.81:/work/nfsroot ip=dhcp console=ttyAMA0 mem=256M earlyprintk"
+ .asciz "root=/dev/nfs nfsroot=10.1.68.81:/work2/debootstrap/arm ip=dhcp console=ttyAMA0 mem=256M earlyprintk"
#endif
.align 2
1:
diff --git a/model.lds.in b/model.lds.S
index e61dd4c..02fb8fc 100644
--- a/model.lds.in
+++ b/model.lds.S
@@ -21,9 +21,11 @@ OUTPUT_FORMAT("elf32-littlearm")
OUTPUT_ARCH(arm)
TARGET(binary)
+INPUT(./boot.o)
INPUT(./uImage)
+#ifdef USE_INITRD
INPUT(./filesystem.cpio.gz)
-INPUT(./boot.o)
+#endif
PHYS_OFFSET = 0x70000000;
@@ -38,8 +40,10 @@ SECTIONS
. = PHYS_OFFSET + 0x00800000;
filesystem = .;
+#ifdef USE_INITRD
.filesystem : { ./filesystem.cpio.gz }
fs_size = . - filesystem;
+#endif
.data : { *(.data) }
.bss : { *(.bss) }