blob: c01be35c740bed62e814c3b038a7d22bbba4fe3a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#!/bin/sh
##########################################################
# This file is responsible to extract system packages
# out of corresponding driver archives
#
# Arguments (optional):
# 1: temporary folder, where we put all the extracted files in.
# - default: put all extracted files in ./ati-files
# and all driver files in ./ati-root
#
##########################################################
#set -x
DEBUG=false
TMP_FOLDER="$1"
FOLDER=`pwd`
if [ "$TMP_FOLDER" -eq "" ]; then
TMP_FOLDER=${FOLDER}
fi
FILE_ATI=$FOLDER/ati-driver-installer*.run
##########################################################
# function ati_extract: Extract files from ATI-Package
#--------------------------------------------------------
#
# This function extracts the package for the right system
# from the driver archive of ATI.
#
##########################################################
function ati_extract {
INSTFOLDER=$1
if [ -f ${FILE_ATI} ]; then
chmod +x ${FILE_ATI}
${FILE_ATI} --extract ${TMP_FOLDER}/ati-files 2>&1 > /dev/null
else
echo "Could not extract ATI driver files!\n Please make sure that archive is not located in /tmp"
exit
fi
# here we will just create a package to extract it later
# and have all things in one place
VERSION=`head ${FILE_ATI} | grep "label=" | sed -e 's,.*Driver-\(.*\)",\1,g'`
# TODO: distinguish between 32-bit and 64-bit
PKGNAME="SuSE/SUSE102-IA32"
pushd ${TMP_FOLDER}/ati-files
./ati-installer.sh $VERSION --buildpkg ${PKGNAME} 2>&1 > out.txt
if [ `grep "successfully generated" out.txt | wc -l` -eq 1 ]; then
echo "* Package extracted from ATI driver archive..."
else
return
fi
if [ ! -d $INSTFOLDER ]; then
mkdir -p $INSTFOLDER
fi
PKG=`grep "successfully generated" out.txt | cut -d' ' -f2 `
# extract files into ati-root
pushd $INSTFOLDER
rpm2cpio ${PKG} | cpio -i --make-directories 2>&1 > /dev/null
if [ ! $? -eq 0 ]; then
echo "* Something went wrong extracting package!"
fi
popd
}
##############################################
# Here main script starts
##############################################
ati_extract $FOLDER/ati-root
if [ $DEBUG == "true" ]
then
/bin/bash
rm -rf ${TMP_FOLDER}/ati-files
fi
|