]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/initscripts
Cleanup toolchain scripts
[ipfire-2.x.git] / lfs / initscripts
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
3917eadc 4# Copyright (C) 2007-2016 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
7b9e5f10
MT
27VER = ipfire
28
cd1a2927
MT
29THISAPP = initscripts
30DIR_APP = $(DIR_SRC)/$(THISAPP)
31TARGET = $(DIR_INFO)/$(THISAPP)
32
33###############################################################################
34# Top-level Rules
35###############################################################################
36
37install : $(TARGET)
38
39check :
40
41download :
42
43md5 :
44
45###############################################################################
46# Installation Details
47###############################################################################
48
49$(TARGET) :
50 @$(PREBUILD)
73d9a908 51 install -d -m 755 /etc/rc.d/rc0.d
73d9a908 52 install -d -m 755 /etc/rc.d/rc3.d
73d9a908
MT
53 install -d -m 755 /etc/rc.d/rc6.d
54 install -d -m 755 /etc/rc.d/rcsysinit.d
55 install -d -m 755 /etc/rc.d/init.d
d1e90efc
MT
56 install -d -m 755 /etc/rc.d/init.d/networking
57 install -d -m 755 /etc/rc.d/init.d/networking/red.up
58 install -d -m 755 /etc/rc.d/init.d/networking/red.down
069680ac 59 install -d -m 755 /etc/rc.d/helper
73d9a908 60 install -d -m 755 /etc/sysconfig
406f019f 61 -rm -rf /etc/init.d
05207d69 62 ln -svf rc.d/init.d /etc/init.d
73d9a908 63
ee3dec50
MT
64 # Create default ramdisk configuration
65 echo "RAMDISK_MODE=0" > /etc/sysconfig/ramdisk
c4a451ee 66
33f53d55 67 for i in $(DIR_SRC)/src/initscripts/system/*; do \
23104841
MT
68 install -v -m 754 $$i /etc/rc.d/init.d/; \
69 done
70 chmod 644 /etc/rc.d/init.d/functions
71
629fcb1d 72 for i in $(DIR_SRC)/src/initscripts/networking/*; do \
406f019f 73 if [ -f $$i ]; then \
d1e90efc 74 install -v -m 754 $$i /etc/rc.d/init.d/networking/; \
406f019f 75 fi; \
9c16cd92
MT
76 done
77
629fcb1d 78 for i in $(DIR_SRC)/src/initscripts/networking/red.up/*; do \
d1e90efc 79 install -v -m 754 $$i /etc/rc.d/init.d/networking/red.up/; \
9c16cd92
MT
80 done
81
629fcb1d 82 for i in $(DIR_SRC)/src/initscripts/networking/red.down/*; do \
d1e90efc 83 install -v -m 754 $$i /etc/rc.d/init.d/networking/red.down/; \
9c16cd92
MT
84 done
85
65998e0a
MT
86 for i in $(DIR_SRC)/src/initscripts/sysconfig/*; do \
87 install -v -m 644 $$i /etc/sysconfig/; \
88 done
b7ce6aa3 89 chmod -v 755 /etc/sysconfig/{firewall,rc}.local
65998e0a 90
069680ac
MT
91 for i in $(DIR_SRC)/src/initscripts/helper/*; do \
92 install -v -m 755 $$i /etc/rc.d/helper/; \
93 done
94
73d9a908
MT
95 ln -sf ../init.d/sysklogd /etc/rc.d/rc0.d/K90sysklogd
96 ln -sf ../init.d/sendsignals /etc/rc.d/rc0.d/S60sendsignals
55b4c7ed
MT
97 ln -sf ../init.d/localnet /etc/rc.d/rc0.d/S70localnet
98 ln -sf ../init.d/mountfs /etc/rc.d/rc0.d/S80mountfs
99 ln -sf ../init.d/swap /etc/rc.d/rc0.d/S90swap
73d9a908 100 ln -sf ../init.d/halt /etc/rc.d/rc0.d/S99halt
73d9a908 101 ln -sf ../init.d/sysklogd /etc/rc.d/rc3.d/S10sysklogd
d7fb75d9 102 ln -sf ../init.d/smartenabler /etc/rc.d/rc3.d/S19smartenabler
2c1b94f0
AF
103 ln -sf ../init.d/messagebus /etc/rc.d/rc3.d/S15messagebus
104 ln -sf ../init.d/messagebus /etc/rc.d/rc0.d/K85messagebus
105 ln -sf ../init.d/messagebus /etc/rc.d/rc6.d/K85messagebus
106 ln -sf ../init.d/bluetooth /etc/rc.d/rc3.d/S16bluetooth
107 ln -sf ../init.d/bluetooth /etc/rc.d/rc0.d/K84bluetooth
108 ln -sf ../init.d/bluetooth /etc/rc.d/rc6.d/K84bluetooth
d2c65e37 109 ln -sf ../init.d/cpufreq /etc/rc.d/rc3.d/S18cpufreq
73d9a908
MT
110 ln -sf ../init.d/sysklogd /etc/rc.d/rc6.d/K90sysklogd
111 ln -sf ../init.d/sendsignals /etc/rc.d/rc6.d/S60sendsignals
112 ln -sf ../init.d/mountfs /etc/rc.d/rc6.d/S70mountfs
113 ln -sf ../init.d/swap /etc/rc.d/rc6.d/S80swap
114 ln -sf ../init.d/localnet /etc/rc.d/rc6.d/S90localnet
115 ln -sf ../init.d/reboot /etc/rc.d/rc6.d/S99reboot
23104841 116 ln -sf ../init.d/sshd /etc/rc.d/rc0.d/K30sshd
23104841 117 ln -sf ../init.d/sshd /etc/rc.d/rc3.d/S30sshd
23104841
MT
118 ln -sf ../init.d/sshd /etc/rc.d/rc6.d/K30sshd
119 ln -sf ../init.d/apache /etc/rc.d/rc0.d/K28apache
23104841 120 ln -sf ../init.d/apache /etc/rc.d/rc3.d/S32apache
23104841
MT
121 ln -sf ../init.d/apache /etc/rc.d/rc6.d/K28apache
122 ln -sf ../init.d/fcron /etc/rc.d/rc0.d/K08fcron
23104841 123 ln -sf ../init.d/fcron /etc/rc.d/rc3.d/S40fcron
23104841 124 ln -sf ../init.d/fcron /etc/rc.d/rc6.d/K08fcron
8dc25f04
AF
125 ln -sf ../init.d/snort /etc/rc.d/rc0.d/K78snort
126 ln -sf ../init.d/snort /etc/rc.d/rc6.d/K78snort
3fd5feeb
MT
127 ln -sf ../init.d/network /etc/rc.d/rc0.d/K80network
128 ln -sf ../init.d/network /etc/rc.d/rc3.d/S20network
129 ln -sf ../init.d/network /etc/rc.d/rc6.d/K80network
811f3d30 130 ln -sf ../init.d/unbound /etc/rc.d/rc0.d/K79unbound
693928d7 131 ln -sf ../init.d/unbound /etc/rc.d/rc3.d/S11unbound
811f3d30 132 ln -sf ../init.d/unbound /etc/rc.d/rc6.d/K79unbound
71e32384
MT
133 ln -sf ../init.d/random /etc/rc.d/rc0.d/K45random
134 ln -sf ../init.d/random /etc/rc.d/rc3.d/S25random
135 ln -sf ../init.d/random /etc/rc.d/rc6.d/K45random
b7ce6aa3 136 ln -sf ../../sysconfig/rc.local /etc/rc.d/rc3.d/S98rc.local
35f90335
AF
137 ln -sf ../init.d/client175 /etc/rc.d/rc0.d/K34client175
138 ln -sf ../init.d/client175 /etc/rc.d/rc3.d/S66client175
139 ln -sf ../init.d/client175 /etc/rc.d/rc6.d/K34client175
d0515b01
CS
140 ln -sf ../init.d/sslh /etc/rc.d/rc3.d/S98sslh
141 ln -sf ../init.d/sslh /etc/rc.d/rc0.d/K02sslh
142 ln -sf ../init.d/sslh /etc/rc.d/rc6.d/K02sslh
a14691a5
AF
143 ln -sf ../init.d/vdradmin /etc/rc.d/rc3.d/S99vdradmin
144 ln -sf ../init.d/vdradmin /etc/rc.d/rc0.d/K01vdradmin
145 ln -sf ../init.d/vdradmin /etc/rc.d/rc6.d/K01vdradmin
f4c3f459
AF
146 ln -sf ../init.d/motion /etc/rc.d/rc3.d/S99motion
147 ln -sf ../init.d/motion /etc/rc.d/rc0.d/K01motion
148 ln -sf ../init.d/motion /etc/rc.d/rc6.d/K01motion
aac0f711
CS
149 ln -sf ../init.d/imspetor /etc/rc.d/rc3.d/S99imspetor
150 ln -sf ../init.d/imspetor /etc/rc.d/rc0.d/K01imspetor
151 ln -sf ../init.d/imspetor /etc/rc.d/rc6.d/K01imspetor
d7a707a8
AF
152 ln -sf ../init.d/cyrus-sasl /etc/rc.d/rc0.d/K49cyrus-sasl
153 ln -sf ../init.d/cyrus-sasl /etc/rc.d/rc3.d/S24cyrus-sasl
154 ln -sf ../init.d/cyrus-sasl /etc/rc.d/rc6.d/K49cyrus-sasl
d81baab2
MT
155 ln -sf ../init.d/leds /etc/rc.d/rc0.d/K79leds
156 ln -sf ../init.d/leds /etc/rc.d/rc3.d/S21leds
157 ln -sf ../init.d/leds /etc/rc.d/rc6.d/K79leds
485e4c15 158 ln -sf ../init.d/fireinfo /etc/rc.d/rc3.d/S15fireinfo
73d9a908 159 ln -sf ../init.d/mountkernfs /etc/rc.d/rcsysinit.d/S00mountkernfs
dfa68452 160 ln -sf ../init.d/sysctl /etc/rc.d/rcsysinit.d/S01sysctl
73d9a908
MT
161 ln -sf ../init.d/modules /etc/rc.d/rcsysinit.d/S05modules
162 ln -sf ../init.d/udev /etc/rc.d/rcsysinit.d/S10udev
b1e4de05 163 ln -sf ../init.d/waitdrives /etc/rc.d/rcsysinit.d/S19waitdrives
73d9a908 164 ln -sf ../init.d/swap /etc/rc.d/rcsysinit.d/S20swap
a2454679 165 ln -sf ../init.d/partresize /etc/rc.d/rcsysinit.d/S25partresize
73d9a908
MT
166 ln -sf ../init.d/checkfs /etc/rc.d/rcsysinit.d/S30checkfs
167 ln -sf ../init.d/mountfs /etc/rc.d/rcsysinit.d/S40mountfs
a2454679 168 ln -sf ../init.d/fsresize /etc/rc.d/rcsysinit.d/S42fsresize
722b419d 169 ln -sf ../init.d/mounttmpfs /etc/rc.d/rcsysinit.d/S43mounttmpfs
73d9a908
MT
170 ln -sf ../init.d/udev_retry /etc/rc.d/rcsysinit.d/S45udev_retry
171 ln -sf ../init.d/cleanfs /etc/rc.d/rcsysinit.d/S50cleanfs
172 ln -sf ../init.d/setclock /etc/rc.d/rcsysinit.d/S60setclock
0721f5a6
AF
173 ln -sf ../init.d/setclock /etc/rc.d/rc0.d/K47setclock
174 ln -sf ../init.d/setclock /etc/rc.d/rc6.d/K47setclock
73d9a908 175 ln -sf ../init.d/console /etc/rc.d/rcsysinit.d/S70console
6cf9e770 176 ln -sf ../init.d/firstsetup /etc/rc.d/rcsysinit.d/S75firstsetup
73d9a908 177 ln -sf ../init.d/localnet /etc/rc.d/rcsysinit.d/S80localnet
7d7740a4 178 ln -sf ../init.d/firewall /etc/rc.d/rcsysinit.d/S85firewall
600b99fb 179 ln -sf ../init.d/network-trigger /etc/rc.d/rcsysinit.d/S90network-trigger
8af8d5d1 180 ln -sf ../init.d/rngd /etc/rc.d/rcsysinit.d/S92rngd
c4a451ee
AM
181 ln -sf ../init.d/vnstat /etc/rc.d/rc3.d/S01vnstat
182 ln -sf ../init.d/vnstat /etc/rc.d/rc0.d/K51vnstat
183 ln -sf ../init.d/vnstat /etc/rc.d/rc6.d/K51vnstat
71ea0d68
SS
184 ln -sf ../init.d/wlanclient /etc/rc.d/rc0.d/K82wlanclient
185 ln -sf ../init.d/wlanclient /etc/rc.d/rc3.d/S19wlanclient
186 ln -sf ../init.d/wlanclient /etc/rc.d/rc6.d/K82wlanclient
485e4c15 187
d1e90efc 188 ln -sf ../../../../../usr/local/bin/snortctrl \
3027c6bb 189 /etc/rc.d/init.d/networking/red.up/23-RS-snort
d1e90efc 190 ln -sf ../../../../../usr/local/bin/qosctrl \
3027c6bb 191 /etc/rc.d/init.d/networking/red.up/24-RS-qos
3027c6bb 192 ln -sf ../../squid /etc/rc.d/init.d/networking/red.up/27-RS-squid
d1e90efc
MT
193
194 for i in green blue orange; do \
195 ln -sf any /etc/rc.d/init.d/networking/$$i; \
196 done
e4436f12 197
3917eadc 198 # ARM does not need acpid, intel no swconfig
dc7d6b20 199ifeq "$(BUILD_PLATFORM)" "arm"
3917eadc 200 rm -vf /etc/rc.d/init.d/acpid
ffeb717f 201 ln -sf ../init.d/swconfig /etc/rc.d/rcsysinit.d/S73swconfig
e4436f12 202else
ffeb717f 203 rm -vf /etc/rc.d/init.d/swconfig
10c30c20
AF
204 ln -sf ../init.d/acpid /etc/rc.d/rc3.d/S12acpid
205 ln -sf ../init.d/acpid /etc/rc.d/rc0.d/K87acpid
206 ln -sf ../init.d/acpid /etc/rc.d/rc6.d/K87acpid
e4436f12
MT
207endif
208
cd1a2927 209 @$(POSTBUILD)