| 1 | INITMODE=754
 | 
|---|
| 2 | DIRMODE=755
 | 
|---|
| 3 | SCRIPTMODE=755
 | 
|---|
| 4 | RULESMODE=644
 | 
|---|
| 5 | CONFMODE=644
 | 
|---|
| 6 | LIBDIR=lib
 | 
|---|
| 7 | 
 | 
|---|
| 8 | all: help
 | 
|---|
| 9 | 
 | 
|---|
| 10 | install: device_dirs device_links rules scripts boot mknod_devices
 | 
|---|
| 11 | 
 | 
|---|
| 12 | install-minimal: install-netboot boot
 | 
|---|
| 13 | 
 | 
|---|
| 14 | install-netboot: device_dirs device_links rules-netboot mknod_devices
 | 
|---|
| 15 | 
 | 
|---|
| 16 | rules:
 | 
|---|
| 17 |         install -d ${DESTDIR}/etc/udev/rules.d
 | 
|---|
| 18 |         install -m ${RULESMODE} 05-udev-early.rules ${DESTDIR}/etc/udev/rules.d/05-udev-early.rules
 | 
|---|
| 19 |         install -m ${RULESMODE} 35-helper.rules ${DESTDIR}/etc/udev/rules.d/35-helper.rules
 | 
|---|
| 20 |         install -m ${RULESMODE} 40-modprobe.rules ${DESTDIR}/etc/udev/rules.d/40-modprobe.rules
 | 
|---|
| 21 |         install -m ${RULESMODE} 50-udev.rules ${DESTDIR}/etc/udev/rules.d/50-udev.rules
 | 
|---|
| 22 |         install -m ${RULESMODE} 60-persistent-disk.rules ${DESTDIR}/etc/udev/rules.d/60-persistent-disk.rules
 | 
|---|
| 23 |         install -m ${RULESMODE} 61-persistent-input.rules ${DESTDIR}/etc/udev/rules.d/61-persistent-input.rules
 | 
|---|
| 24 |         install -m ${RULESMODE} 90-user.rules ${DESTDIR}/etc/udev/rules.d/90-user.rules
 | 
|---|
| 25 |         install -m ${RULESMODE} 95-debug.rules ${DESTDIR}/etc/udev/rules.d/95-debug.rules
 | 
|---|
| 26 | 
 | 
|---|
| 27 | rules-netboot:
 | 
|---|
| 28 |         install -d ${DESTDIR}/etc/udev/rules.d
 | 
|---|
| 29 |         install -m ${RULESMODE} 05-udev-early.rules ${DESTDIR}/etc/udev/rules.d/05-udev-early.rules
 | 
|---|
| 30 |         install -m ${RULESMODE} 50-udev.rules ${DESTDIR}/etc/udev/rules.d/50-udev.rules
 | 
|---|
| 31 | 
 | 
|---|
| 32 | scripts:
 | 
|---|
| 33 |         install -d -m ${DIRMODE} ${DESTDIR}/${LIBDIR}/udev
 | 
|---|
| 34 |         install -m ${SCRIPTMODE} load_floppy_module.sh ${DESTDIR}/${LIBDIR}/udev/load_floppy_module.sh
 | 
|---|
| 35 |         install -m ${SCRIPTMODE} cdsymlink_helper.sh ${DESTDIR}/${LIBDIR}/udev/cdsymlink_helper.sh
 | 
|---|
| 36 | 
 | 
|---|
| 37 | boot:
 | 
|---|
| 38 |         install -d ${DESTDIR}/usr/share/udev
 | 
|---|
| 39 |         install -d ${DESTDIR}/etc/rc.d/rcsysinit.d
 | 
|---|
| 40 |         install -d ${DESTDIR}/etc/rc.d/init.d
 | 
|---|
| 41 |         install -m ${INITMODE} udev ${DESTDIR}/etc/rc.d/init.d/udev
 | 
|---|
| 42 |         install -m ${SCRIPTMODE} show_event_log ${DESTDIR}/usr/share/udev/show_event_log
 | 
|---|
| 43 |         ln -sf ../init.d/udev ${DESTDIR}/etc/rc.d/rcsysinit.d/S10udev
 | 
|---|
| 44 | 
 | 
