Text update to cross2 Chapter 4.
[linux_from_scratch.git] / bootscripts / Makefile
blob4686c6ff25b04e9aa5992d12503cf5fc35482589
1 ETCDIR=${DESTDIR}/etc
2 LIBDIR=${DESTDIR}/lib
3 SERVICEDIR=${LIBDIR}/services
4 MAN8=${DESTDIR}/usr/share/man/man8
5 SBIN=${DESTDIR}/sbin
6 MODE=754
7 DIRMODE=755
8 CONFMODE=644
10 all: links
12 install: all
14 create-dirs:
15 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc0.d
16 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc1.d
17 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc2.d
18 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc3.d
19 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc4.d
20 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc5.d
21 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc6.d
22 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rcS.d
23 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/init.d
24 install -d -m ${DIRMODE} ${ETCDIR}/sysconfig
25 install -d -m ${DIRMODE} ${LIBDIR}
26 install -d -m ${DIRMODE} ${SERVICEDIR}
27 install -d -m ${DIRMODE} ${MAN8}
28 install -d -m ${DIRMODE} ${SBIN}
29 ln -sfn services ${LIBDIR}/lsb
30 ln -sfn rc.d/init.d ${ETCDIR}/init.d
32 files: create-dirs
33 install -m ${MODE} lfs/init.d/checkfs ${ETCDIR}/rc.d/init.d/
34 install -m ${MODE} lfs/init.d/cleanfs ${ETCDIR}/rc.d/init.d/
35 install -m ${MODE} lfs/init.d/halt ${ETCDIR}/rc.d/init.d/
36 install -m ${MODE} lfs/init.d/console ${ETCDIR}/rc.d/init.d/
37 install -m ${MODE} lfs/init.d/localnet ${ETCDIR}/rc.d/init.d/
38 install -m ${MODE} lfs/init.d/modules ${ETCDIR}/rc.d/init.d/
39 install -m ${MODE} lfs/init.d/mountfs ${ETCDIR}/rc.d/init.d/
40 install -m ${MODE} lfs/init.d/mountvirtfs ${ETCDIR}/rc.d/init.d/
41 install -m ${MODE} lfs/init.d/network ${ETCDIR}/rc.d/init.d/
42 install -m ${MODE} lfs/init.d/rc ${ETCDIR}/rc.d/init.d/
43 install -m ${MODE} lfs/init.d/reboot ${ETCDIR}/rc.d/init.d/
44 install -m ${MODE} lfs/init.d/sendsignals ${ETCDIR}/rc.d/init.d/
45 install -m ${MODE} lfs/init.d/setclock ${ETCDIR}/rc.d/init.d/
46 install -m ${MODE} lfs/init.d/swap ${ETCDIR}/rc.d/init.d/
47 install -m ${MODE} lfs/init.d/sysctl ${ETCDIR}/rc.d/init.d/
48 install -m ${MODE} lfs/init.d/sysklogd ${ETCDIR}/rc.d/init.d/
49 install -m ${MODE} lfs/init.d/template ${ETCDIR}/rc.d/init.d/
50 install -m ${MODE} lfs/init.d/udev ${ETCDIR}/rc.d/init.d/
51 install -m ${MODE} lfs/init.d/udev_retry ${ETCDIR}/rc.d/init.d/
52 install -m ${MODE} lfs/sbin/ifup ${SBIN}
53 install -m ${MODE} lfs/sbin/ifdown ${SBIN}
54 install -m ${CONFMODE} lfs/sbin/ifup.8 ${MAN8}
55 ln -sf ifup.8 ${MAN8}/ifdown.8
56 install -m ${MODE} lfs/lib/services/ipv4-static-route ${SERVICEDIR}
57 install -m ${MODE} lfs/lib/services/ipv4-static ${SERVICEDIR}
58 install -m ${CONFMODE} lfs/lib/services/init-functions ${SERVICEDIR}
60 if [ ! -f ${ETCDIR}/sysconfig/createfiles ]; then \
61 install -m ${CONFMODE} lfs/sysconfig/createfiles ${ETCDIR}/sysconfig/ ;\
63 if [ ! -f ${ETCDIR}/sysconfig/modules ]; then \
64 install -m ${CONFMODE} lfs/sysconfig/modules ${ETCDIR}/sysconfig/ ;\
66 if [ ! -f ${ETCDIR}/sysconfig/udev_retry ]; then \
67 install -m ${CONFMODE} lfs/sysconfig/udev_retry ${ETCDIR}/sysconfig/ ;\
69 if [ ! -f ${ETCDIR}/sysconfig/rc.site ]; then \
70 install -m ${CONFMODE} lfs/sysconfig/rc.site ${ETCDIR}/sysconfig/ ;\
73 links: rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6
75 rcS: files
76 ln -sf ../init.d/mountvirtfs ${ETCDIR}/rc.d/rcS.d/S00mountvirtfs
77 ln -sf ../init.d/modules ${ETCDIR}/rc.d/rcS.d/S05modules
78 ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rcS.d/S08localnet
79 ln -sf ../init.d/udev ${ETCDIR}/rc.d/rcS.d/S10udev
80 ln -sf ../init.d/swap ${ETCDIR}/rc.d/rcS.d/S20swap
81 ln -sf ../init.d/checkfs ${ETCDIR}/rc.d/rcS.d/S30checkfs
82 ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rcS.d/S40mountfs
83 ln -sf ../init.d/cleanfs ${ETCDIR}/rc.d/rcS.d/S45cleanfs
84 ln -sf ../init.d/udev_retry ${ETCDIR}/rc.d/rcS.d/S50udev_retry
85 ln -sf ../init.d/console ${ETCDIR}/rc.d/rcS.d/S70console
86 ln -sf ../init.d/sysctl ${ETCDIR}/rc.d/rcS.d/S90sysctl
88 rc0: files
89 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc0.d/K80network
90 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc0.d/K90sysklogd
91 ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/S60sendsignals
92 ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/S65swap
93 ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/S70mountfs
94 ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/S90localnet
95 ln -sf ../init.d/halt ${ETCDIR}/rc.d/rc0.d/S99halt
97 rc1: files
98 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc1.d/K80network
99 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc1.d/K90sysklogd
101 rc2: files
102 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/K80network
103 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/K90sysklogd
105 rc3: files
106 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc3.d/S10sysklogd
107 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc3.d/S20network
109 rc4: files
110 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc4.d/S10sysklogd
111 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc4.d/S20network
113 rc5: files
114 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc5.d/S10sysklogd
115 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc5.d/S20network
117 rc6: files
118 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc6.d/K80network
119 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc6.d/K90sysklogd
120 ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc6.d/S60sendsignals
121 ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc6.d/S65swap
122 ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc6.d/S70mountfs
123 ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc6.d/S90localnet
124 ln -sf ../init.d/reboot ${ETCDIR}/rc.d/rc6.d/S99reboot
126 uninstall:
127 rm -rf ${DESTDIR}/lib/services ${DESTDIR}/lib/lsb ${ETCDIR}/rc.d ${ETCDIR}/init.d \
128 ${SBIN}/ifup ${SBIN}/ifdown ${MAN8}/ifup.8 ${MAN8}/ifdown.8 \
129 ${ETCDIR}/sysconfig/rc
131 .PHONY: all create-dirs install files links rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6 uninstall