summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Wissler2008-08-29 11:31:34 +0200
committerBastian Wissler2008-08-29 11:31:34 +0200
commitea946678e9ebc00d37b489ec4f22e2bbf2bc04a3 (patch)
treeb4beabaf77385081cc48631e94c8d720b620f7f5
parent* removed uclibc-busybox from tools folder, too (as it is not being used) (diff)
downloadcore-ea946678e9ebc00d37b489ec4f22e2bbf2bc04a3.tar.gz
core-ea946678e9ebc00d37b489ec4f22e2bbf2bc04a3.tar.xz
core-ea946678e9ebc00d37b489ec4f22e2bbf2bc04a3.zip
First real stage3 implementation (I just thought last time)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2128 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm9
-rw-r--r--os-plugins/plugins/xserver/XX_xserver.sh38
-rwxr-xr-xos-plugins/plugins/xserver/files/linkage.sh104
-rwxr-xr-xos-plugins/plugins/xserver/files/ubuntu-gfx-install.sh27
-rw-r--r--os-plugins/plugins/xserver/init-hooks/00-started/xserver.sh1
5 files changed, 175 insertions, 4 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
index f0837293..67035c57 100644
--- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
@@ -182,6 +182,7 @@ sub preInstallationPhase()
# Todo: use a openslx copy function!
system("cp -r $pkgpath $self->{pluginRepositoryPath}/packages");
}
+
}
@@ -224,7 +225,13 @@ sub installationPhase
}
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'}/nvidia-install.sh");
+ }
+
+ if ($attrs->{'xserver::nvidia'} == 1
+ || $attrs->{'xserver::ati'} == 1 ) {
+ copyFile("$pluginFilesPath/ubuntu-gfx-install.sh",
+ "$installationPath");
}
# 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 d37592ff..0d84c84c 100644
--- a/os-plugins/plugins/xserver/XX_xserver.sh
+++ b/os-plugins/plugins/xserver/XX_xserver.sh
@@ -38,11 +38,42 @@ if [ -e /initramfs/plugin-conf/xserver.conf ]; then
sed "s/.*v4 Server Module: //")
# proprietary ATI/NVidia modules listed a different way with hwinfo
[ -z "$xmodule" ] || error "${hcfg_hwsetup}" nonfatal
+ set -x
+
+ if [ $(grep -i -m 1 'Driver Activation Cmd: "modprobe fglrx"' \
+ /etc/hwinfo.data | wc -l) -eq "1" -a $xserver_prefnongpl -eq 1 ]
+ then
+ # we have an ati card here
+ ATI=1
+ MODULE_PATH="/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/xorg/modules/\,\
+/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/X11R6/lib/modules/\,"
+ xmodule="fglrx"
+ LINKAGE="/mnt/var/lib/X11R6/xserver/usr/lib/"
+ cp -r /mnt/opt/openslx/plugin-repo/xserver/ati/atiroot/etc/* /mnt/etc/
+ ln -s \
+ /mnt/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/libGL.so.1.2 \
+ ${LINKAGE}libGL.so.1
+ ln -s \
+ /mnt/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/libGL.so.1.2 \
+ ${LINKAGE}libGL.so.1.2
+
+ # TODO: This is probably Ubuntu-specific
+ echo "/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/\n\
+/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/X11R6/lib/" \
+ > /mnt/etc/ld.so.conf.d/999opengl.conf
+ ldsc="on" # regenerate ld.so.cache
+ fi
+
+ set +x
+
+ # TODO: nvidia module
+
echo -e "# $xfc\n# autogenerated X hardware configuration by the xserver \
plugin in OpenSLX stage3\n# DO NOT EDIT THIS FILE BUT THE PLUGIN INSTEAD" \
> $xfc
echo '
Section "Files"
+ ModulePath "/usr/lib/xorg/modules/"
EndSection
Section "ServerFlags"
Option "AllowMouseOpenFail"
@@ -161,6 +192,13 @@ Section "InputDevice"\
a\ \ InputDevice\ \ "Synaptics TP"\ \ \ \ \ \ "SendCoreEvents"
}' -i $xfc
fi
+
+
+ if [ "$xserver_prefnongpl" -eq "1" ]; then
+ sed -e "s,ModulePath \",ModulePath \"${MODULE_PATH},g" \
+ -i $xfc
+ fi
+
[ $DEBUGLEVEL -gt 0 ] && echo "done with 'xserver' os-plugin ...";
# some configurations produce no proper screen resolution without
# Horizsync and Vertrefresh set (more enhancements might be needed for
diff --git a/os-plugins/plugins/xserver/files/linkage.sh b/os-plugins/plugins/xserver/files/linkage.sh
new file mode 100755
index 00000000..040b4c8a
--- /dev/null
+++ b/os-plugins/plugins/xserver/files/linkage.sh
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+#
+#
+# general: linking libGL.so and stuff to writable locations
+#
+#
+
+PLUGIN_FOLDER="/opt/openslx/plugin-repo/xserver/"
+MESA_FOLDER="${PLUGIN_FOLDER}mesa/"
+# this has to be writable in stage3 - any folder is possible
+LINK_FOLDER="/var/lib/X11R6/xserver/"
+
+# these are to link libs to
+ATIROOT="${PLUGIN_FOLDER}ati/atiroot"
+NVROOT="${PLUGIN_FOLDER}nvidia/nvroot"
+
+# declare array of conflicting libs
+# TODO: add conflicting libs for opengl here
+declare -a CONFLIBS=("/usr/lib/libGL.so.1.2" "/usr/lib/libGL.so.1")
+
+
+if [ ! -d "${MESA_FOLDER}usr/lib/" ]; then
+ mkdir -p "${MESA_FOLDER}usr/lib/"
+fi
+if [ ! -d "${LINK_FOLDER}usr/lib/" ]; then
+ mkdir -p "${LINK_FOLDER}usr/lib/"
+fi
+
+
+
+
+
+
+
+
+
+
+function linkMesa {
+ file=$1
+ if [ -f "/${file}" ]; then
+ # move file to the mesa implementation folder
+ mv "${file}" "${MESA_FOLDER}${file}"
+ # create links from link-folder to mesa-folder
+ ln -s "${MESA_FOLDER}${file}" "${LINK_FOLDER}${file}"
+ # create links from sys-folder to link-folder
+ ln -s "${LINK_FOLDER}${file}" "${file}"
+
+ else
+ # ${file} is a link here
+ rm -rf "${file}"
+ case ${file} in
+ /usr/lib/libGL.so.1)
+ ln -s "${LINK_FOLDER}${file}.2" "${LINK_FOLDER}${file}"
+ ;;
+ *)
+ ;;
+ esac
+ fi
+}
+
+
+
+
+
+
+
+
+
+
+# we create links for all of the binary drivers here
+# - as long as it's possible
+# - if not, add to array of link files
+
+# ATI
+declare -a ATILIBS=($(find ${ATIROOT} -name "*\\.so*" | xargs))
+# with stripped ATIROOT path
+declare -a UATILIBS=(${ATILIBS[@]#${ATIROOT}})
+for lib in ${UATILIBS[@]}; do
+ if [ -e $lib ]; then
+ # this is a conflicting MESA-Library
+ linkMesa $lib
+ fi
+done
+# NVIDIA
+for lib in $(find ${NVROOT} -name "*\\.so*" | xargs); do
+
+done
+
+
+
+
+
+
+
+# go through conflicting libs and link them accordingly
+for file in ${CONFLIBS[@]}; do
+ linkMesa $file
+done
+
+
+
+
+
diff --git a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
index fd65a4a6..dbcd0ad1 100755
--- a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
+++ b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
@@ -19,8 +19,6 @@ else
KVER=$(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)
fi
-bash
-
aptitude download linux-restricted-modules-${KVER} > /dev/null 2&>1
MODULE_DEB=$(ls linux-restricted-modules-*.deb | tail -n1)
@@ -29,6 +27,10 @@ dpkg-deb -x ${MODULE_DEB} ${TMP_FOLDER}/modules
case ${TARGET} in
ati)
aptitude download xorg-driver-fglrx > /dev/null 2&>1
+ if [ $? -eq 1 ]; then
+ echo "Didn't get package xorg-driver-fglrx! Starting debug shell.."
+ bash
+ fi
FGLRX_DEB=$(ls xorg-driver-fglrx_*.deb | tail -n1)
# extract $DEB into folder "atiroot"
dpkg-deb -x ${FGLRX_DEB} ${PLUGIN_FOLDER}/ati/atiroot/
@@ -42,7 +44,10 @@ case ${TARGET} in
;;
nvidia)
aptitude download nvidia-glx-new > /dev/null 2&>1
- #oder
+ if [ $? -eq 1 ]; then
+ echo "Didn't get package nvidia-glx-new! Starting debug shell.."
+ bash
+ fi #oder
#aptitude download nvidia-glx
# extract $DEB into folder "nvroot"
NVIDIA_DEB=$(ls nvidia-glx*.deb | tail -n1)
@@ -66,3 +71,19 @@ popd > /dev/null #${TMP_FOLDER}
rm -rf ${TMP_FOLDER}/modules
+
+#
+#
+# TODO: move following line to a more general location
+#
+#
+if [ "${TARGET}" = "ati" ];then
+ ln -s ${PLUGIN_FOLDER}/ati/atiroot/usr/lib/dri/fglrx_dri.so \
+ /usr/lib/dri/fglrx_dri.so
+fi
+
+#if [ "${TARGET}" -eq "nvidia" ];then
+# ln -s ${PLUGIN_FOLDER}/nvidia/nvroot/usr/lib/dri/nvidia_dri.so \
+# /usr/lib/dri/fglrx_dri.so
+#fi
+
diff --git a/os-plugins/plugins/xserver/init-hooks/00-started/xserver.sh b/os-plugins/plugins/xserver/init-hooks/00-started/xserver.sh
index 1b8171cc..37290a51 100644
--- a/os-plugins/plugins/xserver/init-hooks/00-started/xserver.sh
+++ b/os-plugins/plugins/xserver/init-hooks/00-started/xserver.sh
@@ -5,4 +5,5 @@
( hwinfo --monitor >/etc/hwinfo.display; grep "Generic Monitor" \
/etc/hwinfo.display >/dev/null 2>&1 && rm /etc/hwinfo.display ) &
+( hwinfo --gfxcard >/etc/hwinfo.gfxcard ) &