source: bootscripts/Makefile@ 7331caf

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 7331caf was 3cf24b4, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Install static nodes for udev with the udev bootscript.

  • Property mode set to 100644
File size: 11.0 KB
Line 
1ETCDIR=/etc
2LIBDIR=/lib
3EXTDIR=${DESTDIR}${ETCDIR}
4MODE=754
5DIRMODE=755
6CONFMODE=644
7
8all: install
9
10create-dirs:
11 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc0.d
12 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc1.d
13 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc2.d
14 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc3.d
15 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc4.d
16 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc5.d
17 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc6.d
18 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rcsysinit.d
19 install -d -m ${DIRMODE} ${EXTDIR}/rc.d/init.d
20 install -d -m ${DIRMODE} ${EXTDIR}/sysconfig
21
22create-service-dir:
23 install -d -m ${DIRMODE} ${EXTDIR}/sysconfig/network-devices/services
24
25udev_device_dirs:
26 install -d -m ${DIRMODE} ${DESTDIR}${LIBDIR}/udev/devices
27 install -d -m ${DIRMODE} ${DESTDIR}${LIBDIR}/udev/devices/pts
28 install -d -m ${DIRMODE} ${DESTDIR}${LIBDIR}/udev/devices/shm
29 install -d -m ${DIRMODE} ${DESTDIR}${LIBDIR}/udev/devices/net
30
31udev_device_links: udev_device_dirs
32 ln -snf /proc/self/fd ${DESTDIR}${LIBDIR}/udev/devices/fd
33 ln -snf /proc/self/fd/0 ${DESTDIR}${LIBDIR}/udev/devices/stdin
34 ln -snf /proc/self/fd/1 ${DESTDIR}${LIBDIR}/udev/devices/stdout
35 ln -snf /proc/self/fd/2 ${DESTDIR}${LIBDIR}/udev/devices/stderr
36 ln -snf /proc/kcore ${DESTDIR}${LIBDIR}/udev/devices/core
37
38mknod_devices: udev_device_dirs
39 @if [ "$$UID" = "0" ]; then \
40 if ! [ -e ${DESTDIR}${LIBDIR}/udev/devices/null ]; then \
41 mknod -m 0666 ${DESTDIR}${LIBDIR}/udev/devices/null c 1 3 ;\
42 fi \
43 fi
44 @if [ "$$UID" = "0" ]; then \
45 if ! [ -e ${DESTDIR}${LIBDIR}/udev/devices/console ]; then \
46 mknod -m 0600 ${DESTDIR}${LIBDIR}/udev/devices/console c 5 1 ;\
47 fi \
48 fi
49 @if [ "$$UID" != "0" ]; then \
50 if ! [ -e ${DESTDIR}${LIBDIR}/udev/devices/null ]; then \
51 echo "You will need to issue the following command as the root user" ;\
52 echo "" ;\
53 echo "mknod -m 0666 ${DESTDIR}${LIBDIR}/udev/devices/null c 1 3" ;\
54 fi \
55 fi
56 @if [ "$$UID" != "0" ]; then \
57 if ! [ -e ${DESTDIR}${LIBDIR}/udev/devices/console ]; then \
58 echo "mknod -m 0600 ${DESTDIR}${LIBDIR}/udev/devices/console c 5 1" ;\
59 echo "" ;\
60 fi \
61 fi
62
63install: create-dirs create-service-dir udev_device_dirs udev_device_links
64 install -m ${MODE} clfs/init.d/checkfs ${EXTDIR}/rc.d/init.d/
65 install -m ${MODE} clfs/init.d/cleanfs ${EXTDIR}/rc.d/init.d/
66 install -m ${CONFMODE} clfs/init.d/functions ${EXTDIR}/rc.d/init.d/
67 install -m ${MODE} clfs/init.d/halt ${EXTDIR}/rc.d/init.d/
68 install -m ${MODE} clfs/init.d/console ${EXTDIR}/rc.d/init.d/
69 install -m ${MODE} clfs/init.d/localnet ${EXTDIR}/rc.d/init.d/
70 install -m ${MODE} clfs/init.d/modules ${EXTDIR}/rc.d/init.d/
71 install -m ${MODE} clfs/init.d/mountfs ${EXTDIR}/rc.d/init.d/
72 install -m ${MODE} clfs/init.d/mountkernfs ${EXTDIR}/rc.d/init.d/
73 install -m ${MODE} clfs/init.d/network ${EXTDIR}/rc.d/init.d/
74 install -m ${MODE} clfs/init.d/rc ${EXTDIR}/rc.d/init.d/
75 install -m ${MODE} clfs/init.d/reboot ${EXTDIR}/rc.d/init.d/
76 install -m ${MODE} clfs/init.d/sendsignals ${EXTDIR}/rc.d/init.d/
77 install -m ${MODE} clfs/init.d/setclock ${EXTDIR}/rc.d/init.d/
78 install -m ${MODE} clfs/init.d/sysklogd ${EXTDIR}/rc.d/init.d/
79 install -m ${MODE} clfs/init.d/swap ${EXTDIR}/rc.d/init.d/
80 install -m ${MODE} clfs/init.d/sysctl ${EXTDIR}/rc.d/init.d/
81 install -m ${MODE} clfs/init.d/template ${EXTDIR}/rc.d/init.d/
82 install -m ${MODE} clfs/init.d/udev ${EXTDIR}/rc.d/init.d/
83 ln -sf ../init.d/network ${EXTDIR}/rc.d/rc0.d/K80network
84 ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc0.d/K90sysklogd
85 ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc0.d/S60sendsignals
86 ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc0.d/S70mountfs
87 ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc0.d/S80swap
88 ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rc0.d/S90localnet
89 ln -sf ../init.d/halt ${EXTDIR}/rc.d/rc0.d/S99halt
90 ln -sf ../init.d/network ${EXTDIR}/rc.d/rc1.d/K80network
91 ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc1.d/S10sysklogd
92 ln -sf ../init.d/network ${EXTDIR}/rc.d/rc2.d/S20network
93 ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc2.d/S10sysklogd
94 ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc3.d/S10sysklogd
95 ln -sf ../init.d/network ${EXTDIR}/rc.d/rc3.d/S20network
96 ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc4.d/S10sysklogd
97 ln -sf ../init.d/network ${EXTDIR}/rc.d/rc4.d/S20network
98 ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc5.d/S10sysklogd
99 ln -sf ../init.d/network ${EXTDIR}/rc.d/rc5.d/S20network
100 ln -sf ../init.d/network ${EXTDIR}/rc.d/rc6.d/K80network
101 ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc6.d/K90sysklogd
102 ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc6.d/S60sendsignals
103 ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc6.d/S70mountfs
104 ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc6.d/S80swap
105 ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rc6.d/S90localnet
106 ln -sf ../init.d/reboot ${EXTDIR}/rc.d/rc6.d/S99reboot
107 ln -sf ../init.d/mountkernfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountkernfs
108 ln -sf ../init.d/modules ${EXTDIR}/rc.d/rcsysinit.d/S05modules
109 ln -sf ../init.d/udev ${EXTDIR}/rc.d/rcsysinit.d/S10udev
110 ln -sf ../init.d/checkfs ${EXTDIR}/rc.d/rcsysinit.d/S20checkfs
111 ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rcsysinit.d/S30mountfs
112 ln -sf ../init.d/swap ${EXTDIR}/rc.d/rcsysinit.d/S40swap
113 ln -sf ../init.d/cleanfs ${EXTDIR}/rc.d/rcsysinit.d/S50cleanfs
114 ln -sf ../init.d/setclock ${EXTDIR}/rc.d/rcsysinit.d/S60setclock
115 ln -sf ../init.d/console ${EXTDIR}/rc.d/rcsysinit.d/S70console
116 ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rcsysinit.d/S80localnet
117 ln -sf ../init.d/sysctl ${EXTDIR}/rc.d/rcsysinit.d/S90sysctl
118 if [ ! -f ${EXTDIR}/sysconfig/bootscripts ]; then install -m ${CONFMODE} clfs/sysconfig/bootscripts ${EXTDIR}/sysconfig/bootscripts; fi
119 if [ ! -f ${EXTDIR}/sysconfig/console ]; then install -m ${CONFMODE} clfs/sysconfig/console ${EXTDIR}/sysconfig/; fi
120 if [ ! -f ${EXTDIR}/sysconfig/createfiles ]; then install -m ${CONFMODE} clfs/sysconfig/createfiles ${EXTDIR}/sysconfig/; fi
121 if [ ! -f ${EXTDIR}/sysconfig/modules ]; then install -m ${CONFMODE} clfs/sysconfig/modules ${EXTDIR}/sysconfig/; fi
122 if [ ! -f ${EXTDIR}/sysconfig/rc ]; then install -m ${CONFMODE} clfs/sysconfig/rc ${EXTDIR}/sysconfig/; fi
123 install -m ${MODE} clfs/sysconfig/network-devices/ifup ${EXTDIR}/sysconfig/network-devices/
124 install -m ${MODE} clfs/sysconfig/network-devices/ifdown ${EXTDIR}/sysconfig/network-devices/
125 install -m ${MODE} clfs/sysconfig/network-devices/services/ipv4-static ${EXTDIR}/sysconfig/network-devices/services/
126 install -m ${MODE} clfs/sysconfig/network-devices/services/ipv4-static-route ${EXTDIR}/sysconfig/network-devices/services/
127 @$(MAKE) mknod_devices
128
129install-consolelog: create-dirs
130 install -m ${MODE} contrib/init.d/consolelog ${EXTDIR}/rc.d/init.d
131 ln -sf ../init.d/consolelog ${EXTDIR}/rc.d/rcsysinit.d/S00consolelog
132 install --backup=numbered -m ${CONFMODE} contrib/sysconfig/consolelog ${EXTDIR}/sysconfig/
133
134install-service-mtu: create-service-dir
135 install -m ${MODE} contrib/sysconfig/network-devices/services/mtu ${EXTDIR}/sysconfig/network-devices/services
136
137minimal: create-dirs create-service-dir udev_device_dirs udev_device_links
138 sed -e 's|/bin:/usr/bin:/sbin:/usr/sbin|/tools/bin:/tools/sbin:/bin:/sbin|g' clfs/init.d/functions > clfs/init.d/functions.minimal
139 install -m ${MODE} clfs/init.d/checkfs ${EXTDIR}/rc.d/init.d/
140 install -m ${MODE} clfs/init.d/cleanfs ${EXTDIR}/rc.d/init.d/
141 install -m ${CONFMODE} clfs/init.d/functions.minimal ${EXTDIR}/rc.d/init.d/functions
142 install -m ${MODE} clfs/init.d/halt ${EXTDIR}/rc.d/init.d/
143 install -m ${MODE} clfs/init.d/localnet ${EXTDIR}/rc.d/init.d/
144 install -m ${MODE} clfs/init.d/mountfs ${EXTDIR}/rc.d/init.d/
145 install -m ${MODE} clfs/init.d/mountkernfs ${EXTDIR}/rc.d/init.d/
146 install -m ${MODE} clfs/init.d/rc ${EXTDIR}/rc.d/init.d/
147 install -m ${MODE} clfs/init.d/reboot ${EXTDIR}/rc.d/init.d/
148 install -m ${MODE} clfs/init.d/sendsignals ${EXTDIR}/rc.d/init.d/
149 install -m ${MODE} clfs/init.d/setclock ${EXTDIR}/rc.d/init.d/
150 install -m ${MODE} clfs/init.d/swap ${EXTDIR}/rc.d/init.d/
151 ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc0.d/S60sendsignals
152 ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc0.d/S70mountfs
153 ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc0.d/S80swap
154 ln -sf ../init.d/halt ${EXTDIR}/rc.d/rc0.d/S99halt
155 ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc6.d/S60sendsignals
156 ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc6.d/S70mountfs
157 ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc6.d/S80swap
158 ln -sf ../init.d/reboot ${EXTDIR}/rc.d/rc6.d/S99reboot
159 ln -sf ../init.d/mountkernfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountkernfs
160 ln -sf ../init.d/udev ${EXTDIR}/rc.d/rcsysinit.d/S10udev
161 ln -sf ../init.d/checkfs ${EXTDIR}/rc.d/rcsysinit.d/S20checkfs
162 ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rcsysinit.d/S30mountfs
163 ln -sf ../init.d/swap ${EXTDIR}/rc.d/rcsysinit.d/S40swap
164 ln -sf ../init.d/cleanfs ${EXTDIR}/rc.d/rcsysinit.d/S50cleanfs
165 ln -sf ../init.d/setclock ${EXTDIR}/rc.d/rcsysinit.d/S60setclock
166 if [ ! -f ${EXTDIR}/sysconfig/rc ]; then install -m ${CONFMODE} clfs/sysconfig/rc ${EXTDIR}/sysconfig/; fi
167 if [ ! -f ${EXTDIR}/sysconfig/createfiles ]; then install -m ${CONFMODE} clfs/sysconfig/createfiles ${EXTDIR}/sysconfig/; fi
168 @$(MAKE) mknod_devices
169
170install-raq2:
171 install -m ${MODE} clfs/init.d/paneld ${EXTDIR}/rc.d/init.d/
172 ln -sf ../init.d/paneld ${EXTDIR}/rc.d/rc0.d/K01paneld
173 ln -sf ../init.d/paneld ${EXTDIR}/rc.d/rc1.d/S99paneld
174 ln -sf ../init.d/paneld ${EXTDIR}/rc.d/rc2.d/S99paneld
175 ln -sf ../init.d/paneld ${EXTDIR}/rc.d/rc3.d/S99paneld
176 ln -sf ../init.d/paneld ${EXTDIR}/rc.d/rc4.d/S99paneld
177 ln -sf ../init.d/paneld ${EXTDIR}/rc.d/rc5.d/S99paneld
178 ln -sf ../init.d/paneld ${EXTDIR}/rc.d/rc6.d/K01paneld
179 if [ ! -f ${EXTDIR}/sysconfig/lcd ]; then install -m ${CONFMODE} clfs/sysconfig/lcd-raq2 ${EXTDIR}/sysconfig/lcd; fi
180
181install-raq3:
182 install -m ${MODE} clfs/init.d/setlcd ${EXTDIR}/rc.d/init.d/
183 ln -sf ../init.d/setlcd ${EXTDIR}/rc.d/rc0.d/K01setlcd
184 ln -sf ../init.d/setlcd ${EXTDIR}/rc.d/rc1.d/S99setlcd
185 ln -sf ../init.d/setlcd ${EXTDIR}/rc.d/rc2.d/S99setlcd
186 ln -sf ../init.d/setlcd ${EXTDIR}/rc.d/rc3.d/S99setlcd
187 ln -sf ../init.d/setlcd ${EXTDIR}/rc.d/rc4.d/S99setlcd
188 ln -sf ../init.d/setlcd ${EXTDIR}/rc.d/rc5.d/S99setlcd
189 ln -sf ../init.d/setlcd ${EXTDIR}/rc.d/rc6.d/K01setlcd
190 if [ ! -f ${EXTDIR}/sysconfig/lcd ]; then install -m ${CONFMODE} clfs/sysconfig/lcd-raq3 ${EXTDIR}/sysconfig/lcd; fi
191
192install-lcd:
193 if [ ! -f ${EXTDIR}/sysconfig/lcd ]; then install -m ${CONFMODE} clfs/sysconfig/lcd ${EXTDIR}/sysconfig/lcd; fi
194
195.PHONY: all create-dirs create-service-dir install install-consolelog \
196 install-service-mtu minimal install-lcd install-raq2 install-raq3
Note: See TracBrowser for help on using the repository browser.