summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorVolker Uhrig2008-09-16 20:26:58 +0200
committerVolker Uhrig2008-09-16 20:26:58 +0200
commit5ad4a2b0ee25a7993205e529fee5750a1e870209 (patch)
tree3e6314995968b57cb5aff031d956e1336c144ca1 /os-plugins
parent * .. (diff)
downloadcore-5ad4a2b0ee25a7993205e529fee5750a1e870209.tar.gz
core-5ad4a2b0ee25a7993205e529fee5750a1e870209.tar.xz
core-5ad4a2b0ee25a7993205e529fee5750a1e870209.zip
* modified linkingscript for ati and nvida modules
* added executation in stage1 * changes done with Bastian * untested git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2226 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm3
-rw-r--r--os-plugins/plugins/xserver/XX_xserver.sh10
-rwxr-xr-xos-plugins/plugins/xserver/files/linkage.sh38
3 files changed, 28 insertions, 23 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
index 93314e85..d3ed4514 100644
--- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
@@ -223,14 +223,17 @@ sub installationPhase
if ($attrs->{'xserver::nvidia'} == 1 || $attrs->{'xserver::ati'} == 1 ) {
copyFile("$pluginFilesPath/ubuntu-gfx-install.sh", "$installationPath");
copyFile("$pluginFilesPath/suse-gfx-install.sh", "$installationPath");
+ copyFile("$pluginFilesPath/linkage.sh", "$installationPath");
}
if ($attrs->{'xserver::ati'} == 1) {
copyFile("$pluginFilesPath/ati-install.sh", "$installationPath");
system("/bin/sh /opt/openslx/plugin-repo/$self->{'name'}/ati-install.sh");
+ system("/bin/sh /opt/openslx/plugin-repo/$self->{'name'}/linkage.sh ati");
}
if ($attrs->{'xserver::nvidia'} == 1) {
copyFile("$pluginFilesPath/nvidia-install.sh", "$installationPath");
system("/bin/sh /opt/openslx/plugin-repo/$self->{'name'}/nvidia-install.sh");
+ system("/bin/sh /opt/openslx/plugin-repo/$self->{'name'}/linkage.sh nvidia");
}
# Some plugins have to copy files from their plugin folder into the
diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh
index 4ca21287..b58b6e32 100644
--- a/os-plugins/plugins/xserver/XX_xserver.sh
+++ b/os-plugins/plugins/xserver/XX_xserver.sh
@@ -47,8 +47,8 @@ if [ -e /initramfs/plugin-conf/xserver.conf -a \
######################################################################
set -x
- if [ $(grep -i -m 1 'Driver Activation Cmd: "modprobe fglrx"' \
- /etc/hwinfo.data | wc -l) -eq "1" -a $xserver_prefnongpl -eq 1 ]
+ if [ $(grep -i -m 1 'fglrx' \
+ /etc/hwinfo.data | wc -l) -ge "1" -a $xserver_prefnongpl -eq 1 ]
then
# we have an ati card here
ATI=1
@@ -71,8 +71,8 @@ ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\,"
${LINK_PATH}libGL.so.1.2
fi
- if [ $(grep -i -m 1 'Driver Activation Cmd: "modprobe nvidia"' \
- /etc/hwinfo.data | wc -l) -eq "1" -a $xserver_prefnongpl -eq 1 ]
+ if [ $(grep -i -m 1 'nvidia' \
+ /etc/hwinfo.data | wc -l) -ge "1" -a $xserver_prefnongpl -eq 1 ]
then
# we have an ati card here
NVIDIA=1
@@ -239,7 +239,7 @@ a\ \ InputDevice\ \ "Synaptics TP"\ \ \ \ \ \ "SendCoreEvents"
size="$(grep -m 1 " Size: " /etc/hwinfo.display | \
sed 's|.*ize:\ ||;s|\ mm||;s|x|\ |')"
modes=$(grep -i "Resolution: .*@" /etc/hwinfo.display | \
- awk '{print $2}'| sort -unr| awk -F '@' '{print "\"" $1 "\""}'|\
+ awk '{print $2}'| awk -F '@' '{print "\"" $1 "\""}'| sort -unr| \
tr "\n" " ")
[ -n "$vert" -a -n "$horz" ] && \
sed -e "s|# Horizsync.*| Horizsync $horz|;\
diff --git a/os-plugins/plugins/xserver/files/linkage.sh b/os-plugins/plugins/xserver/files/linkage.sh
index b047ba66..ad23bed8 100755
--- a/os-plugins/plugins/xserver/files/linkage.sh
+++ b/os-plugins/plugins/xserver/files/linkage.sh
@@ -28,30 +28,27 @@ fi
-
-
-
-
##########################################
# saves a mesa file into MESAROOT
# and creates a link
##########################################
-function linkMesa() {
+linkMesa() {
file=$1
# get path without /usr/lib/
- l_path="${file/$(basename $file)/}"
- l_path=${l_path/\/usr\/lib/}
+ bname=$(basename ${file})
+ l_path="$(echo ${file}|sed 's,${bname},,g')"
+ l_path="$(echo ${l_path}|sed 's,/usr/lib,,g')"
if [ ! -d "${LINK_PATH}${l_path}" ]; then
mkdir -p ${LINK_PATH}${l_path}
fi
- if [ -f "${file}" ]; then
- # this is a real file
- mv ${file} ${file/\.so/_MESA.so} 2&>1 >/dev/null # rename file
- elif [ -h "${file}" ]; then
+ if [ -h "${file}" ]; then
# this is a link
- ln -sf ${LINK_PATH}${file/\/usr\/lib/} $file # link to writable dir
+ ln -sf ${LINK_PATH}$(echo $file| sed -e 's,/usr/lib,,g') $file # link to writable dir
+ elif [ -f "${file}" ]; then
+ # this is a real file
+ mv ${file} $(echo $file|sed -e 's,.so,_MESA.so,g') 2&>1 >/dev/null # rename file
fi
}
@@ -64,7 +61,7 @@ function linkMesa() {
# and linked to /var/X11R6/lib
#
########################################
-function divert() {
+divert() {
# root PATH
# as first argument
@@ -79,7 +76,7 @@ function divert() {
# strip leading ROOT
cmplib="${lib#${ROOT}}"
-
+ echo ${cmplib} ${lib}
if [ -e "${cmplib}" -a -e "${lib}" ]; then
# system folder conflicts with ROOT
linkMesa ${cmplib}
@@ -88,7 +85,8 @@ function divert() {
# throwing away the basename
# leaving the folder
- l_path="${cmplib/$(basename $lib)/}"
+ bname=$(basename ${lib})
+ l_path="$(echo ${cmplib}|sed 's,${bname},,g')"
l_path=${l_path#/usr/lib}
# here is the hairy function
@@ -98,7 +96,7 @@ function divert() {
if [ -n "${CMPROOT}" -a -e "${lib}" -a -e "${CMPROOT}${cmplib}" ]; then
# two roots are conflicting
# create a link into LINK_PATH
- if [ -h "${LINK_PATH}${cmplib/\/usr\/lib/}" ]; then
+ if [ -h "${LINK_PATH}$( echo ${cmplib}| sed 's,/usr/lib,,g')" ]; then
# it already exists
continue
fi
@@ -107,7 +105,10 @@ function divert() {
fi
# create link ladder (defaults to first called implementation)
- ln -s ${ROOT}${cmplib} ${LINK_PATH}${cmplib}
+ #TODO: Check this part. Every 2nd time of 'linkage.sh clean;linkage.sh both'
+ # the following error occurs:
+ # ln: creating symbolic link `/var/X11R6/lib//libGL.so.1/libGL.so.1': File exists
+ ln -s ${ROOT}${cmplib} ${LINK_PATH}$(echo ${cmplib} | sed -e 's/\/usr\/lib//g')
else
@@ -132,7 +133,8 @@ function divert() {
function uninstDist() {
# put mesa implementation back into place
for file in $(find /usr/lib/ -name '*_MESA.so*' | xargs); do
- mv $file ${file/_MESA\.so/.so}
+ mesafile="$(echo ${file}|sed -e 's/_MESA.so/.so/')"
+ mv ${file} ${mesafile}
done
# somehow we have to repair this - what else?