summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/xserver/files/suse-gfx-install.sh
blob: b91f2cd36f87b405e487ee4f117b527b0877f1e6 (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
98
99
100
101
102
103
#!/bin/sh

#
# Currently only suse 10.2 is supported!
#

BUSYBOX="/mnt/opt/openslx/share/busybox/busybox"

cd /opt/openslx/plugin-repo/xserver

#
# NVidia section
#
if [ "$1" = "nvidia" ]; then
  #To handle it under suse is kinda retarded. SuSE 10.2's zypper don't know
  #a flag similiar to "--download-only" (should be supported in a later
  #SuSE Version!)
  #SuSE 10.2 and 10.3 has two Kernelpackages:
  #  nvidia-gfxG01-kmp-bigsmp and -default
  #And its different nameing scheme to suse 11

  mkdir -p nvidia/modules nvidia/temp
  cd nvidia/temp

  #TODO: licence information... even suse requires an accept
  # TODO: let it automatical find the newest file... see ati section
  #       only problem should be the kernel package
  if [ "10.2" = "$(lsb_release -r|sed 's/^.*\t//')" ]; then
    echo "  * Downloading nvidia rpm packages... this could take some time..."
    wget -q -c \
      ftp://download.nvidia.com/opensuse/10.2/i586/nvidia-gfxG01-kmp-bigsmp-173.14.12_2.6.18.8_0.10-0.1.i586.rpm \
      ftp://download.nvidia.com/opensuse/10.2/i586/nvidia-gfxG01-kmp-default-173.14.12_2.6.18.8_0.10-0.1.i586.rpm \
      ftp://download.nvidia.com/opensuse/10.2/i586/x11-video-nvidiaG01-173.14.12-0.1.i586.rpm

      ${BUSYBOX} rpm2cpio x11-video-nvidiaG01-173.14.12-0.1.i586.rpm | ${BUSYBOX} cpio -idv > /dev/null

      rm -rf ./usr/include
      # Todo: recheck after development progress, perhaps an nvidia x11 tool needs /usr/share/pixmaps
      #       same with var id's
      #rm -rf ./usr/share

      mv ./usr ..

      # TODO: matching kernel problem... our openslx system picks -bigsmp - unintentionally!
      ${BUSYBOX} rpm2cpio
      nvidia-gfxG01-kmp-bigsmp-173.14.12_2.6.18.8_0.10-0.1.i586.rpm | ${BUSYBOX} cpio -idv > /dev/null
      #${BUSYBOX} rpm2cpio nvidia-gfxG01-kmp-default-173.14.12_2.6.18.8_0.10-0.1.i586.rpm | ${BUSYBOX} cpio -idv
      #TODO: take care about the kernel issue. Find won't work with two equal kernelmodules in lib/...
      find lib/ -name "*.ko" -exec mv {} ../modules \;
  fi

  cd ..

  # TODO: after development
  #rm -rf temp/
fi



#
# ATI section
#
if [ "$1" = "ati" ]; then
  mkdir -p ati/modules ati/temp
  cd ati/temp

  #TODO: licence information... even suse requires an accept
  BASEURL="http://www2.ati.com/suse/$(lsb_release -r|sed 's/^.*\t//')"
  # if it dont work in the future, check .../repodata/repomd.xml
  wget -q ${BASEURL}/repodata/primary.xml.gz
  gunzip primary.xml.gz

  echo "  * Downloading ati rpm packages... this could take some time..."
  # notice the i586! we can also get x86_64!
  for i in $(grep "<location href=.i586" primary.xml \
             |sed 's/.*<location href="//'|sed 's/".*//g')
  do
    wget -c -q ${BASEURL}/${i}
  done

  # TODO: move output to /dev/null when main development is over
  ${BUSYBOX} rpm2cpio $(find . -name "x11*")| ${BUSYBOX} cpio -idv > /dev/null

  rm -rf ./usr/include
  rm -rf ./usr/lib/pm-utils
  rm -rf ./usr/lib/powersave
  # Todo: recheck after development progress, perhaps an nvidia x11 tool needs /usr/share/pixmaps
  #       same with var id's
  #rm -rf ./usr/share

  mv ./usr ..

  # TODO: matching kernel problem... our openslx system picks -bigsmp - unintentionally!
  ${BUSYBOX} rpm2cpio $(find . -name "ati-fglrx*bigsmp*") | ${BUSYBOX} cpio -idv > /dev/null
  #${BUSYBOX} rpm2cpio nvidia-gfxG01-kmp-default-173.14.12_2.6.18.8_0.10-0.1.i586.rpm | ${BUSYBOX} cpio -idv
  #TODO: take care about the kernel issue. Find won't work with two equal kernelmodules in lib/...
  find lib/ -name "*.ko" -exec mv {} ../modules \;

  cd ..

  # TODO: after development
  #rm -rf temp/
fi