2024-07-22 01:01:29 +02:00
|
|
|
# Notes on building Xenocara for SecBSD X hackers
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
This document presents some techniques that can be useful for people
|
|
|
|
wanting to hack the xenocara tree. It assumes some basic knowledge of
|
2024-04-29 02:35:41 +02:00
|
|
|
the SecBSD build system, as described in the release(8) manual page.
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
## About Xenocara
|
|
|
|
|
2023-08-28 07:57:34 +02:00
|
|
|
Xenocara is the name chosen for OpenBSD's version of X. It's
|
|
|
|
currently based on X.Org 7.7 and its dependencies. The goal of
|
|
|
|
Xenocara is to provide a framework to host local modifications and to
|
|
|
|
automate the build of the modular X.Org components, including 3rd
|
|
|
|
party packages and some software maintained by OpenBSD developers.
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
## Source tree
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
The organisation of the xenocara directory follows the general
|
|
|
|
organisation used in X.Org:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
- app: X applications and utilities
|
|
|
|
- data: various data files (keyboard mappings and bitmaps)
|
|
|
|
- doc: documentation
|
|
|
|
- driver: input and video drivers
|
|
|
|
- font: fonts
|
|
|
|
- lib: libraries
|
|
|
|
- proto: X protocol headers
|
|
|
|
- util: utilities that don't fit anywhere else
|
|
|
|
- xserver: the source for the X servers
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
In addition Xenocara uses the following directories:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
- dist: contains some of the 3rd party sources, when keeping them separate
|
|
|
|
helps the build system (fontconfig, xcb and xkeyboard-config)
|
|
|
|
- distrib: all binary distribution related tools and data
|
|
|
|
- etc: some default config files
|
|
|
|
- share: make(1) configuration for Xenocara
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
At the top-level directory two files describe the individual
|
|
|
|
components of Xenocara:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
- MODULES: lists all X.Org components (imported from the X.Org distribution
|
|
|
|
at http://xorg.freedesktop.org/archive/)
|
|
|
|
- 3RDPARTY: lists all 3rd party software components provided in Xenocara,
|
|
|
|
either as dependencies of the X.Org software, or as complements
|
|
|
|
to it to provide a more useable default environment.
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
## Compiling and installing
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
Xenocara is made up of almost three hundred different independent
|
|
|
|
packages that need to be built and installed in the right order,
|
|
|
|
especially while bootstrapping (while /usr/X11R6 is still empty). The
|
|
|
|
Xenocara Makefiles take care of that using the 'build' target.
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
### Quick startup guide
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
The following steps will build and install everything for the first time.
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
cd /usr/xenocara
|
|
|
|
doas make bootstrap
|
|
|
|
doas make obj
|
|
|
|
doas make build
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
If you want to use another obj directory see below.
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
### Requirements
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
A freshly checked out xenocara tree is buildable without any external
|
|
|
|
tool. Only the xenocara and the src (currently only the
|
|
|
|
src/sys/dev/pci/pcidevs file) trees are needed.
|
|
|
|
|
|
|
|
However if you start modifying things in the automake build
|
|
|
|
system used by many packages, you will need to have the following
|
|
|
|
GNU autotools packages installed:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
- automake 1.12 (devel/automake/1.12)
|
|
|
|
- autoconf 2.71 (devel/autoconf/2.71)
|
|
|
|
- metaauto (devel/metaauto)
|
|
|
|
- libtool (devel/libtool)
|
|
|
|
- gettext-tools (devel/gettext)
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
If you have your source tree on an NFS partition, make sure the clocks
|
|
|
|
of your server and client are properly synchronised. Any significant
|
|
|
|
drift will cause various problems during builds.
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
### Path
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
To build Xenocara, you need to have /usr/X11R6/bin in your PATH.
|
|
|
|
|
|
|
|
If you have installed the full Xenocara X sets on your system, you
|
|
|
|
don't need to build all of Xenocara to patch one element. You can go
|
|
|
|
to any module sub-directory and run 'make build' from there.
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
#### Source directory
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
The variable XSRCDIR can be set either in the environment or in
|
|
|
|
/etc/mk.conf to point to the xenocara source tree, in case you keep it
|
|
|
|
in a non-standard directory (the default is /usr/xenocara).
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
#### Objdirs
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
Xenocara requires objdirs. Just run 'make obj' as root at any level
|
|
|
|
before 'make build' to make sure that the object directories are
|
2024-07-25 22:49:18 +02:00
|
|
|
created. XOBJDIR defines the obj directory that is used (defaults to
|
|
|
|
/usr/xobj). It should be created before running 'make obj'.
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
## Regenerating configure scripts
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
Whenever you touched an import file for GNU autotools (Makefile.am,
|
|
|
|
configure.ac mostly), you need to rebuild the configure script and
|
|
|
|
makefiles skeletons. For that use the following command in the
|
|
|
|
directory where you edited the autotools source files:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
make -f Makefile.bsd-wrapper autoreconf
|
|
|
|
doas make -f Makefile.bsd-wrapper build
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
# Cleaning in packages managed by autotools
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
One common problem when building xenocara is the case where the obj
|
|
|
|
directory didn't exist (or the symbolic link pointed to a non-existent
|
|
|
|
directory) when the source was first built. After fixing this problem,
|
|
|
|
'configure' will refuse to work in the obj dir, because the source
|
|
|
|
is already configured.
|
|
|
|
|
|
|
|
To recover from this in one package:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
rm -f obj
|
|
|
|
make -f Makefile.bsd-wrapper cleandir
|
|
|
|
mkdir XOBJDIR
|
|
|
|
make -f Makefile.bsd-wrapper obj
|
|
|
|
doas make -f Makefile.bsd-wrapper build
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
or from the root of the xenocara tree:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
find . -type l -name obj | xargs rm -f
|
|
|
|
make cleandir
|
|
|
|
mkdir XOBJDIR
|
|
|
|
make obj
|
|
|
|
doas make build
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
for more desperate cases, remove all files from XSRCDIR not in CVS:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
cd XSRCDIR
|
|
|
|
cvs -q update -PAd -I - | awk '$1=="?" {print $2}' | xargs rm -f
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
# Updating XCB to a new release
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
libxcb uses C source files that are generated from the XML protocol
|
|
|
|
specification using xcbgen, written in Python. On OpenBSD those files
|
|
|
|
cannot be generated during a normal 'make build' since Python is not
|
|
|
|
in the base system. So the generated version are checked in CVS
|
|
|
|
(in lib/libxcb/src/). Here is the receipt to update them when updating
|
|
|
|
to a new release of XCB:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
1. Update proto/xcb-proto.
|
|
|
|
2. Update the x11/py-xcbgen port to the same version and install the
|
2023-08-28 07:57:34 +02:00
|
|
|
python3 package.
|
2024-07-22 01:01:29 +02:00
|
|
|
3. Update dist/libxcb.
|
|
|
|
4. Check lib/libxcb/src/Makefile if new files need to be generated.
|
2024-07-25 22:49:18 +02:00
|
|
|
5. Run make in lib/xcb/src to generate the files for the new version.
|
2024-07-22 01:01:29 +02:00
|
|
|
6. Check lib/libxcb/ for other files needing updates.
|
|
|
|
7. Commit the result.
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
## How to build something with debug information?
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-25 22:49:18 +02:00
|
|
|
You can use env CFLAGS=-g make -f Makefile.bsd-wrapper build to
|
2023-08-28 07:57:34 +02:00
|
|
|
build any module with debugging information, but you'll need to remove
|
2024-07-25 22:49:18 +02:00
|
|
|
XOBJDIR/xorg-config.cache.${MACHINE} before doing that because
|
2023-08-28 07:57:34 +02:00
|
|
|
autoconf caches the value of CFLAGS in its cache.
|
|
|
|
|
2024-07-25 22:49:18 +02:00
|
|
|
## How to get a core file out of the X server?
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
Several things are needed:
|
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
1. set kern.nosuidcoredump=3 in /etc/sysctl.conf
|
|
|
|
2. start the X server as root, with the -keepPriv option. If you use
|
2024-04-29 02:35:41 +02:00
|
|
|
xenodm, you can add the option in /etc/X11/xenodm/Xservers. If you
|
|
|
|
want to use startx, you need to run it as root, like this:
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-25 22:49:18 +02:00
|
|
|
startx -- /usr/X11R6/bin/X -keepPriv
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-04-29 02:35:41 +02:00
|
|
|
Now the X server should dump core when catching a fatal signal and the
|
|
|
|
core dump should be in /var/crash/Xorg/<pid>.core.
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-04-29 02:35:41 +02:00
|
|
|
Alternatively, if the X server is using the modesetting(4) driver
|
|
|
|
(it's the case with most recent AMD and Intel GPUs), it can be started
|
|
|
|
as a regular user, without setting kern.nosuidcoredump=3, and the core
|
|
|
|
dump will be in the current directory where startx was executed.
|
2023-08-28 07:57:34 +02:00
|
|
|
|
2024-07-22 01:01:29 +02:00
|
|
|
See also http://xorg.freedesktop.org/wiki/Development/Documentation/ServerDebugging
|
2023-08-28 07:57:34 +02:00
|
|
|
|
|
|
|
--
|
2024-07-25 22:49:18 +02:00
|
|
|
$OpenBSD: README.md,v 1.2 2024/07/22 19:36:31 rsadowski Exp $
|