cvs commit: hints svnc-x_terminal.txt

timothy at timothy at
Tue Jul 8 09:57:12 PDT 2003

timothy     03/07/08 10:57:12

  Modified:    .        svnc-x_terminal.txt
  Rmoved hacking system files and sed hacks.
  Added modeforce patch of svncviewer.
  Typo fixes. svgalib compilation streamlined.
  Revision  Changes    Path
  1.3       +155 -93   hints/svnc-x_terminal.txt
  Index: svnc-x_terminal.txt
  RCS file: /home/cvsroot/hints/svnc-x_terminal.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- svnc-x_terminal.txt	7 May 2003 16:42:33 -0000	1.2
  +++ svnc-x_terminal.txt	8 Jul 2003 16:57:11 -0000	1.3
  @@ -1,6 +1,6 @@
   TITLE:		Setting up a minimalistic X terminal using the svga vncviewer
   LFS VERSION:	All (tested against LFS-pre4.0)
  -AUTHOR:		Csaba Henk <ekho at>
  +AUTHOR:		Csaba Henk <ekho at>
   	This hints shows how to equip an uClibc-based bootfloppy with
  @@ -8,7 +8,7 @@
   	low-end computers to X terminals. We also describe a possible
   	minimalistic server + client (X terminal) configuration.
  -VERSION:	0.1.1
  +VERSION:	0.5
  @@ -28,16 +28,17 @@
    Bugs and weirdnesses
  +Appendix A -- svgalib-1.9.17-Makefiles.diff
   * For the most recent version check out 
   * See changelog at 
   * Comments, ideas, critics, flames are welcome.
  @@ -82,7 +83,7 @@
   This hint is a continuation of the uclibc-bootfloppy hint (
   ) which describes how to put together a bootfloppy based on recent linux
   kernel, the uClibc C library and busybox. The steps described here
  @@ -99,7 +100,7 @@
   This hint,additional info and downloadable bootdisk image with svnc
   can be found at my homepage (or at its mirror):
   In this hint we the assume that you use an x86 PC (both for making and
  @@ -108,9 +109,11 @@
   be hard. Doing it with another compiler depends on how much does
   uClibc support that compiler.
  -If you copy command from this hint to your shell, be careful
  -that line-terminating backslashes (\) will keep their position (no
  -whitespace characters should follow them).
  +If you copy command from this hint to your shell, be careful that
  +line-terminating backslashes (\) will keep their position (no whitespace
  +characters should follow them). A possible solution is open this hint in
  +the Vim GUI, and copy'n'paste from there.
   What do we need?
  @@ -173,27 +176,24 @@
   Installing svgalib
  -First some necessary adjustments. In the source directory type
  -ln -s src/egadrv.c src/drivers &&
  -sed -e '/^TOPDIR/s%\(^.*$\)%\1 `pwd`/install%' \
  - -e '/^datadir/s%\$(TOPDIR)%%' Makefile.cfg > Makefile.cfg.tmp &&
  -mv Makefile.cfg.tmp Makefile.cfg
  +First some necessary corrections for the 1.9.17 version of svgalib;
  +hopefully these will be unnecessary for subsequent releases. You find a
  +patch in Appendix A for svgalib-1.9.17, or at
  -"ln -s src/egadrv.c src/drivers" :
  -egadrv.c is not found during the compilation at its default place. This
  -symlink is a cure for this problem.
  +This patch corrects some typos in the Makefiles. Put the patch to the
  +svgalib source dir as svgalib-1.9.17-Makefiles.patch . Then type
  -"sed  -e '/^TOPDIR/s%\(^.*$\)%\1 `pwd`/install%' [...]" :
  +ln -s ../egadrv.c src/drivers &&
  +patch -Np1 -i svgalib-1.9.17-Makefiles.patch 
  -This command adjusts the place of installation to a place which is owned
  -by the bootdisk user. Without it "make install" would return with error 
  +(the first command is the correction of a file misplacement).
  -Then adjust the list of supported drivers in Makefile.cfg according to
  +These were the version-specific corrections. Now let's go for the real
  +Adjust the list of supported drivers in Makefile.cfg according to
   your needs. By carefully choosing the few drivers you need, you can
   decrease the size of the binary with about 100 kb or maybe more! However, 
   our filesystem is big enough for the svga library with all default drivers
  @@ -201,31 +201,27 @@
   same as the one used on your development platform, also set the
   KERNELRELEASE, INCLUDEDIR variables according to this.
  -Then run 
  +Now we compile svgalib and install it to the directory of the floppy's
  +filesystem. In this development version of svgalib the svga-aware
  +programs are needed no more to run as setuid root, but a kernel module
  +is to be loaded for using svgalib. The commands below also compile and
  +install the kernel module. 
  -make install
  -This will return with error because executing the root privileged part
  -of the installation is not permitted (quite stupid that svgalib does not
  -have a make command without installation). But you succeeded if the files
  -sharedlib/, sharedlib/ exist.
  -In this development version of svgalib the svga-aware programs are
  -needed no more to run as setuid root, but a kernel module is to be
  -loaded for using svgalib. The commands below compile this module, and
  -then put everything to is appropriate place in our filesystem.
  -cd kernel/svgalib_helper &&
  -make all &&
  -cp svgalib_helper.o $HOME/rfloppy/lib/modules &&
  -cd ../../sharedlib &&
  +make shared &&
  +cd sharedlib &&
   for q in "" gl; do 
   strip libvga$*
   ln -s libvga$* libvga$ 
   ln -s libvga$ libvga$
   done &&
   mkdir -p $HOME/rfloppy/usr/lib && 
  -cp -a libvga* $HOME/rfloppy/usr/lib
  +cp -a libvga* $HOME/rfloppy/usr/lib &&
  +# Now comes the compilation of the module
  +cd ../kernel/svgalib_helper &&
  +make all &&
  +mkdir -p $HOME/rfloppy/lib/modules &&
  +cp svgalib_helper.o $HOME/rfloppy/lib/modules &&
  +cd ../..
   Also create the file $HOME/rfloppy/etc/vga/libvga.config, and put into it
   your mouse type at least. Eg., my libvga.config looks like:
  @@ -233,49 +229,63 @@
   mouse IMPS2
   mdev /dev/misc/psaux
  -We will need the svgalib libraries to link against them. For this aim,
  -we put them to a place where the linker will find them. Now we need to 
  -become root again. As root, if you have svgalib installed on your system, 
  -move it to a safe place somehow like
  -cd /usr/lib &&
  -mkdir svga-saves &&
  -mv libvga* svga-saves
  -and then 
  -cp -a $BDHOME/svgalib-1.9.*/sharedlibs/libvga* /usr/lib &&
  -cp $BDHOME/svgalib-1.9.*/include/vga* /usr/i386-linux-uclibc/include &&
  -cp $BDHOME/svgalib-1.9.*/gl/vgagl.h /usr/i386-linux-uclibc/include
  -Now become the bootdisk user again. If you feel like, you can also
  -compile the svga test suite. It is useful if you want to custom-tailor
  -your svga configuration (which means adjusting the libvga.config file).
  -To do so, type
  -make demoprogs
  +If you feel like, you can also compile the svga test suite. It is useful
  +if you want to custom-tailor your svga configuration (which means
  +adjusting the libvga.config file). To do so, type
  +cd demos &&
  +make "LIBS=../sharedlib/ ../sharedlib/" &&
  +cd ../threeDKit &&
  +make "LIBS=../sharedlib/ ../sharedlib/" \
  + "INCLUDES = -I../include -I. -I../src -I../gl" &&
  +cd ..
   in the svgalib source directory. You will find the executables in the
   demos and threeDKit directories.  
  +Do not delete the svgalib source dir -- we will need it in the following
   Installing svncviewer
  +Do not yet extract the svncviewer tarball! The following commands will
  +assume that the svgalib source dir, the tightvnc and svncviewer tarballs
  +and you (ie., the bootdisk user) are at $HOME.
   To get svncviewer compiled, we need the libvncauth.a library form the
  -tightvnc distribution. The usual way to compile both of libvncauth.a and
  +tightvnc distribution. (Thus svncviewer is compiled inside the vnc
  +source tree.) The usual way to compile both of libvncauth.a and
   svncviewer is to create makefiles with the xmkmf utility, and then
   running make. 
   However, xmkmf will not work with uClibc (unless we build X against
   uClibc, and we don't want to do that). Therefore we do the following:
  -* run xmkmf using glibc on both of libvncauth and svncviewer;
  +* run xmkmf (imake) using glibc on both of libvncauth and svncviewer;
  +* run make on libvncauth and svncviewer with options for using uClibc
  +and local svgalib and for size optimization.
  +In practice this means the following: first we define a variable which
  +stores the relative path from the svncviewer source dir to svgalib
  +source dir (we need this path as we don't install the uClibc-linked
  +svgalib on the development platform). If you follow my setup faithfully,
  +it should be:
  +export SVGADIR=../../svgalib-1.9.17
  -* we hack the produced Makefiles to use uClibc and size optimization;
  +(otherwise find it out by yourself :).
  -* run make on libvncauth and svncviewer.
  +Here I tell you about a patch I made for svncviewer:
  -In practice this means the following sequence of commands:
  +This introduces a -mode option for svncviewer with which you can force
  +svncviewer to use a given svga mode (these modes are described in the
  +svgalib docs or check out the vgatest executable of the svgalib test
  +kit). If you don't apply the patch just execute the following sequence
  +of commands, otherwise take a break for patching when its time comes. 
   bzcat tightvnc-1.2.*_unixsrc.tar.bz2 | tar xv &&
   cd vnc_unixsrc &&
  @@ -283,19 +293,16 @@
   unset CC ; : &&
   cd libvncauth &&
   xmkmf &&
  -sed -e '/^ *CC *=/s%gcc%i386-uclibc-gcc%' -e 's%-O2%-Os%g' \
  - -e '/^ *AR *=/s%ar%i386-uclibc-ar%' Makefile > Makefile.tmp &&
  -mv Makefile.tmp Makefile &&
   cd ../svncviewer &&
   xmkmf &&
  -sed -e '/^ *CC *=/s%gcc%i386-uclibc-gcc%' -e 's%-O2%-Os%g' Makefile \
  - > Makefile.tmp &&
  -mv Makefile.tmp Makefile &&
  -export CC=i386-uclibc-gcc &&
  +export CC=i386-uclibc-gcc &&   # Not necessary, just to restore defaults
   cd ../libvncauth &&
  -make &&
  +make "CC=i386-uclibc-gcc" "CDEBUGFLAGS = $CFLAGS -fno-strength-reduce" \
  + "AR = i386-uclibc-ar clq" &&
   cd ../svncviewer &&
  -make &&
  +make "CC=i386-uclibc-gcc" "CDEBUGFLAGS = $CFLAGS -fno-strength-reduce" \
  + "INCLUDES = -I../include -I. -I$SVGADIR/include -I$SVGADIR/gl" \
  + "SVGALIB = $SVGADIR/sharedlib/ $SVGADIR/sharedlib/" &&
   strip svncviewer &&
   mkdir -p $HOME/rfloppy/usr/bin &&
   cp svncviewer $HOME/rfloppy/usr/bin
  @@ -306,8 +313,8 @@
   the output of the respective make commands; I give away these and not
   the Makefiles because xmkmf-made Makefiles are huge and illegible):
   Creating the bootdisk
  @@ -417,7 +424,6 @@
   Install tightvnc with the following commands:
   xmkmf &&
   make World &&
   cd Xvnc &&
  @@ -487,7 +493,7 @@
   (you may need to pass -geometry and -depth options to be compatible with
  -the hardware of the client).
  +the video capabilities of the client).
   On the client, type:
  @@ -536,8 +542,11 @@
   As it can be read in the site, "Pre releases of svgalib-2
   will be called 1.9.x, with no pre, but they are still very
   experimental." Why do we use experimental version? Simply because it
  -works much more flawlessly: the stable release (svgalib-1.4.3) was
  -also willing to compile, but it gave me segmentation faults. 
  +works much more flawlessly: the stable release (svgalib-1.4.3) was also
  +willing to compile, but it gave me segmentation faults. Note that the
  +1.9.17 version has some lesser bugs which are corrected in this hint;
  +these corrections are likely to become unnecessary with a new release of
   * snvc-0.1:
  @@ -553,7 +562,7 @@
   German layouts), but this way several keyboard combination got disabled:
   eg., killing the viewer with Ctrl+Alt+Backspace does not work; the
   Ctrl+Alt+Left/Right combinations of icewm for changing desktops neither
  -works. And the source ships with precompiled libvncauth.a and svncviewer
  +work. And the source ships with precompiled libvncauth.a and svncviewer
   and bunch of other unnecessary things; it's quite annoying (the manpage
   is fine, tho). So I sticked with the oldie-but-goldie original version
   of svncviewer.
  @@ -561,7 +570,7 @@
   Bugs and weirdnesses
  -The list below is about both of the uClibc-bootfloppy and the
  +The list below is about both of the uclibc-bootfloppy and the
   svnc-x_terminal hints. 
   The following weirdnesses are probably due to the respective programs
  @@ -579,11 +588,21 @@
  -* Find the appropriate environment variable settings / Makefile hacks
  -for svga demoprogs and svncviewer which let us link against the svga
  -libs without putting them to /usr/lib (I made some weak attempts but
  -those didn't succeed and it would be not worth to delay this 0.1
  -release because of this.)
  +Now it seems that the uclibc-bootfloppy and svnc-x_terminal hints got
  +quite close to their idea: you set up the development environment, su to
  +bootdisk user, type in some commands, finally put a floppy to the drive
  +and run the mkbootdisk script, and you have the bootfloppy.
  +However, I can say only "Now it seems..." but I can't say "Now it is..."
  +-- without testing the stuff by many people and getting feedback I
  +So the main TODO is to be done by you, kind reader: test and report!! 
  +After it happens, these hints can be claimed to be mature.
  +Another TODO will be in the future to upgrade to newer versions of the
  +installed programs, if new versions come out. 
  @@ -604,7 +623,50 @@
  -Archaic had some useful advice.
  +Archaic had some useful advice about trimming the root filesys (/etc).
  +Following the advice of Bill Maltby, "rdev $DISK 0,0" is used rather
  +than "rdev $DISK $DISK" or "rdev $DISK 2,0".
  +* * * Appendices * * *
  +Appendix A -- svgalib-1.9.17-Makefiles.patch
  +diff -aur orig/svgalib-1.9.17/Makefile.cfg svgalib-1.9.17/Makefile.cfg
  +--- orig/svgalib-1.9.17/Makefile.cfg	2002-12-03 10:53:56.000000000 +0100
  ++++ svgalib-1.9.17/Makefile.cfg	2003-07-01 23:53:59.000000000 +0200
  +@@ -316,7 +316,7 @@
  + endif
  ++ifneq ($(INCLUDE_S3_DRIVER),y)
  +@@ -328,4 +328,4 @@
  + 	INCLUDE_SC1148X_DAC =
  +diff -aur orig/svgalib-1.9.17/demos/Makefile svgalib-1.9.17/demos/Makefile
  +--- orig/svgalib-1.9.17/demos/Makefile	2002-04-10 15:54:26.000000000 +0200
  ++++ svgalib-1.9.17/demos/Makefile	2003-07-02 00:14:23.000000000 +0200
  +@@ -58,7 +58,7 @@
  + 	$(CC) $(CFLAGS) $(LDFLAGS) -o linearspeed linearspeed.c memset.o $(LIBS)
  + buildcsr: $(OBJS) mkcur.o
  +-	$(CC) -o buildcsr $(OBJS) $(FLAGS) mkcur.o -lvgagl -lvga
  ++	$(CC) -o buildcsr $(OBJS) $(FLAGS) mkcur.o $(LIBS)
  + clean:	cleanbin
  + 	rm -f .depend *.o *~ *.bak core
   END of "Setting up a minimalistic X terminal using the svga vncviewer" hint
Unsubscribe: send email to listar at
and put 'unsubscribe hints' in the subject header of the message

More information about the hints mailing list