5b8b602737a5c7dcd4c0c719779ff1ac2364edcc
[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 ifeq "$(LFS_PASS)" "install"
34 TARGET = $(DIR_INFO)/$(THISAPP)-install
35 else
36 TARGET = $(DIR_INFO)/$(THISAPP)
37 endif
38
39 ###############################################################################
40 # Top-level Rules
41 ###############################################################################
42
43 objects = $(DL_FILE) udev-config-6.2.tar.bz2
44
45 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
46 udev-config-6.2.tar.bz2 = $(DL_FROM)/udev-config-6.2.tar.bz2
47
48 $(DL_FILE)_MD5 = be98e04cefdd9ca76b8fe7e92735ce29
49 udev-config-6.2.tar.bz2_MD5 = 9ff2667ab0f7bfe8182966ef690078a0
50
51 install : $(TARGET)
52
53 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
54
55 download :$(patsubst %,$(DIR_DL)/%,$(objects))
56
57 md5 : $(subst %,%_MD5,$(objects))
58
59 ###############################################################################
60 # Downloading, checking, md5sum
61 ###############################################################################
62
63 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
64 @$(CHECK)
65
66 $(patsubst %,$(DIR_DL)/%,$(objects)) :
67 @$(LOAD)
68
69 $(subst %,%_MD5,$(objects)) :
70 @$(MD5)
71
72 ###############################################################################
73 # Installation Details
74 ###############################################################################
75
76 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
77 @$(PREBUILD)
78 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
79 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-125-netif_rename.patch
80 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-125-ext4_wo_journal.patch
81 rm -rf /lib/udev/devices
82 cd $(DIR_APP) && tar jxf $(DIR_DL)/udev-config-6.2.tar.bz2
83 cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/udev-config-6.2_persistent-storage-fix.patch
84 cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/udev-config-6.2_remove-lfs-usb-rule.patch
85 install -dv /lib/{firmware,udev/devices/{pts,shm}}
86 echo "Put device firmwares here ..." > /lib/firmware/dirinfo
87 mknod -m0666 /lib/udev/devices/null c 1 3
88 ln -sv /proc/self/fd /lib/udev/devices/fd
89 ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
90 ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
91 ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
92 ln -sv /proc/kcore /lib/udev/devices/core
93 cd $(DIR_APP) && make $(MAKETUNING) EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
94 extras/firmware extras/floppy extras/path_id \
95 extras/scsi_id extras/usb_id extras/volume_id"
96 cd $(DIR_APP) && make DESTDIR=/ EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
97 extras/firmware extras/floppy extras/path_id \
98 extras/scsi_id extras/usb_id extras/volume_id" install
99 cd $(DIR_APP) && cp -v udev-config-6.2/[0-9]* /etc/udev/rules.d/
100 cp -rf $(DIR_SRC)/config/udev/10-dvb.rules /etc/udev/rules.d/
101 cp -rf $(DIR_SRC)/config/udev/55-scsi-cdrom.rules /etc/udev/rules.d/
102 chmod 644 /etc/udev/rules.d/10-dvb.rules
103 chmod 644 /etc/udev/rules.d/55-scsi-cdrom.rules
104 cp -rf $(DIR_SRC)/config/udev/dvb.sh /etc/udev/
105 chmod 755 /etc/udev/dvb.sh
106 touch /etc/udev/rules.d/30-persistent-network.rules
107 cp -vf $(DIR_SRC)/config/udev/blacklist /etc/modprobe.d/blacklist
108
109 # Install codel rules.
110 install -v -m 644 $(DIR_SRC)/config/udev/99-codel.rules \
111 /lib/udev/rules.d
112 install -m 755 $(DIR_SRC)/config/udev/enable_codel \
113 /lib/udev/enable_codel
114 @rm -rf $(DIR_APP)
115 @$(POSTBUILD)