summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorVolker Uhrig2008-08-30 19:03:57 +0200
committerVolker Uhrig2008-08-30 19:03:57 +0200
commit627790a77f47572031b42ad68c789a15a77625a7 (patch)
tree56eedb03932920e9f32b62835ec527649014d899 /os-plugins
parent* adjusted to new fact that switch_root now lives in /sbin instead of /bin (diff)
downloadcore-627790a77f47572031b42ad68c789a15a77625a7.tar.gz
core-627790a77f47572031b42ad68c789a15a77625a7.tar.xz
core-627790a77f47572031b42ad68c789a15a77625a7.zip
* made bastians script compatible with stage1 chroot
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2159 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rwxr-xr-xos-plugins/plugins/xserver/files/ubuntu-gfx-install.sh116
1 files changed, 71 insertions, 45 deletions
diff --git a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
index 3bedff92..5254dd50 100755
--- a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
+++ b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
@@ -3,7 +3,7 @@
# gets needed packages for ubuntu nvidia/ati drivers
# $1 = nvidia | ati
PLUGIN_FOLDER="/opt/openslx/plugin-repo/xserver"
-TMP_FOLDER="/tmp/"
+TMP_FOLDER="/tmp/slx-plugin/xserver"
TARGET="$1"
if [ ! -d "${PLUGIN_FOLDER}" ]; then
@@ -11,7 +11,7 @@ if [ ! -d "${PLUGIN_FOLDER}" ]; then
fi
# change into temp
-pushd ${TMP_FOLDER} > /dev/null
+cd ${TMP_FOLDER} > /dev/null
if [ -e "/boot/vmlinuz" ]; then
KVER=$(ls -ahl '/boot/vmlinuz' | sed -e 's,^.*vmlinuz-,,g')
@@ -20,70 +20,96 @@ else
fi
-aptitude download linux-restricted-modules-${KVER} > /dev/null 2&>1
+echo " * downloading restricted modules... this may take a while"
+# TODO: remove commented out "> /dev/null ..." later... multiple times
+# in this script! check all comments!
+aptitude download linux-restricted-modules-${KVER} #> /dev/null 2&>1
+if [ $? -eq 1 ]; then
+ echo " * Didn't get restricted modules. Exit now!"
+ #TODO: remove sh when development is finished
+ sh
+ exit
+fi
MODULE_DEB=$(ls linux-restricted-modules-*.deb | tail -n1)
dpkg-deb -x ${MODULE_DEB} ${TMP_FOLDER}/modules
case ${TARGET} in
ati)
- aptitude download xorg-driver-fglrx > /dev/null 2&>1
+ mkdir -p ${PLUGIN_FOLDER}/ati
+ mkdir -p ${PLUGIN_FOLDER}/ati/modules
+
+ echo " * downloading fglrx xorg package... this may take a while"
+ 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
+ echo " * Didn't get package xorg-driver-fglrx! Exit now!"
+ #TODO: remove sh when development is finished
+ sh
+ exit
fi
FGLRX_DEB=$(ls xorg-driver-fglrx_*.deb | tail -n1)
- # extract $DEB into folder "atiroot"
- dpkg-deb -x ${FGLRX_DEB} ${PLUGIN_FOLDER}/ati/atiroot/
+ # extract $DEB
+ dpkg-deb -x ${FGLRX_DEB} ${PLUGIN_FOLDER}/ati
# assemble module
- pushd modules/lib/linux-restricted-modules/${KVER}/ > /dev/null 2&>1
- ld_static -d -r -o ${PLUGIN_FOLDER}/modules/fglrx.ko fglrx/*
- popd > /dev/null 2&>1
+ cd modules/lib/linux-restricted-modules/${KVER}/
+ ld_static -d -r -o ${PLUGIN_FOLDER}/ati/modules/fglrx.ko fglrx/*
+
+ #TODO: Bastian: do we really need this part in stage1?
+ if [ -f /usr/lib/dri/fglrx_dri.so ]; then
+ mv /usr/lib/dri/fglrx_dri.so /usr/lib/dri/fglrx_dri.so.slx
+ else
+ # remove link
+ rm -rf /usr/lib/dri/fglrx_dri.so
+ fi
+ ln -s ${PLUGIN_FOLDER}/ati/usr/lib/dri/fglrx_dri.so \
+ /usr/lib/dri/fglrx_dri.so
+
+ # cleanup
+ cd ${PLUGIN_FOLDER}/ati
+ rm -rf ./etc
+ #TODO: check for more cleanups when the main part works!
- rm -rf ${FGLRX_DEB}
;;
+
+
nvidia)
- aptitude download nvidia-glx-new > /dev/null 2&>1
+ mkdir -p ${PLUGIN_FOLDER}/nvidia
+ mkdir -p ${PLUGIN_FOLDER}/nvidia/modules
+
+ echo " * downloading fglrx xorg package... this may take a while"
+ aptitude download nvidia-glx-new #> /dev/null 2&>1
if [ $? -eq 1 ]; then
- echo "Didn't get package nvidia-glx-new! Starting debug shell.."
- bash
- fi #oder
+ echo " * Didn't get package nvidia-glx-new!"
+ #TODO: remove sh when development is finished
+ sh
+ exit
+ fi
+ #Bastian: what is this? please explain
#aptitude download nvidia-glx
- # extract $DEB into folder "nvroot"
NVIDIA_DEB=$(ls nvidia-glx*.deb | tail -n1)
- dpkg-deb -x ${NVIDIA_DEB} ${PLUGIN_FOLDER}/nvidia/nvroot/
+ # extract $DEB
+ dpkg-deb -x ${NVIDIA_DEB} ${PLUGIN_FOLDER}/nvidia
# assemble modules
- pushd modules/lib/linux-restricted-modules/${KVER}/ > /dev/null 2&>1
+ cd modules/lib/linux-restricted-modules/${KVER}/
for module in nvidia nvidia_legacy nvidia_new; do
- ld_static -d -r -o ${PLUGIN_FOLDER}/modules/${module}.ko ${module}/*
+ ld_static -d -r -o ${PLUGIN_FOLDER}/nvidia/modules/${module}.ko ${module}/*
done
- popd > /dev/null 2&>1
- rm -rf ${NVIDIA_DEB}
- ;;
- *)
- echo "Running installation script ubuntu-gfx-install.sh without purpose! Exiting!"
+ #TODO: if we use this part, we need to copy the check from ati, too!
+ #if [ -f /usr/lib/dri/fglrx_dri.so ]; then
+ # mv /usr/lib/dri/fglrx_dri.so /usr/lib/dri/fglrx_dri.so.slx
+ #else
+ # # remove link
+ # rm -rf /usr/lib/dri/fglrx_dri.so
+ #fi
+ #ln -s ${PLUGIN_FOLDER}/nvidia/nvroot/usr/lib/dri/nvidia_dri.so \
+ # /usr/lib/dri/fglrx_dri.so
+
+ # cleanup
+ cd ${PLUGIN_FOLDER}/nvidia
+ rm -rf ./etc
+ #TODO: check for more cleanups when the main part works!
;;
esac
-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
-