MKIMAGE = $(PWD)/../../work/mkimage
ZIMAGE = $(PWD)/../../../kernel/efikamx/work/zImage
INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz
+INITRAMFS = $(PWD)/../../../initramfs/work/initramfs
-.PHONY: all clean distclean uImage uInitrd bootscr
+RAMDISK_TYPE = uInitramfs # select between uInitramfs or uInitrd
-all: uImage uInitrd bootscr
+.PHONY: all clean distclean kernel ramdisk bootscr
-clean: uImage-clean uInitrd-clean bootscr-clean
+all: kernel ramdisk bootscr
+
+clean: kernel-clean ramdisk-clean bootscr-clean
distclean: clean
-T kernel -C none -n "Linux-2.6.31.14.22-efikamx" \
-d $(ZIMAGE) $(WORK)/uImage
-uImage: $(WORK)/uImage
+kernel: $(WORK)/uImage
-uImage-clean:
+kernel-clean:
rm -f $(WORK)/uImage
$(WORK)/uInitrd: $(WORK) $(MKIMAGE) $(INITRDGZ)
uInitrd-clean:
rm -f $(WORK)/uInitrd
-$(WORK)/boot-ram.scr: $(WORK) $(MKIMAGE) $(PWD)/boot-ram.script
+$(WORK)/uInitramfs: $(WORK) $(MKIMAGE) $(INITRAMFS)
+ $(MKIMAGE) -A arm -O linux -a 0 -e 0 \
+ -T ramdisk -C none -n "CRUX-ARM Initramfs Image" \
+ -d $(INITRAMFS) $(WORK)/uInitramfs
+
+uInitramfs: $(WORK)/uInitramfs
+
+uInitramfs-clean:
+ rm -f $(WORK)/uInitramfs
+
+ramdisk: $(RAMDISK_TYPE)
+
+ramdisk-clean: uInitrd-clean uInitramfs-clean
+
+$(WORK)/boot-ramdisk.scr: $(WORK) $(MKIMAGE) $(PWD)/boot-ramdisk.script
+ sed -e "s|#RAMDISK_TYPE#|$(RAMDISK_TYPE)|" \
+ $(PWD)/boot-ramdisk.script > $(WORK)/boot-ramdisk.script
$(MKIMAGE) -A arm -O linux -a 0 -e 0 \
- -T script -C none -n "EfikaMX Boot Script (ram)" \
- -d $(PWD)/boot-ram.script \
- $(WORK)/boot-ram.scr
+ -T script -C none -n "EfikaMX Boot Script (ramdisk)" \
+ -d $(WORK)/boot-ramdisk.script \
+ $(WORK)/boot-ramdisk.scr
$(WORK)/boot-sda.scr: $(WORK) $(MKIMAGE) $(PWD)/boot-sda.script
$(MKIMAGE) -A arm -O linux -a 0 -e 0 \
-d $(PWD)/boot-sda.script \
$(WORK)/boot-sda.scr
-$(WORK)/boot-mmcblk.scr: $(WORK) $(MKIMAGE) $(PWD)/boot-mmcblk.script
+$(WORK)/boot-mmc.scr: $(WORK) $(MKIMAGE) $(PWD)/boot-mmc.script
$(MKIMAGE) -A arm -O linux -a 0 -e 0 \
- -T script -C none -n "EfikaMX Boot Script (mmcblk)" \
- -d $(PWD)/boot-mmcblk.script \
- $(WORK)/boot-mmcblk.scr
+ -T script -C none -n "EfikaMX Boot Script (mmc)" \
+ -d $(PWD)/boot-mmc.script \
+ $(WORK)/boot-mmc.scr
-bootscr: $(WORK)/boot-ram.scr $(WORK)/boot-sda.scr $(WORK)/boot-mmcblk.scr
+bootscr: $(WORK)/boot-ramdisk.scr $(WORK)/boot-sda.scr $(WORK)/boot-mmc.scr
bootscr-clean:
- rm -f $(WORK)/boot-*.scr
-
+ rm -f $(WORK)/boot-*.scr*
# End of file