CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Improved cubieboard's stuff. Now using Makefile rules for patterns to create boot...
authorJose V Beneyto <sepen@crux.nu>
Tue, 27 Aug 2013 14:05:05 +0000 (14:05 +0000)
committerJose V Beneyto <sepen@crux.nu>
Tue, 27 Aug 2013 14:05:05 +0000 (14:05 +0000)
devices/cubieboard/Makefile
devices/cubieboard/boot-mmc.script [deleted file]
devices/cubieboard/boot-mmc.script.in [new file with mode: 0644]

index 88031bfdd60bc966194354207bd69a50934ca3bf..9bfcde378455fe1fa61f9ac97a15534e3eb5b443 100644 (file)
@@ -1,5 +1,5 @@
 #
-# uboot/devices/cubieboard/Makefile
+# bootloader/devices/cubieboard/Makefile
 #
 
 PWD = $(shell pwd)
@@ -9,9 +9,11 @@ ZIMAGE = $(PWD)/../../../kernel/cubieboard/work/zImage
 INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz
 INITRAMFS = $(PWD)/../../../initramfs/work/initramfs
 
-RAMDISK_TYPE = uInitrd # select between uInitramfs or uInitrd
+RAMDISK_TYPE = uInitrd
+#RAMDISK_TYPE = uInitramfs
 
-CONSOLE = tty0 # tty0 / ttyS0,115200
+CONSOLE_DEVICE = tty0
+#CONSOLE_DEVICE = ttymxc0,115200
 
 .PHONY: all clean distclean kernel ramdisk bootscr
 
@@ -58,16 +60,16 @@ ramdisk: $(RAMDISK_TYPE)
 
 ramdisk-clean: uInitrd-clean uInitramfs-clean
 
-templates: $(PWD)/boot-mmc.script
-       sed "s|#CONSOLE#|$(CONSOLE)|" $(PWD)/boot-mmc.script > $(WORK)/boot-mmc.script
+$(WORK)/%.script: %.script.in
+       sed -e "s|@@RAMDISK_TYPE@@|$(RAMDISK_TYPE)|" -e "s|@@CONSOLE_DEVICE@@|$(CONSOLE_DEVICE)|" $< > $@
 
-$(WORK)/boot-mmc.scr: $(WORK) $(MKIMAGE)
+$(WORK)/boot-mmc.scr: $(WORK)/boot-mmc.script $(MKIMAGE)
        $(MKIMAGE) -A arm -O linux -a 0 -e 0 \
-       -T script -C none -n "A10 Boot Script (mmc)" \
+       -T script -C none -n "Cubieboard Boot Script (mmc)" \
        -d $(WORK)/boot-mmc.script \
        $(WORK)/boot-mmc.scr
 
-bootscr: templates $(WORK)/boot-mmc.scr
+bootscr: $(WORK)/boot-mmc.scr
 
 bootscr-clean:
        rm -f $(WORK)/boot-*.scr*
diff --git a/devices/cubieboard/boot-mmc.script b/devices/cubieboard/boot-mmc.script
deleted file mode 100644 (file)
index 849ed00..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
-fatload mmc 0 0x43000000 script.bin
-fatload mmc 0 0x48000000 uImage
-bootm 0x48000000
diff --git a/devices/cubieboard/boot-mmc.script.in b/devices/cubieboard/boot-mmc.script.in
new file mode 100644 (file)
index 0000000..3f3d35a
--- /dev/null
@@ -0,0 +1,4 @@
+setenv bootargs console=@@CONSOLE_DEVICE@@ root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
+fatload mmc 0 0x43000000 script.bin
+fatload mmc 0 0x48000000 uImage
+bootm 0x48000000