1 | #!/bin/bash |
---|
2 | |
---|
3 | # cross-lfs target lfs bootscripts installation |
---|
4 | # --------------------------------------------- |
---|
5 | # $LastChangedBy$ |
---|
6 | # $LastChangedDate$ |
---|
7 | # $LastChangedRevision$ |
---|
8 | # $HeadURL$ |
---|
9 | # |
---|
10 | |
---|
11 | LOG="lfs-bootscripts.log" |
---|
12 | cd ${SRC} |
---|
13 | |
---|
14 | unpack_tarball lfs-bootscripts-${LFS_BS_VER} |
---|
15 | cd ${PKGDIR} |
---|
16 | |
---|
17 | # Following commented lines are for using the *old* lfs bootscripts package |
---|
18 | #cp -a rc.d sysconfig ${LFS}/etc |
---|
19 | #chown -R root:root ${LFS}/etc/rc.d ${LFS}/etc/sysconfig |
---|
20 | |
---|
21 | max_log_init lfs-bootscripts ${LFS_BS_VER} "target" ${INSTLOGS} ${LOG} |
---|
22 | make DESTDIR=${LFS} install \ |
---|
23 | > ${LOGFILE} 2>&1 && |
---|
24 | echo " o Install OK" || barf |
---|
25 | |
---|
26 | if [ "Y" = "${USE_HOTPLUG}" ]; then |
---|
27 | # check if this version of the bootscripts has an |
---|
28 | # intall-hotplug target |
---|
29 | grep ^install-hotplug: Makefile > /dev/null 2>&1 && |
---|
30 | { |
---|
31 | make DESTDIR=${LFS} install-hotplug \ |
---|
32 | >> ${LOGFILE} 2>&1 && |
---|
33 | echo " o Install hotplug OK" || barf |
---|
34 | } |
---|
35 | fi |
---|
36 | |
---|
37 | # Bootscript Configuration |
---|
38 | #-------------------------- |
---|
39 | |
---|
40 | if [ ! "${USE_SYSROOT}" = "Y" ]; then |
---|
41 | # The normal PATH won't find our TGT_TOOLS binaries; so use the default |
---|
42 | # PATH we give in /etc/profile later. |
---|
43 | sed -e 's/^export PATH=.*//' < lfs/init.d/functions \ |
---|
44 | > ${LFS}/etc/rc.d/init.d/functions |
---|
45 | fi |
---|
46 | |
---|
47 | # setup system clock settings |
---|
48 | test -f ${LFS}/etc/sysconfig/clock || |
---|
49 | { |
---|
50 | # hardware clock should be set to UTC |
---|
51 | cat > ${LFS}/etc/sysconfig/clock << "EOF" |
---|
52 | # Begin /etc/sysconfig/clock |
---|
53 | UTC=1 |
---|
54 | |
---|
55 | # End /etc/sysconfig/clock |
---|
56 | EOF |
---|
57 | } |
---|
58 | |
---|
59 | # TODO: Put these in plfs-config |
---|
60 | NET_HOSTNAME="asuka" |
---|
61 | NET_DOMAINNAME="pha.com.au" |
---|
62 | NET_IP=192.168.0.6 |
---|
63 | NET_NETMASK=255.255.255.0 |
---|
64 | NET_PREFIX=24 |
---|
65 | NET_BCAST=192.168.0.255 |
---|
66 | NET_GATEWAY=192.168.0.1 |
---|
67 | NET_GATEWAY_IF=eth0 |
---|
68 | |
---|
69 | test -f ${LFS}/etc/hosts || |
---|
70 | { |
---|
71 | echo "127.0.0.1 localhost.localdomain localhost |
---|
72 | ${NET_IP} ${NET_HOSTNAME}.${NET_DOMAINNAME} ${NET_HOSTNAME}" > ${LFS}/etc/hosts |
---|
73 | } |
---|
74 | |
---|
75 | test -f ${LFS}/etc/sysconfig/network || |
---|
76 | { |
---|
77 | echo "HOSTNAME=${NET_HOSTNAME}" > ${LFS}/etc/sysconfig/network |
---|
78 | |
---|
79 | # Following commented lines are for using the *old* lfs bootscripts package |
---|
80 | # test -z "${NET_GATEWAY}" || |
---|
81 | # { |
---|
82 | # echo "GATEWAY=${NET_GATEWAY} |
---|
83 | #GATEWAY_IF=${NET_GATEWAY_IF}" >> ${LFS}/etc/sysconfig/network |
---|
84 | # } |
---|
85 | } |
---|
86 | |
---|
87 | # Following commented lines are for using the *old* lfs bootscripts package |
---|
88 | #test -f ${LFS}/etc/sysconfig/network-devices/ifconfig.${NET_GW_IF} || |
---|
89 | #{ |
---|
90 | # echo "ONBOOT=yes |
---|
91 | #SERVICE=static |
---|
92 | #IP=${NET_IP} |
---|
93 | #NETMASK=${NET_NETMASK} |
---|
94 | #BROADCAST=${NET_BCAST}" \ |
---|
95 | # > ${LFS}/etc/sysconfig/network-devices/ifconfig.${NET_GW_IF} |
---|
96 | #} |
---|
97 | |
---|
98 | test -f ${LFS}/etc/sysconfig/network-devices/ifconfig.${NET_GW_IF} || |
---|
99 | { |
---|
100 | echo "ONBOOT=yes |
---|
101 | SERVICE=ipv4-static |
---|
102 | IP=${NET_IP} |
---|
103 | GATEWAY=${NET_GATEWAY} |
---|
104 | PREFIX=${NET_PREFIX} |
---|
105 | BROADCAST=${NET_BCAST}" \ |
---|
106 | > ${LFS}/etc/sysconfig/network-devices/ifconfig.${NET_GW_IF} |
---|
107 | } |
---|
108 | |
---|