|---|
| 45 | device_dirs:
 | 
|---|
| 46 |         install -d -m ${DIRMODE} ${DESTDIR}/${LIBDIR}/udev/devices
 | 
|---|
| 47 |         install -d -m ${DIRMODE} ${DESTDIR}/${LIBDIR}/udev/devices/pts
 | 
|---|
| 48 |         install -d -m ${DIRMODE} ${DESTDIR}/${LIBDIR}/udev/devices/shm
 | 
|---|
| 49 |         install -d -m ${DIRMODE} ${DESTDIR}/${LIBDIR}/udev/devices/net
 | 
|---|
| 50 | 
 | 
|---|
| 51 | device_links: device_dirs
 | 
|---|
| 52 |         ln -snf /proc/self/fd ${DESTDIR}/${LIBDIR}/udev/devices/fd
 | 
|---|
| 53 |         ln -snf /proc/self/fd/0 ${DESTDIR}/${LIBDIR}/udev/devices/stdin
 | 
|---|
| 54 |         ln -snf /proc/self/fd/1 ${DESTDIR}/${LIBDIR}/udev/devices/stdout
 | 
|---|
| 55 |         ln -snf /proc/self/fd/2 ${DESTDIR}/${LIBDIR}/udev/devices/stderr
 | 
|---|
| 56 |         ln -snf /proc/kcore ${DESTDIR}/${LIBDIR}/udev/devices/core
 | 
|---|
| 57 | 
 | 
|---|
| 58 | mknod_devices: device_dirs
 | 
|---|
| 59 |         @if [ "$$UID" = "0" ]; then \
 | 
|---|
| 60 |                 if ! [ -e ${DESTDIR}/${LIBDIR}/udev/devices/null ]; then \
 | 
|---|
| 61 |                         mknod -m 0666 ${DESTDIR}/${LIBDIR}/udev/devices/null c 1 3 ;\
 | 
|---|
| 62 |                 fi \
 | 
|---|
| 63 |         fi
 | 
|---|
| 64 |         @if [ "$$UID" = "0" ]; then \
 | 
|---|
| 65 |                 if ! [ -e ${DESTDIR}/${LIBDIR}/udev/devices/console ]; then \
 | 
|---|
| 66 |                         mknod -m 0600 ${DESTDIR}/${LIBDIR}/udev/devices/console c 5 1 ;\
 | 
|---|
| 67 |                 fi \
 | 
|---|
| 68 |         fi
 | 
|---|
| 69 |         @if [ "$$UID" != "0" ]; then \
 | 
|---|
| 70 |                 if ! [ -e ${DESTDIR}/${LIBDIR}/udev/devices/null ]; then \
 | 
|---|
| 71 |                         echo "You will need to issue the following command as the root user" ;\
 | 
|---|
| 72 |                         echo "" ;\
 | 
|---|
| 73 |                         echo "mknod -m 0666 ${DESTDIR}/${LIBDIR}/udev/devices/null c 1 3" ;\
 | 
|---|
| 74 |                 fi \
 | 
|---|
| 75 |         fi
 | 
|---|
| 76 |         @if [ "$$UID" != "0" ]; then \
 | 
|---|
| 77 |                 if ! [ -e ${DESTDIR}/${LIBDIR}/udev/devices/console ]; then \
 | 
|---|
| 78 |                         echo "mknod -m 0600 ${DESTDIR}/${LIBDIR}/udev/devices/console c 5 1" ;\
 | 
|---|
| 79 |                         echo "" ;\
 | 
|---|
| 80 |                 fi \
 | 
|---|
| 81 |         fi
 | 
|---|
| 82 | 
 | 
|---|
| 83 | help:
 | 
|---|
| 84 |         @echo "command                          description"
 | 
|---|
| 85 |         @echo "---------------------------------------------------------------------------------------"
 | 
|---|
| 86 |         @echo "make install                     install udev rules package and helper scripts"
 | 
|---|
| 87 |         @echo "make install-device-mapper       install device-mapper rules"
 | 
|---|
| 88 |         @echo "make install-dm                  install dm rules"
 | 
|---|
| 89 |         @echo "make install-netboot             install udev rules package for netboot"
 | 
