diff options
author | Robert Bragg <bob@openedhand.com> | 2008-09-22 13:33:19 +0000 |
---|---|---|
committer | Robert Bragg <bob@openedhand.com> | 2008-09-22 13:33:19 +0000 |
commit | 3de4627417e62595ce4349cb3a13c9180f8e6bfd (patch) | |
tree | 37c5f48d49ce9702fb164ca4fe47433f59cd838a /meta/packages/x11-common | |
parent | 9b6a24b65d840d8b207a9dfdc69e61b0c5c9ef07 (diff) | |
download | openembedded-core-3de4627417e62595ce4349cb3a13c9180f8e6bfd.tar.gz openembedded-core-3de4627417e62595ce4349cb3a13c9180f8e6bfd.tar.bz2 openembedded-core-3de4627417e62595ce4349cb3a13c9180f8e6bfd.zip |
Adds recipes to support building X servers based on the xfree86 DDX instead
of kdrive and building mesa. It's a big commit and it's still rather rough
around the edges, but there is a desire to get this in early so people can
review the work and help polish the changes.
Some of the notable bits:
• DRI support in mesa and the X server. (configured in machine conf via
MACHINE_DRI_MODULES variable)
• XCB backend for xlib
• A fairly lite X server build with lots of legacy modules disabled.
I'm sure there is plenty of other fairly low hanging fruit if we want to
put more effort into reducing the size of the xserver build. Currently the
server build comes in @ ~2.3MB vs a kdrive fbdev server build @ ~1MB. E.g
xaa could be made conditional to save ~320K. Of course the kdrive server
doesn't include glx stuff, which is a pretty big chunk.
Also thanks to hrw, since I nabbed a some patches from him for this, and RP,
for various bits of Poky style advice.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5205 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/x11-common')
10 files changed, 505 insertions, 0 deletions
diff --git a/meta/packages/x11-common/x11-common/etc/X11/Xdefaults b/meta/packages/x11-common/x11-common/etc/X11/Xdefaults new file mode 100644 index 0000000000..f5b69dd516 --- /dev/null +++ b/meta/packages/x11-common/x11-common/etc/X11/Xdefaults @@ -0,0 +1,3 @@ +Rxvt*scrollBar_right: true +Rxvt*font: xft:Mono:pixelsize=9 + diff --git a/meta/packages/x11-common/x11-common/etc/X11/Xinit b/meta/packages/x11-common/x11-common/etc/X11/Xinit new file mode 100644 index 0000000000..f566ffe5be --- /dev/null +++ b/meta/packages/x11-common/x11-common/etc/X11/Xinit @@ -0,0 +1,16 @@ +#!/bin/sh +# + +export USER=root +export HOME=/home/root +if [ ! -d $HOME ] && [ -d /root ]; then + HOME=/root +fi +export XAPPLRESDIR=/usr/X11R6/lib/app-defaults +export XFILESEARCHPATH=./%N%S%C.ad:/usr/X11R6/lib/X11/%L/%T/%N%S%C:/usr/X11R6/lib/X11/%l/%T/%N%S%C:/usr/X11R6/lib/X11/%T/%N%S%C:./%N%S.ad:/usr/X11R6/lib/X11/%L/%T/%N%S:/usr/X11R6/lib/X11/%l/%T/%N%S:/usr/X11R6/lib/X11/%T/%N%S:/usr/local/lib/X11/app-defaults/%N%S%C.ad + +export PATH=$PATH:/usr/X11R6/bin + +SYSSESSIONDIR=/etc/X11/Xinit.d + +exec run-parts $SYSSESSIONDIR diff --git a/meta/packages/x11-common/x11-common/etc/X11/Xserver b/meta/packages/x11-common/x11-common/etc/X11/Xserver new file mode 100644 index 0000000000..689d522d09 --- /dev/null +++ b/meta/packages/x11-common/x11-common/etc/X11/Xserver @@ -0,0 +1,83 @@ +#!/bin/sh +# + +. /etc/formfactor/config + +# note xinit needs full server path +XSERVER=/usr/bin/Xipaq +if [ -f /usr/bin/Xfbdev ]; then + XSERVER=/usr/bin/Xfbdev +fi +if [ -f /usr/bin/Xepson ]; then + XSERVER=/usr/bin/Xepson +fi +if [ -f /usr/bin/Xorg ]; then + XSERVER=/usr/bin/Xorg +fi +if [ -f /usr/bin/Xomap ]; then + XSERVER=/usr/bin/Xomap +fi + +. /etc/profile + +module_id() { + ## used to read from assets, but sometimes assets is corrupted + # grep "Module ID" /proc/hal/assets | sed "s/.*://" + ## used to read from /proc/hal/model, but that is removed in 2.6 + # echo ' iPAQ' `cat /proc/hal/model` + awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo +} + +export USER=root + +ARGS=" -br -pn" + +if [ "$XSERVER" != "/usr/bin/Xorg" ]; then + + # use ucb 1x00 touchscreen if present + if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ]; then + ARGS="$ARGS -mouse /dev/touchscreen/ucb1x00" + fi + + # use usb mouse if present + if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/input/mice ]; then + ARGS="$ARGS -mouse /dev/input/mice" + fi + + # kdrive 1.4 onwards needs -mouse args + if [ -n "$TSLIB_TSDEVICE" ]; then + ARGS="$ARGS -mouse tslib" + fi + + # start off server in conventional location. + case `module_id` in + "Generic OMAP1510/1610/1710") + ARGS="$ARGS -mouse /dev/input/event0" ;; + "Compulab CM-x270") + #modprobe mbxfb + #ARGS="$ARGS -fb /dev/fb1" + ;; + "Nokia N800") + ARGS="$ARGS -mouse tslib" ;; + "Nokia 770") + ARGS="$ARGS -mouse tslib" ;; + *) + ;; + esac + + ARGS="$ARGS -screen ${DISPLAY_WIDTH_PIXELS}x${DISPLAY_HEIGHT_PIXELS}@${DISPLAY_ORIENTATION}x${DISPLAY_BPP}" + + if [ ! -z "$DISPLAY_DPI" ]; then + ARGS="$ARGS -dpi $DISPLAY_DPI" + fi + + if [ ! -z "$DISPLAY_SUBPIXEL_ORDER" ]; then + ARGS="$ARGS -rgba $DISPLAY_SUBPIXEL_ORDER" + fi + +fi + +DISPLAY=':0' + +exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $* + diff --git a/meta/packages/x11-common/x11-common/etc/X11/Xsession b/meta/packages/x11-common/x11-common/etc/X11/Xsession new file mode 100644 index 0000000000..8f3e5edd7d --- /dev/null +++ b/meta/packages/x11-common/x11-common/etc/X11/Xsession @@ -0,0 +1,42 @@ +#!/bin/sh + +HOME_VOLATILE=/home/$USER/ramdisk +export HOME_VOLATILE + +HOME=/home/$USER +export HOME + +if [ -x /usr/bin/dbus-launch ]; then + # As this is the X session script, always start a new DBus session. + eval `dbus-launch --sh-syntax --exit-with-session` + echo "D-BUS per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS" +fi + +. /etc/profile + +if [ -f $HOME/.profile ]; then + . $HOME/.profile +fi + +SYSSESSIONDIR=/etc/X11/Xsession.d + +for SESSIONFILE in $SYSSESSIONDIR/*; do + set +e + case "$SESSIONFILE" in + *.sh) + . "$SESSIONFILE" + ;; + *.shbg) + "$SESSIONFILE" & + ;; + *~) + # Ignore backup files + ;; + *) + "$SESSIONFILE" + ;; + esac + set -e +done + +exit 0 diff --git a/meta/packages/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh b/meta/packages/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh new file mode 100644 index 0000000000..a9d102c746 --- /dev/null +++ b/meta/packages/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# kdrive 1.4 does not have default keymap in server +#xmodmap - </etc/X11/default.xmodmap diff --git a/meta/packages/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh b/meta/packages/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh new file mode 100644 index 0000000000..b936dedf3b --- /dev/null +++ b/meta/packages/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh @@ -0,0 +1,7 @@ +if [ -x $HOME/.Xsession ]; then + exec $HOME/.Xsession +elif [ -x /usr/bin/x-session-manager ]; then + exec /usr/bin/x-session-manager +else + exec /usr/bin/x-window-manager +fi diff --git a/meta/packages/x11-common/x11-common/etc/X11/default.xmodmap b/meta/packages/x11-common/x11-common/etc/X11/default.xmodmap new file mode 100644 index 0000000000..05a13fa3c8 --- /dev/null +++ b/meta/packages/x11-common/x11-common/etc/X11/default.xmodmap @@ -0,0 +1,260 @@ +keycode 8 = +keycode 9 = Escape +keycode 10 = 1 exclam +keycode 11 = 2 at +keycode 12 = 3 numbersign +keycode 13 = 4 dollar +keycode 14 = 5 percent +keycode 15 = 6 asciicircum +keycode 16 = 7 ampersand braceleft +keycode 17 = 8 asterisk bracketleft +keycode 18 = 9 parenleft bracketright +keycode 19 = 0 parenright braceright +keycode 20 = minus underscore backslash +keycode 21 = equal plus +keycode 22 = BackSpace +keycode 23 = Tab +keycode 24 = q Q q +keycode 25 = w W w +keycode 26 = e E +keycode 27 = r R r +keycode 28 = t T t +keycode 29 = y Y y +keycode 30 = u U u +keycode 31 = i I i +keycode 32 = o O o +keycode 33 = p P p +keycode 34 = bracketleft braceleft +keycode 35 = bracketright braceright asciitilde +keycode 36 = Return +keycode 37 = Control_L +keycode 38 = a A +keycode 39 = s S s +keycode 40 = d D +keycode 41 = f F +keycode 42 = g G g +keycode 43 = h H h +keycode 44 = j J j +keycode 45 = k K k +keycode 46 = l L l +keycode 47 = semicolon colon +keycode 48 = apostrophe quotedbl +keycode 49 = grave asciitilde +keycode 50 = Shift_L +keycode 51 = backslash bar +keycode 52 = z Z z +keycode 53 = x X x +keycode 54 = c C +keycode 55 = v V v +keycode 56 = b B +keycode 57 = n N n +keycode 58 = m M m +keycode 59 = comma less +keycode 60 = period greater +keycode 61 = slash question +keycode 62 = Shift_R +keycode 63 = KP_Multiply +keycode 64 = Alt_L +keycode 65 = space +keycode 66 = Caps_Lock +keycode 67 = F1 F11 +keycode 68 = F2 F12 +keycode 69 = F3 F13 +keycode 70 = F4 F14 +keycode 71 = F5 F15 +keycode 72 = F6 F16 +keycode 73 = F7 F17 +keycode 74 = F8 F18 +keycode 75 = F9 F19 +keycode 76 = F10 F20 +keycode 77 = Num_Lock +keycode 78 = Scroll_Lock +keycode 79 = KP_7 +keycode 80 = KP_8 +keycode 81 = KP_9 +keycode 82 = KP_Subtract +keycode 83 = KP_4 +keycode 84 = KP_5 +keycode 85 = KP_6 +keycode 86 = KP_Add +keycode 87 = KP_1 +keycode 88 = KP_2 +keycode 89 = KP_3 +keycode 90 = KP_0 +keycode 91 = KP_Decimal +keycode 92 = +keycode 93 = +keycode 94 = less greater bar +keycode 95 = F11 +keycode 96 = F12 +keycode 97 = +keycode 98 = +keycode 99 = +keycode 100 = +keycode 101 = +keycode 102 = +keycode 103 = +keycode 104 = KP_Enter +keycode 105 = Control_R +keycode 106 = KP_Divide +keycode 107 = +keycode 108 = Mode_switch +keycode 109 = Break +keycode 110 = Home +keycode 111 = Up +keycode 112 = Prior +keycode 113 = Left +keycode 114 = Right +keycode 115 = End +keycode 116 = Down +keycode 117 = Next +keycode 118 = Insert +keycode 119 = Delete +keycode 120 = Menu +keycode 121 = F13 +keycode 122 = F14 +keycode 123 = Help +keycode 124 = Execute +keycode 125 = F17 +keycode 126 = KP_Subtract +keycode 127 = Pause +keycode 128 = +keycode 129 = +keycode 130 = +keycode 131 = +keycode 132 = +keycode 133 = +keycode 134 = +keycode 135 = +keycode 136 = +keycode 137 = +keycode 138 = +keycode 139 = +keycode 140 = +keycode 141 = +keycode 142 = +keycode 143 = +keycode 144 = +keycode 145 = +keycode 146 = +keycode 147 = +keycode 148 = +keycode 149 = +keycode 150 = +keycode 151 = +keycode 152 = +keycode 153 = +keycode 154 = +keycode 155 = +keycode 156 = +keycode 157 = +keycode 158 = +keycode 159 = +keycode 160 = +keycode 161 = +keycode 162 = +keycode 163 = +keycode 164 = +keycode 165 = +keycode 166 = +keycode 167 = +keycode 168 = +keycode 169 = +keycode 170 = +keycode 171 = +keycode 172 = +keycode 173 = +keycode 174 = +keycode 175 = +keycode 176 = +keycode 177 = +keycode 178 = +keycode 179 = +keycode 180 = +keycode 181 = +keycode 182 = +keycode 183 = +keycode 184 = +keycode 185 = +keycode 186 = +keycode 187 = +keycode 188 = +keycode 189 = +keycode 190 = +keycode 191 = +keycode 192 = +keycode 193 = +keycode 194 = +keycode 195 = +keycode 196 = +keycode 197 = +keycode 198 = +keycode 199 = +keycode 200 = +keycode 201 = +keycode 202 = +keycode 203 = +keycode 204 = +keycode 205 = +keycode 206 = +keycode 207 = +keycode 208 = +keycode 209 = +keycode 210 = +keycode 211 = +keycode 212 = +keycode 213 = +keycode 214 = +keycode 215 = +keycode 216 = +keycode 217 = +keycode 218 = +keycode 219 = +keycode 220 = +keycode 221 = +keycode 222 = +keycode 223 = +keycode 224 = +keycode 225 = +keycode 226 = +keycode 227 = +keycode 228 = +keycode 229 = +keycode 230 = +keycode 231 = +keycode 232 = +keycode 233 = +keycode 234 = +keycode 235 = +keycode 236 = +keycode 237 = +keycode 238 = +keycode 239 = +keycode 240 = +keycode 241 = +keycode 242 = +keycode 243 = +keycode 244 = +keycode 245 = +keycode 246 = +keycode 247 = +keycode 248 = +keycode 249 = +keycode 250 = +keycode 251 = +keycode 252 = +keycode 253 = +keycode 254 = + +add shift = Shift_L +add shift = Shift_R +add shift = Menu +add lock = Caps_Lock +add control = Control_L +add control = Control_R +add mod1 = Alt_L +add mod2 = Num_Lock +!mod3 +add mod4 = Mode_switch +!mod5 + diff --git a/meta/packages/x11-common/x11-common_0.1.bb b/meta/packages/x11-common/x11-common_0.1.bb new file mode 100644 index 0000000000..a4cef9c49a --- /dev/null +++ b/meta/packages/x11-common/x11-common_0.1.bb @@ -0,0 +1,17 @@ +DESCRIPTION = "Common X11 scripts" +LICENSE = "GPL" +SECTION = "x11" +RDEPENDS_${PN} = "xmodmap xdpyinfo xtscal xinit formfactor" +PR = "r34" + +SRC_URI = "file://etc" +S = ${WORKDIR} + +PACKAGE_ARCH = "all" + +do_install() { + cp -R ${S}/etc ${D}/etc + chmod -R 755 ${D}/etc + find ${D}/etc -type d -name .svn -prune -exec rm -rf {} \; + find ${D}/etc -type f -name \*~ -exec rm -rf {} \; +} diff --git a/meta/packages/x11-common/xserver-nodm-init.bb b/meta/packages/x11-common/xserver-nodm-init.bb new file mode 100644 index 0000000000..46cb164a51 --- /dev/null +++ b/meta/packages/x11-common/xserver-nodm-init.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "Simple Xserver Init Script (no dm)" +LICENSE = "GPL" +SECTION = "x11" +PRIORITY = "optional" +PR = "r17" +RDEPENDS = "dbus-wait" + +SRC_URI = "file://xserver-nodm" +S = ${WORKDIR} + +PACKAGE_ARCH = "all" + +do_install() { + install -d ${D}/etc + install -d ${D}/etc/init.d + install xserver-nodm ${D}/etc/init.d +} + +inherit update-rc.d + +INITSCRIPT_NAME = "xserver-nodm" +INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." diff --git a/meta/packages/x11-common/xserver-nodm-init/xserver-nodm b/meta/packages/x11-common/xserver-nodm-init/xserver-nodm new file mode 100755 index 0000000000..f6399fc1fa --- /dev/null +++ b/meta/packages/x11-common/xserver-nodm-init/xserver-nodm @@ -0,0 +1,51 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: xserver +# Required-Start: $local_fs $remote_fs dbus +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO + +killproc() { # kill the named process(es) + pid=`/bin/pidof $1` + [ "$pid" != "" ] && kill $pid +} + +read CMDLINE < /proc/cmdline +for x in $CMDLINE; do + case $x in + x11=false) + echo "X Server disabled" + exit 0; + ;; + esac +done + +case "$1" in + start) + . /etc/profile + echo "Starting Xserver" + /etc/X11/Xserver & + # Wait for the desktop to say its finished loading + dbus-wait org.matchbox_project.desktop Loaded + ;; + + stop) + echo "Stopping XServer" + killproc xinit + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "usage: $0 { start | stop | restart }" + ;; +esac + +exit 0 |