Allow for static IP configuration via kernel command line
[people/mcb30/mkbootfs.git] / Makefile
1 BOOTPACK = ./tools/bootpack
2
3 CFLAGS = -W -Wall -Wextra -O3
4
5 BOOTPACKS :=
6
7 all : tools bootpacks
8
9 # Build tools for bootfs manipulation
10
11 $(BOOTPACK) : $(BOOTPACK).c
12         $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -lz $< -o $@
13
14 clean ::
15         rm -f $(BOOTPACK)
16
17 tools :: $(BOOTPACK)
18
19 # Skeleton boot pack
20
21 SKEL_DEVS :=
22 SKEL_DEVS += /dev/null
23 SKEL_DEVS += /dev/console
24 SKEL_DEVS += /dev/tty
25 SKEL_DEVS += /dev/tty1
26 SKEL_DEVS += /dev/tty2
27 SKEL_DEVS += /dev/tty3
28 SKEL_DEVS += /dev/tty4
29 SKEL_DEVS += /dev/tty5
30 SKEL_DEVS += /dev/tty6
31 SKEL_DEVS += /dev/mem
32 SKEL_DEVS += /dev/urandom
33
34 skeleton.bp : $(BOOTPACK)
35         rm -rf skeleton/_install
36         mkdir -p skeleton/_install/{bin,dev,etc,lib/modules,mnt,proc,sbin,sys}
37         mkdir -p skeleton/_install/{usr/{bin,sbin,share}}
38         mkdir -p skeleton/_install/{var/{lock,log,run}}
39         $(BOOTPACK) -o $@ skeleton/_install=/ $(SKEL_DEVS)
40
41 BOOTPACKS += skeleton.bp
42
43 clean ::
44         rm -rf skeleton/_install
45
46 # Busybox boot pack
47
48 busybox/busybox : busybox/.config
49         $(MAKE) -C busybox oldconfig
50         uclibc $(MAKE) -C busybox
51
52 busybox.bp : busybox/busybox $(BOOTPACK)
53         $(MAKE) -C busybox install
54         $(BOOTPACK) -o $@ busybox/_install=/
55
56 BOOTPACKS += busybox.bp
57
58 clean ::
59         $(MAKE) -C busybox clean
60
61 # open-iscsi boot pack
62
63 open-iscsi/usr/iscsistart :
64         $(MAKE) -C open-iscsi/utils/fwparam_ibft
65         $(MAKE) -C open-iscsi/usr
66
67 iscsi.bp : open-iscsi/usr/iscsistart
68         $(BOOTPACK) -o $@ $<=/sbin/iscsistart
69
70 BOOTPACKS += iscsi.bp
71
72 clean ::
73         $(MAKE) -C open-iscsi clean
74
75 # Policy boot pack
76
77 POL_FILES :=
78 POL_FILES += policy/etc/passwd
79 POL_FILES += policy/etc/group
80 POL_FILES += policy/etc/protocols
81 POL_FILES += policy/etc/inittab
82 POL_FILES += policy/etc/init.d/rcS
83 POL_FILES += policy/usr/share/udhcpc/default.script
84 POL_FILES += policy/bin/welcome.sh
85
86 policy.bp : $(POL_FILES) $(BOOTPACK)
87         rm -rf policy/_install
88         mkdir -p policy/_install/{etc/init.d,bin,usr/share/udhcpc}
89         for file in $(POL_FILES) ; do \
90                 cp -p $$file \
91                   `echo $$file | sed 's/^policy\//policy\/_install\//'` ; \
92         done
93         $(BOOTPACK) -o $@ policy/_install=/
94
95 BOOTPACKS += policy.bp
96
97 clean ::
98         rm -rf policy/_install
99
100 # Boot pack common instructions
101
102 bootpacks : $(BOOTPACKS)
103
104 clean ::
105         rm -f $(BOOTPACKS)