1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../rtai/pkg_linux26_post.conf
5 # Copyright (C) 2007 - 2008 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
16 # patch procedure should be more flexible to support different architectures
19 # This function extracts RTAI and patches Linux kernel
20 # TODO: patch can be optimised to extract only the needed patch files
21 # and not the whole RTAI package
24 echo '------------------------------------'
25 echo 'Applying RTAI patch'
27 echo '------------------------------------'
28 tar $taropt `match_source_file -p rtai rtai` -C ../
30 # TODO: Need to figure out the way to make RTAI patching automatically
31 # Applying Linux patch
32 patch -p1 < ../rtai-3.6/base/arch/i386/patches/hal-linux-2.6.23-i386-1.12-00.patch
37 if [ $SDECFG_PKG_LINUX_KEEP_BUILDSRC = 1 ]; then
38 echo "Copying compiled kernel with source ..."
39 rm -rf $root/usr/src/linux-${lx_kernelrelease}-build
40 mkdir -p $root/usr/src/linux-${lx_kernelrelease}-build
41 cp -ar . $root/usr/src/linux-${lx_kernelrelease}-build
46 echo '--------------------------------------------'
47 echo 'Entering make_rtai function from rtai package'
48 echo '--------------------------------------------'
50 #TODO: remove hardlinks
52 cp $base/package/*/rtai/.rtai_config ./.rtai_config
54 var_append instopt ' ' "DESTDIR=$root/"
55 prefix="/usr/realtime/"
57 # Do I really need to specify options myself?
58 # Maybe T2 could handle it automatically?!
60 # var_append confopt ' ' "--datadir=$root"
61 # var_append confopt ' ' "--prefix=$root/$prefix/realtime"
62 # var_append confopt ' ' "--prefix=/usr/realtime"
63 # var_append confopt ' ' "--with-rtai-dir=$root/usr/include"
64 var_append confopt ' ' "--with-linux-dir=$kerneldir"
65 #DK var_append confopt ' ' "--build=$arch_build"
66 #DK var_append confopt ' ' "--host=$arch_target"
68 eval_config_command $confopt
70 eval $MAKE DESTDIR=$root install
74 # Let's set RTAI path so that we can run comedi scripts out of the box
75 echo '$PATH="/usr/realtime/bin:$PATH"' > $root/etc/profile.d/rtai
79 # The function below should only be enabled when comedi-driver package selected
80 # to be compiled with RTAI support
81 make_rtai_with_comedi()
83 echo '--------------------------------------------'
84 echo 'Entering make_rtai_with_comedi function'
85 echo '--------------------------------------------'
87 #TODO: remove hardlink
89 # Now rtai_config will be copied to the RTAI source dir from T2 "rtai" target
90 cp $base/package/*/rtai/.rtai_config_comedi ./.rtai_config
92 # Do I really need to specify options myself?
93 # Maybe T2 could handle it automatically?!
95 # var_append confopt ' ' "--prefix=/$prefix/realtime"
96 var_append confopt ' ' "--prefix=/usr/realtime"
97 var_append confopt ' ' "--with-linux-dir=$kerneldir"
98 # var_append confopt ' ' "--with-module-dir=$root/lib/modules/"
99 var_append confopt ' ' "--build=$arch_build"
100 var_append confopt ' ' "--host=$arch_target"
101 var_append confopt ' ' "--enable-comedi-lxrt"
102 #DK var_append confopt ' ' "--with-comedi=/$prefix"
103 #DK var_append confopt ' ' "--with-comedi=$root/usr"
104 eval_config_command $confopt
106 # eval $MAKE install DESTDIR=$root
111 # patch Linux with RTAI patch.
112 hook_add postpatch 1 patch_linux
114 #hook_add inmake 2 cp_linux_sources
116 # This function is substituted by rtai.conf.
117 #hook_add postmake 2 make_rtai
119 # This function will be substituted with rtai_post.conf function
120 #hook_add postmake 4 make_rtai_with_comedi