2 # Makefile -- Build instructions for Arcturus/uCdimm
5 ROMFSIMG = $(IMAGEDIR)/romfs.img
6 IMAGE = $(IMAGEDIR)/image.bin
10 ROMFS_DIRS = bin dev dev/flash etc home lib mnt proc usr var \
11 home/httpd home/httpd/cgi-bin
14 tty,c,5,0 console,c,5,1 cua0,c,5,64 cua1,c,5,65 \
15 mem,c,1,1 kmem,c,1,2 null,c,1,3 ram0,b,1,0 \
19 ptyp0,c,2,0 ptyp1,c,2,1 ptyp2,c,2,2 ptyp3,c,2,3 \
20 ptyp4,c,2,4 ptyp5,c,2,5 ptyp6,c,2,6 ptyp7,c,2,7 \
21 ptyp8,c,2,8 ptyp9,c,2,9 ptypa,c,2,10 ptypb,c,2,11 \
22 ptypc,c,2,12 ptypd,c,2,13 ptype,c,2,14 ptypf,c,2,15 \
24 tty0,c,4,0 tty1,c,4,1 tty2,c,4,2 tty3,c,4,3 \
25 ttyS0,c,4,64 ttyS1,c,4,65 \
27 ttyp0,c,3,0 ttyp1,c,3,1 ttyp2,c,3,2 ttyp3,c,3,3 \
28 ttyp4,c,3,4 ttyp5,c,3,5 ttyp6,c,3,6 ttyp7,c,3,7 \
29 ttyp8,c,3,8 ttyp9,c,3,9 ttypa,c,3,10 ttypb,c,3,11 \
30 ttypc,c,3,12 ttypd,c,3,13 ttype,c,3,14 ttypf,c,3,15 \
32 zero,c,1,5 random,c,1,8 urandom,c,1,9 \
37 ifdef CONFIG_BLK_DEV_BLKMEM
40 rom0,b,31,0 rom1,b,31,1 rom2,b,31,2 rom3,b,31,3 \
41 rom4,b,31,4 rom5,b,31,5 rom6,b,31,6 rom7,b,31,7 \
42 rom8,b,31,8 rom9,b,31,9
46 mtd0,c,90,0 mtdr0,c,90,1 mtdblock0,b,31,0 \
47 mtd1,c,90,2 mtdr1,c,90,3 mtdblock1,b,31,1 \
48 mtd2,c,90,4 mtdr2,c,90,5 mtdblock2,b,31,2 \
49 mtd3,c,90,6 mtdr3,c,90,7 mtdblock3,b,31,3 \
50 mtd4,c,90,8 mtdr4,c,90,9 mtdblock4,b,31,4 \
51 mtd5,c,90,10 mtdr5,c,90,11 mtdblock5,b,31,5 \
52 mtd6,c,90,12 mtdr6,c,90,13 mtdblock6,b,31,6 \
64 for i in $$dirs ; do make -C $$i || exit $? ; done
68 for i in $$dirs; do [ ! -d $$i ] || make -C $$i clean; done
71 [ -d $(ROMFSDIR)/$$i ] || mkdir -p $(ROMFSDIR)
72 for i in $(ROMFS_DIRS); do \
73 [ -d $(ROMFSDIR)/$$i ] || mkdir -p $(ROMFSDIR)/$$i; \
75 for i in $(DEVICES); do \
76 touch $(ROMFSDIR)/dev/@$$i; \
78 # these permissions are needed for openpty and family to work
80 chmod 620 $(ROMFSDIR)/dev/@[pt]ty[pqrsPQRS][0-9a-f],*
82 for i in $(FLASH_DEVICES); do \
83 touch $(ROMFSDIR)/dev/flash/@$$i; \
86 dirs=$(DIRS) ; for i in $$dirs; do make -C $$i romfs || exit $? ; done
87 $(ROMFSINST) -s /var/tmp /tmp
88 $(ROMFSINST) -s /bin /sbin
90 $(ROMFSINST) /etc/inittab
91 $(ROMFSINST) ../../Generic/romfs/etc/services /etc/services
92 $(ROMFSINST) /etc/motd
93 if [ -f passwd.$(LIBCDIR) ]; then \
94 $(ROMFSINST) passwd.$(LIBCDIR) /etc/passwd; \
96 $(ROMFSINST) /etc/passwd; \
98 $(ROMFSINST) ../../Generic/httpd /home/httpd
99 # better to be running from RAM when hanging it
100 $(CROSS)flthdr -r $(ROMFSDIR)/bin/netflash
101 $(CROSS)flthdr -r $(ROMFSDIR)/bin/flashw
102 echo "$(VERSIONSTR) -- " `date` > $(ROMFSDIR)/etc/version
105 [ -d $(IMAGEDIR) ] || mkdir -p $(IMAGEDIR)
106 genromfs -v -V "ROMdisk" -f $(ROMFSIMG) -d $(ROMFSDIR)
107 $(CROSS_COMPILE)objcopy -O binary --remove-section=.romvec \
108 --remove-section=.text --remove-section=.ramvec \
109 --remove-section=.bss --remove-section=.eram \
110 $(ROOTDIR)/$(LINUXDIR)/linux $(IMAGEDIR)/linux.data
111 $(CROSS_COMPILE)objcopy -O binary --remove-section=.ramvec \
112 --remove-section=.bss --remove-section=.data \
113 --remove-section=.eram \
114 --set-section-flags=.romvec=CONTENTS,ALLOC,LOAD,READONLY,CODE \
115 $(ROOTDIR)/$(LINUXDIR)/linux $(IMAGEDIR)/linux.text
116 cat $(IMAGEDIR)/linux.text $(IMAGEDIR)/linux.data $(ROMFSIMG) > $(IMAGE)
117 [ -n "$(NO_BUILD_INTO_TFTPBOOT)" ] || cp $(IMAGE) /tftpboot