|---|
| 90 |         @echo "make install-network             install network helper package"
 | 
|---|
| 91 |         @echo "make install-network-upgrade     upgrades current network helper package"
 | 
|---|
| 92 |         @echo "make install-sound               install sound rules"
 | 
|---|
| 93 |         @echo "---------------------------------------------------------------------------------------"
 | 
|---|
| 94 |         @echo "add LIBDIR=lib64                 when using /lib64/"
 | 
|---|
| 95 |         @echo "example  make  LIBDIR=lib64 install"
 | 
|---|
| 96 |         @echo "---------------------------------------------------------------------------------------"
 | 
|---|
| 97 | 
 | 
|---|
| 98 | install-helper-functions:
 | 
|---|
| 99 |         install -d ${DESTDIR}/${LIBDIR}/udev
 | 
|---|
| 100 |         install -d ${DESTDIR}/etc/sysconfig
 | 
|---|
| 101 |         install -m 644 contrib/common/helper.functions ${DESTDIR}/${LIBDIR}/udev/helper.functions
 | 
|---|
| 102 |         install -m 644 contrib/common/udev_helper ${DESTDIR}/etc/sysconfig/udev_helper
 | 
|---|
| 103 |         
 | 
|---|
| 104 | install-dm: install-device-mapper
 | 
|---|
| 105 | 
 | 
|---|
| 106 | install-device-mapper:
 | 
|---|
| 107 |         install -d ${DESTDIR}/${LIBDIR}/udev
 | 
|---|
| 108 |         install -d ${DESTDIR}/etc/rc.d/init.d
 | 
|---|
| 109 |         install -m ${RULESMODE} 64-device-mapper.rules ${DESTDIR}/etc/udev/rules.d/64-device-mapper.rules
 | 
|---|
| 110 |         install -m ${RULESMODE} 65-dm-raid.rules ${DESTDIR}/etc/udev/rules.d/65-dm-raid.rules
 | 
|---|
| 111 | 
 | 
|---|
| 112 | install-network: install-helper-functions install-network-update
 | 
|---|
| 113 |         install -d ${DESTDIR}/etc/udev/rules.d/
 | 
|---|
| 114 |         @echo "Adding rules to ${DESTDIR}/etc/udev/rules.d/35-helper.rules."
 | 
|---|
| 115 |         @cp ${DESTDIR}/etc/udev/rules.d/35-helper.rules /tmp/first
 | 
|---|
| 116 |         @cat /tmp/first contrib/network/rules > ${DESTDIR}/etc/udev/rules.d/35-helper.rules 2>&1
 | 
|---|
| 117 |         @rm -f ${DESTDIR}/etc/rc.d/rc2.d/*network
 | 
|---|
| 118 |         @rm -f ${DESTDIR}/etc/rc.d/rc{3,4,5}.d/*network
 | 
|---|
| 119 | 
 | 
|---|
| 120 | install-sound:
 | 
|---|
| 121 |         install -d ${DESTDIR}/${LIBDIR}/udev
 | 
|---|
| 122 |         install -d ${DESTDIR}/etc/rc.d/init.d
 | 
|---|
| 123 |         install -m ${RULESMODE} 55-sound.rules ${DESTDIR}/etc/udev/rules.d/55-sound.rules
 | 
|---|
| 124 | 
 | 
|---|
| 125 | install-network-update:
 | 
|---|
| 126 |         install -d ${DESTDIR}/${LIBDIR}/udev
 | 
|---|
| 127 |         install -d ${DESTDIR}/etc/rc.d/init.d
 | 
|---|
| 128 |         install -m ${SCRIPTMODE} contrib/network/network_helper.sh ${DESTDIR}/${LIBDIR}/udev/network_helper.sh
 | 
|---|
| 129 |         install -m ${INITMODE} contrib/network/network ${DESTDIR}/etc/rc.d/init.d/network
 | 
|---|
| 130 | 
 | 
|---|
| 131 | .PHONY: all install device_dirs device_links rules scripts boot mknod_devices \
 | 
|---|
| 132 |         help install-helper-functions install-network install-network-update \
 | 
|---|
| 133 |         install-netboot rules-netboot install-dm install-device-mapper \
 | 
|---|
| 134 |         install-sound
 | 
|---|