How to Install RT-FUTEX & RT-NPTL @ RedHat 9.0

"Hu, Boris" <[email protected]>
Newsgroups gmane.comp.lib.phil,gmane.linux.kernel.carrier-grade
Message-ID <37FBBA5F3A361C41AB7CE44558C3448E1A18E5@pdsmsx403.ccr.corp.intel.com>
How to Install RT-FUTEX & RT-NPTL @ RedHat 9.0

* Install Redhat 9.0
  a. Select OS type : Server
  b. Add Components:
      1) Development Tools
      2) Editors
     
* RT-Futex Related Software Packages Download
  a. rtfutex-2_5_67-6.patch:
     http://developer.osdl.org/dev/robustmutexes/
  b. rtfutex-test-6.tar.gz :
     http://developer.osdl.org/dev/robustmutexes/
  c. linux-2.5.67.tar.bz2  :
     http://www.kernel.org/pub/linux/kernel/v2.5/
  d. module-init-tools-0.9.12.tar.bz2 (If kernel modules needed)
    http://his.luky.org/ftp/mirrors/linux/kernel/people/rusty/modules/  
  e. Robert Love's Scheduler fix patch at: 
    http://lkml.org/archive/2003/6/19/157/

* Module-init-tools Building(If kernel modules needed)
  $ tar xjvf module-init-tools-0.9.12.tar.bz2
  $ cd module-init-tools-0.9.12
  $ ./configure
  $ make 
  $ make install

* RT-Futex Kernel Building
  $ mkdir rtfutex-0.6; cd rtfutex-0.6
  $ export KDIR=$(pwd)
  $ tar xjvf linux-2.5.67.tar.bz2 -C $KDIR
  $ cp rtfutex-2_5_67-6.patch $KDIR ; cd $KDIR/linux-2.5.67;
  $ patch -p0 < ../rtfutex-2_5_67-6.patch
  $ make menuconfig
     1) Select Preemptible Kernel
  $ make bzImage
  # Add the new built kernel image to the bootloader and reboot with
    it.

* Kernel Testing (Optional)
  # Boot the system with the new built kernel image
  $ tar xzvf rtfutex-test-6.tar.gz -C $KDIR
  $ cd $KDIR/rtfutex-test-6
  $ export KDIR=$(KDIR)/linux-2.5.67
  $ ./bin/aaaa  # if you wiped ./configure 
  $ ./configure --with-headers=$KDIR/include
  $ make
  $ make -C src run-tests > result
  $ grep AUTO-RUN result

* RT-NPTL Related Software Packages Download
  a. rtnptl-0.5.patch      :
     http://developer.osdl.org/dev/robustmutexes/
  b. rtnptl-test-0.5.tar.gz:
     http://developer.osdl.org/dev/robustmutexes/
  c. nptl-0.36.tar.bz2     : 
     http://people.redhat.com/drepper/nptl/
  d. glibc for nptl-0.36   :
     $ export CVSROOT=:pserver:sources.redhat.com/cvs
     $ cvs -z 9 co -d src -D "2003-04-15T15:50:00-0700" libc 

* RTNPTL Building
  $ mkdir rtnptl-0.5; cd rtnptl-0.5
  $ export DIR=$(pwd)
  # mv glibc for nptl-0.36 source dir as $DIR/src
  $ tar xjvf nptl-0.36.tar.bz2 -C $DIR/src
  $ cp rtnptl-0.5.patch $DIR
  $ cd $DIR/src/nptl
  $ patch -p1 < $DIR/rtnptl-0.5.patch

  # Build and install 'glibc w/ nptl-0.36 + rtnptl-0.5' to jailroot
  $ cd $DIR
  $ mkdir root
  $ export ROOT=$DIR/root
  $ mkdir build; cd build
  $ ../src/configure --prefix=$ROOT --disable-profile
                     --enable-add-ons=nptl \
                     --with-tls --with-headers=$KDIR/include 
  $ make -j2
  $ mkdir -p $ROOT/etc 
  $ touch $ROOT/etc/ld.so.conf
  $ make install    # **NOTE**: before running "make install",
                      double-check that a prefix has been given to 
                      "./configure". 
                      Otherwise,
                      you are risky of screwing up the original system 
                      (esp. glibc), for ever.
  $ cd $ROOT/include
  $ rm -rf linux asm asm-generic
  $ for d in $KDIR/include/{linux,asm,asm-generic}; 
    do ln -s $d .; 
    done
  # Include this Makefile.inc from your makefile to build
  # using the freshly compiled glibc and NPTL+RT patches.
  $ cat > $DIR/Makefile.inc  <<EOF
GLIBCROOT := $DIR
GLIBCDIR := $DIR/build
GLIBC_CFLAGS := -nostdinc \\
		-I/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include \\
		-I\$(GLIBCROOT)/root/include{,/asm,/linux}
GLIBC_LDFLAGS := \$(GLIBCDIR)/nptl/libpthread.so.0 \\
        \$(GLIBCDIR)/libc.so.6 \\
-Wl,-rpath,\$(GLIBCDIR):\$(GLIBCDIR)/nptl:\$(GLIBCDIR)/elf,-dynamic-li
nker,\$(GLIBCDIR)/elf/ld-linux.so.2
CFLAGS += \$(GLIBC_CFLAGS)
LDFLAGS += \$(GLIBC_LDFLAGS)
export CFLAGS LDFLAGS
EOF 

* RTNPTL Tests Building (Optional)
  $ tar xzvf rtnptl-test-0.5.tar.gz -C $DIR
  $ cd $DIR/rtnptl-test-0.5 ; 
  $ cp ../Makefile.inc .
  $ make
  $ ./run.sh  


Good Luck !
Boris Hu
(Hu Jiangtao)
Intel China Software Lab
--------------------------------------
This email message contains solely 
my own personal views, and not 
necessarily those of my employer.
--------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.