6e31c90750ca4a3a72e9ce4d7ac4ba2efb781663
[people/teissler/ipfire-2.x.git] / lfs / udev
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
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 #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 125
28
29 THISAPP = udev-$(VER)
30 DL_FILE = $(THISAPP).tar.gz
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
33 TARGET = $(DIR_INFO)/$(THISAPP)
34
35 ###############################################################################
36 # Top-level Rules
37 ###############################################################################
38
39 objects = $(DL_FILE) udev-config-6.2.tar.bz2
40
41 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
42 udev-config-6.2.tar.bz2 = $(DL_FROM)/udev-config-6.2.tar.bz2
43
44 $(DL_FILE)_MD5 = be98e04cefdd9ca76b8fe7e92735ce29
45 udev-config-6.2.tar.bz2_MD5 = 9ff2667ab0f7bfe8182966ef690078a0
46
47 install : $(TARGET)
48
49 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
50
51 download :$(patsubst %,$(DIR_DL)/%,$(objects))
52
53 md5 : $(subst %,%_MD5,$(objects))
54
55 ###############################################################################
56 # Downloading, checking, md5sum
57 ###############################################################################
58
59 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
60 @$(CHECK)
61
62 $(patsubst %,$(DIR_DL)/%,$(objects)) :
63 @$(LOAD)
64
65 $(subst %,%_MD5,$(objects)) :
66 @$(MD5)
67
68 ###############################################################################
69 # Installation Details
70 ###############################################################################
71
72 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
73 @$(PREBUILD)
74 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
75 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-125-netif_rename.patch
76 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-125-ext4_wo_journal.patch
77 rm -rf /lib/udev/devices
78 cd $(DIR_APP) && tar jxf $(DIR_DL)/udev-config-6.2.tar.bz2
79 cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/udev-config-6.2_persistent-storage-fix.patch
80 cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/udev-config-6.2_remove-lfs-usb-rule.patch
81 install -dv /lib/{firmware,udev/devices/{pts,shm}}
82 echo "Put device firmwares here ..." > /lib/firmware/dirinfo
83 mknod -m0666 /lib/udev/devices/null c 1 3
84 ln -sv /proc/self/fd /lib/udev/devices/fd
85 ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
86 ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
87 ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
88 ln -sv /proc/kcore /lib/udev/devices/core
89 cd $(DIR_APP) && make $(MAKETUNING) EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
90 extras/firmware extras/floppy extras/path_id \
91 extras/scsi_id extras/usb_id extras/volume_id"
92 cd $(DIR_APP) && make DESTDIR=/ EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
93 extras/firmware extras/floppy extras/path_id \
94 extras/scsi_id extras/usb_id extras/volume_id" install
95 cd $(DIR_APP) && cp -v udev-config-6.2/[0-9]* /etc/udev/rules.d/
96 cp -rf $(DIR_SRC)/config/udev/10-dvb.rules /etc/udev/rules.d/
97 cp -rf $(DIR_SRC)/config/udev/55-scsi-cdrom.rules /etc/udev/rules.d/
98 chmod 644 /etc/udev/rules.d/10-dvb.rules
99 chmod 644 /etc/udev/rules.d/55-scsi-cdrom.rules
100 cp -rf $(DIR_SRC)/config/udev/dvb.sh /etc/udev/
101 chmod 755 /etc/udev/dvb.sh
102 touch /etc/udev/rules.d/30-persistent-network.rules
103 cp -vf $(DIR_SRC)/config/udev/blacklist /etc/modprobe.d/blacklist
104
105 # Install codel rules.
106 install -v -m 644 $(DIR_SRC)/config/udev/99-codel.rules \
107 /lib/udev/rules.d
108 install -m 755 $(DIR_SRC)/config/udev/enable_codel \
109 /lib/udev/enable_codel
110 @rm -rf $(DIR_APP)
111 @$(POSTBUILD)