Gentoo Archives: gentoo-commits

From: Rick Farina <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/livecd-tools:master commit in: /
Date: Thu, 26 Sep 2019 17:07:25
Message-Id: 1569516075.0fbd94ce83aed8b8c8d13d1662b84ae75e9de0d1.zerochaos@gentoo
1 commit: 0fbd94ce83aed8b8c8d13d1662b84ae75e9de0d1
2 Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 26 16:41:15 2019 +0000
4 Commit: Rick Farina <zerochaos <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 26 16:41:15 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/livecd-tools.git/commit/?id=0fbd94ce
7
8 reap dead code from livecd-functions
9
10 livecd-functions.sh | 211 ----------------------------------------------------
11 1 file changed, 211 deletions(-)
12
13 diff --git a/livecd-functions.sh b/livecd-functions.sh
14 index 1204835..ad8ee1b 100644
15 --- a/livecd-functions.sh
16 +++ b/livecd-functions.sh
17 @@ -18,223 +18,12 @@ livecd_parse_opt() {
18 esac
19 }
20
21 -livecd_check_root() {
22 - if [ "$(whoami)" != "root" ]
23 - then
24 - echo "ERROR: must be root to continue"
25 - return 1
26 - fi
27 -}
28 -
29 livecd_get_cmdline() {
30 echo "0" > /proc/sys/kernel/printk
31 CMDLINE=$(cat /proc/cmdline)
32 export CMDLINE
33 }
34
35 -no_gl() {
36 -# einfo "If you have a card that you know is supported by either the ATI or"
37 -# einfo "NVIDIA binary drivers, please file a bug with the output of lspci"
38 -# einfo "on http://bugs.gentoo.org so we can resolve this."
39 - GLTYPE=xorg-x11
40 -}
41 -
42 -ati_gl() {
43 - einfo "ATI card detected."
44 - if [ -e /usr/lib/xorg/modules/drivers/fglrx_drv.so ] \
45 - || [ -e /usr/lib/modules/drivers/fglrx_drv.so ]
46 - then
47 -# sed -i \
48 -# -e 's/ati/fglrx/' \
49 -# -e 's/radeon/fglrx/' \
50 -# -e 's/r300/fglrx/' \
51 -# /etc/X11/xorg.conf
52 - GLTYPE=ati
53 - else
54 - GLTYPE=xorg-x11
55 - fi
56 -}
57 -
58 -nv_gl() {
59 - einfo "NVIDIA card detected."
60 - if [ -e /usr/lib/xorg/modules/drivers/nvidia_drv.so ] \
61 - || [ -e /usr/lib/modules/drivers/nvidia_drv.so ]
62 - then
63 - GLTYPE=nvidia
64 - else
65 - GLTYPE=xorg-x11
66 - fi
67 -}
68 -
69 -nv_no_gl() {
70 - einfo "NVIDIA card detected."
71 - echo
72 - if [ -e /usr/lib/xorg/modules/drivers/nvidia_drv.so ] \
73 - || [ -e /usr/lib/modules/drivers/nvidia_drv.so ]
74 - then
75 - einfo "This card is not supported by the latest version of the NVIDIA"
76 - einfo "binary drivers. Switching to the X server's driver instead."
77 - fi
78 - GLTYPE=xorg-x11
79 - sed -i 's/nvidia/nv/' /etc/X11/xorg.conf
80 -}
81 -
82 -get_video_cards() {
83 - VIDEO_CARDS=$(lspci | grep ' VGA ')
84 - NUM_CARDS=$(echo ${VIDEO_CARDS} | wc -l)
85 - if [ ${NUM_CARDS} -eq 1 ]
86 - then
87 - NVIDIA=$(echo ${VIDEO_CARDS} | grep "nVidia Corporation")
88 - ATI=$(echo ${VIDEO_CARDS} | grep "ATI Technologies")
89 - if [ -n "${NVIDIA}" ]
90 - then
91 - NVIDIA_CARD=$(echo ${NVIDIA} | awk 'BEGIN {RS=" "} /(NV|nv|G|C)[0-9]+/ {print $1}' | cut -d. -f1 | sed 's/ //' | sed 's:[^0-9]::g')
92 - # NVIDIA Model reference:
93 - # http://en.wikipedia.org/wiki/Comparison_of_NVIDIA_Graphics_Processing_Units
94 - if [ -n "${NVIDIA_CARD}" ]
95 - then
96 - if [ $(echo ${NVIDIA_CARD} | cut -dV -f2) -ge 17 ]
97 - then
98 - nv_gl
99 - elif [ $(echo ${NVIDIA_CARD} | cut -dG -f2) -ge 70 ]
100 - then
101 - nv_gl
102 - elif [ $(echo ${NVIDIA_CARD} | cut -dV -f2) -eq 11 ]
103 - then
104 - nv_gl
105 - elif [ $(echo ${NVIDIA_CARD} | cut -dC -f2) -ge 50 ]
106 - then
107 - nv_gl
108 - else
109 - nv_no_gl
110 - fi
111 - else
112 - no_gl
113 - fi
114 - elif [ -n "${ATI}" ]
115 - then
116 - ATI_CARD=$(echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)[0-9]+/ {print $1}' | sed -e 's/[^0-9]//g')
117 - if [ $(echo ${ATI_CARD} | grep S) ]
118 - then
119 - ATI_CARD_S=$(echo ${ATI_CARD} | cut -dS -f2)
120 - elif [ $(echo ${ATI_CARD} | grep V) ]
121 - then
122 - ATI_CARD_V=$(echo ${ATI_CARD} | cut -dV -f2)
123 - else
124 - ATI_CARD=$(echo ${ATI_CARD} | cut -dR -f2)
125 - fi
126 - if [ -n "${ATI_CARD_S}" ] && [ ${ATI_CARD_S} -ge 350 ]
127 - then
128 - ati_gl
129 - elif [ -n "${ATI_CARD_V}" ] && [ ${ATI_CARD_V} -ge 250 ]
130 - then
131 - ati_gl
132 - elif [ -n "${ATI_CARD}" ] && [ ${ATI_CARD} -ge 200 ]
133 - then
134 - ati_gl
135 - else
136 - no_gl
137 - fi
138 - else
139 - no_gl
140 - fi
141 - fi
142 -}
143 -
144 -get_ifmac() {
145 - local iface=$1
146 -
147 - # Example: 00:01:6f:e1:7a:06
148 - cat /sys/class/net/${iface}/address
149 -}
150 -
151 -
152 -get_ifdriver() {
153 - local iface=$1
154 -
155 - # Example: ../../../bus/pci/drivers/forcedeth (wanted: forcedeth)
156 - local if_driver=$(readlink /sys/class/net/${iface}/device/driver)
157 - basename ${if_driver}
158 -}
159 -
160 -get_ifbus() {
161 - local iface=$1
162 -
163 - # Example: ../../../bus/pci (wanted: pci)
164 - # Example: ../../../../bus/pci (wanted: pci)
165 - # Example: ../../../../../../bus/usb (wanted: usb)
166 - local if_bus=$(readlink /sys/class/net/${iface}/device/bus)
167 - basename ${if_bus}
168 -}
169 -
170 -get_ifproduct() {
171 - local iface=$1
172 - local bus=$(get_ifbus ${iface})
173 - local if_pciaddr
174 - local if_devname
175 - local if_usbpath
176 - local if_usbmanufacturer
177 - local if_usbproduct
178 -
179 - if [[ ${bus} == "pci" ]]
180 - then
181 - # Example: ../../../devices/pci0000:00/0000:00:0a.0 (wanted: 0000:00:0a.0)
182 - # Example: ../../../devices/pci0000:00/0000:00:09.0/0000:01:07.0 (wanted: 0000:01:07.0)
183 - if_pciaddr=$(readlink /sys/class/net/${iface}/device)
184 - if_pciaddr=$(basename ${if_pciaddr})
185 -
186 - # Example: 00:0a.0 Bridge: nVidia Corporation CK804 Ethernet Controller (rev a3)
187 - # (wanted: nVidia Corporation CK804 Ethernet Controller)
188 - if_devname=$(lspci -s ${if_pciaddr})
189 - if_devname=${if_devname#*: }
190 - if_devname=${if_devname%(rev *)}
191 - fi
192 -
193 - if [[ ${bus} == "usb" ]]
194 - then
195 - if_usbpath=$(readlink /sys/class/net/${iface}/device)
196 - if_usbpath=/sys/class/net/${iface}/$(dirname ${if_usbpath})
197 - if_usbmanufacturer=$(< ${if_usbpath}/manufacturer)
198 - if_usbproduct=$(< ${if_usbpath}/product)
199 -
200 - [[ -n ${if_usbmanufacturer} ]] && if_devname="${if_usbmanufacturer} "
201 - [[ -n ${if_usbproduct} ]] && if_devname="${if_devname}${if_usbproduct}"
202 - fi
203 -
204 - if [[ ${bus} == "ieee1394" ]]
205 - then
206 - if_devname="IEEE1394 (FireWire) Network Adapter";
207 - fi
208 -
209 - echo ${if_devname}
210 -}
211 -
212 -get_ifdesc() {
213 - local iface=$1
214 - desc=$(get_ifproduct ${iface})
215 - if [[ -n ${desc} ]]
216 - then
217 - echo $desc
218 - return;
219 - fi
220 -
221 - desc=$(get_ifdriver ${iface})
222 - if [[ -n ${desc} ]]
223 - then
224 - echo $desc
225 - return;
226 - fi
227 -
228 - desc=$(get_ifmac ${iface})
229 - if [[ -n ${desc} ]]
230 - then
231 - echo $desc
232 - return;
233 - fi
234 -
235 - echo "Unknown"
236 -}
237 -
238 livecd_console_settings() {
239 # scan for a valid baud rate
240 case "$1" in