Readd udev dont rename netif if same name exsit patch.
[people/pmueller/ipfire-2.x.git] / lfs / udev
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
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 ifeq "$(LFS_PASS)" "install"
81 cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev
82 cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev install
83 rm -f /install/initrd/sbin/udev* /install/initrd/usr/sbin/udev* /install/initrd/usr/bin/udev*
84 cd $(DIR_APP) && install udevadm udevd /install/initrd/sbin
85 cd $(DIR_APP) && make $(MAKETUNING) EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
86 extras/firmware extras/floppy extras/path_id \
87 extras/scsi_id extras/usb_id extras/volume_id"
88 cd $(DIR_APP) && make DESTDIR=/install/initrd EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
89 extras/firmware extras/floppy extras/path_id \
90 extras/scsi_id extras/usb_id extras/volume_id" install
91 cd /install/initrd/usr/share && rm -rf man
92 -mkdir -pv /install/initrd/dev
93 cd /install/initrd/dev && rm -f console
94 cd /install/initrd/dev && mknod -m 0600 console c 5 1
95 cd /install/initrd/dev && rm -f null
96 cd /install/initrd/dev && mknod -m 0777 null c 1 3
97 cd /install/initrd/dev && rm -f tty*
98 cd /install/initrd/dev && mknod -m 0600 tty1 c 4 1
99 cd /install/initrd/dev && mknod -m 0600 tty2 c 4 2
100 cd /install/initrd/dev && mknod -m 0600 tty3 c 4 3
101 cd /install/initrd/dev && mknod -m 0600 tty4 c 4 4
102 cd /install/initrd/dev && mknod -m 0600 tty5 c 4 5
103 cd /install/initrd/dev && mknod -m 0600 tty6 c 4 6
104 cp -f /etc/udev/rules.d/55-scsi-cdrom.rules /install/initrd/etc/udev/rules.d/55-scsi-cdrom.rules
105
106 else
107 rm -rf /lib/udev/devices
108 cd $(DIR_APP) && tar jxf $(DIR_DL)/udev-config-6.2.tar.bz2
109 cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/udev-config-6.2_persistent-storage-fix.patch
110 install -dv /lib/{firmware,udev/devices/{pts,shm}}
111 echo "Put device firmwares here ..." > /lib/firmware/dirinfo
112 mknod -m0666 /lib/udev/devices/null c 1 3
113 ln -sv /proc/self/fd /lib/udev/devices/fd
114 ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
115 ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
116 ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
117 ln -sv /proc/kcore /lib/udev/devices/core
118 cd $(DIR_APP) && make $(MAKETUNING) EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
119 extras/firmware extras/floppy extras/path_id \
120 extras/scsi_id extras/usb_id extras/volume_id"
121 cd $(DIR_APP) && make DESTDIR=/ EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
122 extras/firmware extras/floppy extras/path_id \
123 extras/scsi_id extras/usb_id extras/volume_id" install
124 cd $(DIR_APP) && cp -v udev-config-6.2/[0-9]* /etc/udev/rules.d/
125 cp -rf $(DIR_SRC)/config/udev/10-dvb.rules /etc/udev/rules.d/
126 cp -rf $(DIR_SRC)/config/udev/55-scsi-cdrom.rules /etc/udev/rules.d/
127 chmod 644 /etc/udev/rules.d/10-dvb.rules
128 chmod 644 /etc/udev/rules.d/55-scsi-cdrom.rules
129 cp -rf $(DIR_SRC)/config/udev/dvb.sh /etc/udev/
130 chmod 755 /etc/udev/dvb.sh
131 touch /etc/udev/rules.d/30-persistent-network.rules
132 cp -vf $(DIR_SRC)/config/udev/blacklist /etc/modprobe.d/blacklist
133 endif
134 @rm -rf $(DIR_APP)
135 @$(POSTBUILD)