1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs native /dev tree creation
|
---|
4 | # -----------------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 |
|
---|
12 | #set -x
|
---|
13 | cd ${SRC}
|
---|
14 | LOG=dev-native.log
|
---|
15 |
|
---|
16 | do_makedev() {
|
---|
17 | ### MAKEDEV ###
|
---|
18 | LOG="MAKEDEV.log"
|
---|
19 | max_log_init MAKEDEV ${MAKEDEV_VER} "" ${INSTLOGS} ${LOG}
|
---|
20 | bzcat < ${TARBALLS}/MAKEDEV-${MAKEDEV_VER}.bz2 > /dev/MAKEDEV &&
|
---|
21 | echo " o unpacked OK" &&
|
---|
22 | cd /dev &&
|
---|
23 | chmod 754 MAKEDEV &&
|
---|
24 | echo "Password: " &&
|
---|
25 | su -c "./MAKEDEV -v generic-nopty" > ${LOGFILE} 2>&1 &&
|
---|
26 | echo " o Devices created OK" || barf
|
---|
27 | }
|
---|
28 |
|
---|
29 | do_udev() {
|
---|
30 | LOG=udev-native.log
|
---|
31 |
|
---|
32 | set_libdirname
|
---|
33 | setup_multiarch
|
---|
34 |
|
---|
35 | unpack_tarball udev-${UDEV_VER}
|
---|
36 | cd ${PKGDIR}
|
---|
37 |
|
---|
38 | # apply a patch to fix permissions on /dev/null being reset root 600 by
|
---|
39 | # fcron. This behaviour appeared with udev-027
|
---|
40 | case ${UDEV_VER} in
|
---|
41 | 027 )
|
---|
42 | apply_patch udev-027-permissions-1
|
---|
43 | ;;
|
---|
44 | esac
|
---|
45 |
|
---|
46 | max_log_init udev ${UDEV_VER} "" ${BUILDLOGS} ${LOG}
|
---|
47 | CFLAGS="${TGT_CFLAGS}" \
|
---|
48 | make CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
49 | LD="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
50 | V="true" \
|
---|
51 | udevdir=/dev \
|
---|
52 | > ${LOGFILE} 2>&1 &&
|
---|
53 | echo " o Build OK" || barf
|
---|
54 |
|
---|
55 | min_log_init ${INSTLOGS} &&
|
---|
56 | CFLAGS="${TGT_CFLAGS}" \
|
---|
57 | make CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
58 | LD="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
59 | V="true" \
|
---|
60 | udevdir=/dev install \
|
---|
61 | > ${LOGFILE} 2>&1 &&
|
---|
62 | echo " o Install OK" || barf
|
---|
63 |
|
---|
64 | # Create bare minimum devices required
|
---|
65 | mknod -m 600 /dev/console c 5 1
|
---|
66 | mknod -m 666 /dev/null c 1 3
|
---|
67 |
|
---|
68 | # create rules and permissions files
|
---|
69 | echo " - Adding rules/permissions files"
|
---|
70 | case ${UDEV_VER} in
|
---|
71 | 02[7-9] | 0[3-4]* | 050 )
|
---|
72 | cp ${CONFIGS}/udev/udev-config-2.permissions \
|
---|
73 | /etc/udev/permissions.d/25-lfs.permissions
|
---|
74 | cp ${CONFIGS}/udev/udev-config-1.rules \
|
---|
75 | /etc/udev/rules.d/25-lfs.rules
|
---|
76 | ;;
|
---|
77 | # This was last updated for 056, this will need to be tracked...
|
---|
78 | 05[1-9] | 0[6-9]* )
|
---|
79 | cp ${CONFIGS}/udev/udev-config-3.rules \
|
---|
80 | /etc/udev/rules.d/25-lfs.rules
|
---|
81 | ;;
|
---|
82 | esac
|
---|
83 | }
|
---|
84 |
|
---|
85 | case "${KERNEL_VER}" in
|
---|
86 | 2.5* | 2.6* )
|
---|
87 | if [ "Y" = "${UDEV}" ]; then
|
---|
88 | do_udev
|
---|
89 | elif [ "Y" = "${DEVFS}" ]; then
|
---|
90 | do_devfsd
|
---|
91 | else
|
---|
92 | do_makedev
|
---|
93 | fi
|
---|
94 | ;;
|
---|
95 | 2.4* )
|
---|
96 | if [ "Y" = "${DEVFS}" ]; then
|
---|
97 | do_devfs
|
---|
98 | else
|
---|
99 | do_makedev
|
---|
100 | fi
|
---|
101 | ;;
|
---|
102 | 2.2* )
|
---|
103 | do_makedev
|
---|
104 | ;;
|
---|
105 | esac
|
---|