]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/udev
vdradmin part II
[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 = 096
28
29 THISAPP = udev-$(VER)
30 DL_FILE = $(THISAPP).tar.bz2
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 ifeq "$(KLIBC)" "1"
37 TARGET = $(DIR_INFO)/$(THISAPP)-klibc
38 else
39 TARGET = $(DIR_INFO)/$(THISAPP)
40 endif
41 endif
42
43 ###############################################################################
44 # Top-level Rules
45 ###############################################################################
46
47 objects = $(DL_FILE) udev-config-6.2.tar.bz2
48
49 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
50 udev-config-6.2.tar.bz2 = $(DL_FROM)/udev-config-6.2.tar.bz2
51
52 $(DL_FILE)_MD5 = f4effef7807ce1dc91ab581686ef197b
53 udev-config-6.2.tar.bz2_MD5 = 9ff2667ab0f7bfe8182966ef690078a0
54
55 install : $(TARGET)
56
57 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
58
59 download :$(patsubst %,$(DIR_DL)/%,$(objects))
60
61 md5 : $(subst %,%_MD5,$(objects))
62
63 ###############################################################################
64 # Downloading, checking, md5sum
65 ###############################################################################
66
67 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
68 @$(CHECK)
69
70 $(patsubst %,$(DIR_DL)/%,$(objects)) :
71 @$(LOAD)
72
73 $(subst %,%_MD5,$(objects)) :
74 @$(MD5)
75
76 ###############################################################################
77 # Installation Details
78 ###############################################################################
79
80 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
81 @$(PREBUILD)
82 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
83 ifeq "$(LFS_PASS)" "install"
84 cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev
85 cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev install
86 rm -f /install/initrd/sbin/udev* /install/initrd/usr/sbin/udev* /install/initrd/usr/bin/udev*
87 cd $(DIR_APP) && install udevstart udevinfo udevd udevsettle udevtrigger /install/initrd/sbin
88 cd $(DIR_APP) && make $(MAKETUNING) 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"
91 cd $(DIR_APP) && make DESTDIR=/install/initrd EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
92 extras/firmware extras/floppy extras/path_id \
93 extras/scsi_id extras/usb_id extras/volume_id" install
94 cd /install/initrd/usr/share && rm -rf man
95 cd /install/initrd/dev && rm -f console
96 cd /install/initrd/dev && mknod -m 0600 console c 5 1
97 cd /install/initrd/dev && rm -f null
98 cd /install/initrd/dev && mknod -m 0777 null c 1 3
99 cd /install/initrd/dev && rm -f tty*
100 cd /install/initrd/dev && mknod -m 0600 tty1 c 4 1
101 cd /install/initrd/dev && mknod -m 0600 tty2 c 4 2
102 cd /install/initrd/dev && mknod -m 0600 tty3 c 4 3
103 cd /install/initrd/dev && mknod -m 0600 tty4 c 4 4
104 cd /install/initrd/dev && mknod -m 0600 tty5 c 4 5
105 cd /install/initrd/dev && mknod -m 0600 tty6 c 4 6
106 cp -f /etc/udev/rules.d/55-scsi-cdrom.rules /install/initrd/etc/udev/rules.d/55-scsi-cdrom.rules
107
108 else
109 ifeq "$(KLIBC)" "1"
110 cd $(DIR_APP) && sed -i "s|USE_LOG = .*|USE_LOG = false|g" Makefile
111 cd $(DIR_APP) && sed -i "s|USE_KLIBC = .*|USE_KLIBC = true|g" Makefile
112
113 cd $(DIR_APP) && make PROGRAMS="udevd udevsettle udevtrigger" EXTRAS="extras/firmware extras/cdrom_id"
114
115 -mkdir -p /lib/initcpio/udev
116 -mkdir -p /lib/initcpio/install
117 -mkdir -p /lib/initcpio/hooks
118 cd $(DIR_APP) && install -m755 udevd /lib/initcpio/udev
119 cd $(DIR_APP) && install -m755 udevtrigger /lib/initcpio/udev
120 cd $(DIR_APP) && install -m755 udevsettle /lib/initcpio/udev
121 cd $(DIR_APP) && install -m755 extras/firmware/firmware.sh /lib/initcpio/udev
122 cd $(DIR_APP) && install -m755 extras/cdrom_id/cdrom_id /lib/initcpio/udev
123
124 install -m755 $(DIR_SRC)/config/mkinitcpio/start_udev /lib/initcpio/udev
125 install -m644 $(DIR_SRC)/config/mkinitcpio/udev.rules /lib/initcpio/udev
126 install -m755 $(DIR_SRC)/config/mkinitcpio/load-modules.sh /lib/initcpio/udev
127 install -m644 $(DIR_SRC)/config/mkinitcpio/udev_install /lib/initcpio/install/udev
128 install -m644 $(DIR_SRC)/config/mkinitcpio/udev_hook /lib/initcpio/hooks/udev
129
130 else
131 rm -rf /lib/udev/devices
132 cd $(DIR_APP) && tar jxf $(DIR_DL)/udev-config-6.2.tar.bz2
133 install -dv /lib/{firmware,udev/devices/{pts,shm}}
134 echo "Put device firmwares here ..." > /lib/firmware/dirinfo
135 mknod -m0666 /lib/udev/devices/null c 1 3
136 ln -sv /proc/self/fd /lib/udev/devices/fd
137 ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
138 ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
139 ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
140 ln -sv /proc/kcore /lib/udev/devices/core
141 cd $(DIR_APP) && make $(MAKETUNING) EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
142 extras/firmware extras/floppy extras/path_id \
143 extras/scsi_id extras/usb_id extras/volume_id"
144 cd $(DIR_APP) && make DESTDIR=/ EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
145 extras/firmware extras/floppy extras/path_id \
146 extras/scsi_id extras/usb_id extras/volume_id" install
147 cd $(DIR_APP) && cp -v udev-config-6.2/[0-9]* /etc/udev/rules.d/
148 cp -rf $(DIR_SRC)/config/udev/10-dvb.rules /etc/udev/rules.d/
149 cp -rf $(DIR_SRC)/config/udev/55-scsi-cdrom.rules /etc/udev/rules.d/
150 chmod 644 /etc/udev/rules.d/10-dvb.rules
151 chmod 644 /etc/udev/rules.d/55-scsi-cdrom.rules
152 cp -rf $(DIR_SRC)/config/udev/dvb.sh /etc/udev/
153 chmod 755 /etc/udev/dvb.sh
154 touch /etc/udev/rules.d/30-persistent-network.rules
155 cp -vf $(DIR_SRC)/config/udev/blacklist /etc/modprobe.d/blacklist
156 endif
157 endif
158 @rm -rf $(DIR_APP)
159 @$(POSTBUILD)