* [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
@ 2006-01-07 11:30 Gilles Chanteperdrix
2006-01-07 18:04 ` Gilles Chanteperdrix
2006-01-08 12:08 ` Philippe Gerum
0 siblings, 2 replies; 13+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-07 11:30 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 1594 bytes --]
Hi,
attached is a patch of Xenomai trunk build system to allow building
Linux kernel as part of Xenomai build process. This way, typing make
install builds and installs the Linux kernel, kernel modules and
Xenomai.
The patch is a bit young and still has a few drawbacks, but before
spending to much time on it, I would like to know if anyone is opposed
to the idea of building Linux in Xenomai build tree.
To try this patch, apply and run the bootstrap script.
3 options are then added to configure :
--enable-linux-build Build Linux in Xenomai build tree
--with-linux-srcdir specify the path to Linux sources. Default is to
use, if not cross-compiling, the source of the
running kernel or /usr/src/linux.
--with-adeos-patch specify the path to the Adeos patch. Default is to
infer the patch name from Linux kernel version.
When using the --enable-linux-build option, configure creates a linux
tree in Xenomai build tree, and run the prepare-kernel.sh script for
this tree. Typing "make" re-runs prepare-kernel.sh (in case some changes
occured in Xenomai sources) and run make in the kernel tree.
Known limitations are:
- it is not very well tested, so, maybe some error cases are not handled
correctly ;
- it is not tested with Linux 2.4 ;
- for an unknown reason, xenomai modules are built every time
prepare-kernel.sh is run ;
- the cross-compilation prefix is inferred from the CC variable, it
should work in most situations, but not all.
Happy new year.
--
Gilles Chanteperdrix.
[-- Attachment #2: xeno-build-kernel.diff --]
[-- Type: application/octet-stream, Size: 9625 bytes --]
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/Makefile.am branches/build-kernel/Makefile.am
--- trunk/Makefile.am 2006-01-04 18:39:12.000000000 +0100
+++ branches/build-kernel/Makefile.am 2006-01-07 11:28:55.000000000 +0100
@@ -2,7 +2,9 @@ ACLOCAL_AMFLAGS=-I config
SUDO=sudo
-SUBDIRS = src include config @XENO_MAYBE_DOCDIR@ scripts
+# Do not include sim subdirectory in source tarball.
+DIST_SUBDIRS = src include config @XENO_MAYBE_DOCDIR@ scripts
+SUBDIRS = $(DIST_SUBDIRS) $(subdirs)
EXTRA_DIST = CREDITS README.INSTALL TROUBLESHOOTING ksrc
@@ -51,3 +53,44 @@ install-exec-local: devices
install-nodev:
$(MAKE) SUDO=false install
+
+if XENO_BUILD_LINUX
+linux/%:
+ $(top_srcdir)/scripts/prepare-kernel.sh \
+ --adeos="$(ADEOS_PATCH)" --linux=linux \
+ --arch=$(XENO_TARGET_ARCH) && \
+ cross=`expr $CC : '\(.*\)gcc' || :` && \
+ cd linux && $(MAKE) $* \
+ ARCH=$(XENO_TARGET_ARCH) \
+ CROSS_COMPILE=$$cross
+
+linux/.xenomai-prepared: config.status
+ ./config.status linux
+
+linux/install:
+ @sudo=; if test x`id -u` != x0 && test \! "x`type $(SUDO)`" = x; then \
+ sudo=$(SUDO); fi && \
+ cross=`expr $CC : '\(.*\)gcc' || :` && \
+ $$sudo $(mkinstalldirs) $(DESTDIR)/boot && \
+ cd linux && $$sudo $(MAKE) modules_install install \
+ ARCH=$(XENO_TARGET_ARCH) \
+ CROSS_COMPILE=$$cross \
+ INSTALL_PATH=$(DESTDIR)/boot \
+ INSTALL_MOD_PATH=$(DESTDIR)
+
+config oldconfig mconfig menuconfig gconfig xconfig:
+ $(MAKE) linux/$@
+
+all-local: linux/all
+
+clean-local: linux/clean
+
+distclean-local:
+ @test -e linux/.config && \
+ mv linux/.config linux/.config.saved.xenomai; \
+ $(MAKE) linux/distclean; \
+ test -e linux/.config.saved.xenomai && \
+ mv linux/.config.saved.xenomai linux/.config
+
+install-data-local: linux/install
+endif
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/configure.in branches/build-kernel/configure.in
--- trunk/configure.in 2006-01-07 11:46:12.000000000 +0100
+++ branches/build-kernel/configure.in 2006-01-07 12:16:08.000000000 +0100
@@ -48,15 +48,19 @@ AC_MSG_CHECKING([for target architecture
case "$host" in
i*86*-*)
XENO_TARGET_ARCH=i386
+ arch_have_sim=y
;;
powerpc-*|ppc-*)
XENO_TARGET_ARCH=powerpc
+ arch_have_sim=y
;;
powerpc64-*|ppc64-*)
XENO_TARGET_ARCH=powerpc
+ arch_have_sim=y
;;
ia64-*)
XENO_TARGET_ARCH=ia64
+ arch_have_sim=y
;;
bfin-*|bfinnommu-*|blackfin-*)
XENO_TARGET_ARCH=blackfin
@@ -150,6 +154,176 @@ if test $XENO_TARGET_ARCH = i386; then
AC_MSG_RESULT(${CONFIG_X86_TSC:-no})
fi
+dnl Flags for building Linux in Xenomai build tree.
+AC_MSG_CHECKING(whether building Linux in Xenomai build tree)
+AC_ARG_ENABLE(linux-build,
+ AS_HELP_STRING([--enable-linux-build], [Build Linux in Xenomai build tree]),
+ [case "$enableval" in
+ y | yes) XENO_BUILD_LINUX=y ;;
+ *) unset XENO_BUILD_LINUX ;;
+ esac])
+AC_MSG_RESULT(${XENO_BUILD_LINUX:-no})
+AM_CONDITIONAL(XENO_BUILD_LINUX, [test x"$XENO_BUILD_LINUX" = xy])
+
+if test x"$XENO_BUILD_LINUX" = xy; then
+ AC_MSG_CHECKING(for Linux sources)
+ unset XENO_LINUX_SRCDIR
+ AC_ARG_WITH(linux-srcdir,
+ AS_HELP_STRING([--with-linux-srcdir],[specify the path to Linux
+sources. Default is to use, if not cross-compiling, the sources of the running
+kernel or /usr/src/linux.]),
+ [XENO_LINUX_SRCDIR="`/bin/bash -c \"echo $withval\"`"])
+ if test x"$XENO_LINUX_SRCDIR" = x && test x"$cross_compiling" = xno; then
+ XENO_LINUX_SRCDIR=/lib/modules/`uname -r`/source
+ if test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ XENO_LINUX_SRCDIR=/usr/src/linux
+ fi
+ fi
+ if test x"$XENO_LINUX_SRCDIR" = x || test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset XENO_LINUX_SRCDIR
+ else
+ AC_MSG_ERROR([Unable to find Linux kernel sources tree, please use --with-linux-srcdir])
+ fi
+ fi
+
+ if test x"$XENO_LINUX_SRCDIR" != x; then
+ unset linux_EXTRAVERSION
+ unset linux_PATCHLEVEL
+ unset linux_SUBLEVEL
+ unset linux_VERSION
+
+ eval linux_`grep '^EXTRAVERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^PATCHLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^SUBLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^VERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+
+ linux_base_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL"
+ linux_full_version="$linux_base_version$linux_EXTRAVERSION"
+
+ if test x"$linux_PATCHLEVEL" = x -o x"$linux_SUBLEVEL" = x ||
+ test x"$linux_VERSION" = x; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(Unknown version)
+ unset linux_base_version
+ else
+ AC_MSG_ERROR([Unable to get version of $XENO_LINUX_SRCDIR, aborting.])
+ fi
+ else
+ AC_MSG_RESULT([$XENO_LINUX_SRCDIR (kernel ${linux_full_version})])
+ fi
+ fi
+
+ AC_MSG_CHECKING(for Adeos patch)
+ unset ADEOS_PATCH
+ AC_ARG_WITH(adeos-patch,
+ AS_HELP_STRING([--with-adeos-patch],[specify the path to the Adeos
+patch. Default is to infer the patch name from Linux kernel version.]),
+ [ADEOS_PATCH="`/bin/bash -c \"echo $withval\"`"])
+
+ if test x"$ADEOS_PATCH" = x && test x"$linux_base_version" != x; then
+ set -- $srcdir/ksrc/arch/$XENO_TARGET_ARCH/patches/adeos-*$linux_base_version*
+ ADEOS_PATCH=$1
+ fi
+ if test x"$ADEOS_PATCH" = x || test ! -e $ADEOS_PATCH; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset ADEOS_PATCH
+ else
+ AC_MSG_ERROR([Unable to find Adeos patch, please use --with-adeos-patch])
+ fi
+ else
+ AC_MSG_RESULT([$ADEOS_PATCH])
+ fi
+ AC_SUBST(ADEOS_PATCH)
+
+ AC_CONFIG_COMMANDS(linux, [
+ if test -e linux/.xenomai-prepared; then
+ . linux/.xenomai-prepared
+ if test x"$XENO_LINUX_SRCDIR" != x"$PREPARED_LINUX_SRCDIR" ||
+ test x"$ADEOS_PATCH" != x"$PREPARED_ADEOS_PATCH"; then
+ echo "*** Warning: built version of linux and requested versions are "
+ echo "*** different. If you want to build the requested version of "
+ echo "*** linux, remove the file: linux/.xenomai-prepared."
+ fi
+ else
+ set -e
+ if test -e linux; then
+ test -e linux/.config && mv linux/.config .xenomai.config
+ rm -Rf linux
+ fi
+ mkdir linux
+ echo $ECHO_N "Making linux a shadow copy of $XENO_LINUX_SRCDIR... $ECHO_C"
+ targetdir=$PWD/linux
+ cd $XENO_LINUX_SRCDIR
+ find . -! -type d | while read f; do
+ d=$targetdir/`dirname $f`
+ mkdir -p $d && ln -sf $XENO_LINUX_SRCDIR/$f $d/`basename $f`
+ done
+ echo "${ECHO_T}done."
+ cd $targetdir
+
+ if test -e $XENO_LINUX_SRCDIR/.config; then
+ . $XENO_LINUX_SRCDIR/.config
+ test x"$CONFIG_X86" = xy && cfg_arch=i386 || :
+ test x"$CONFIG_PPC" = xy && cfg_arch=ppc || :
+ test x"$CONFIG_IA64" = xy && cfg_arch=ia64 || :
+ test x"$CONFIG_PPC64" = xy && cfg_arch=ppc64 || :
+ if test $cfg_arch = $XENO_TARGET_ARCH; then
+ cp $LINUX_SRCDIR/.config .config
+ cp $LINUX_SRCDIR/.config .xenomai.config
+ fi
+ make ARCH=$cfg_arch distclean
+ test -e .xenomai.config && mv .xenomai.config .config
+ fi
+ cd ..
+ $srcdir/scripts/prepare-kernel.sh \
+ --adeos="$ADEOS_PATCH" --linux=linux --arch=$XENO_TARGET_ARCH
+ test -e .xenomai.config && mv .xenomai.config linux/.config || :
+ echo "PREPARED_LINUX_SRCDIR=$XENO_LINUX_SRCDIR" > linux/.xenomai-prepared.tmp
+ echo "PREPARED_ADEOS_PATCH=$ADEOS_PATCH" >> linux/.xenomai-prepared.tmp
+ mv linux/.xenomai-prepared.tmp linux/.xenomai-prepared
+ fi
+ ],[XENO_LINUX_SRCDIR=$XENO_LINUX_SRCDIR
+ XENO_TARGET_ARCH=$XENO_TARGET_ARCH
+ ADEOS_PATCH=$ADEOS_PATCH])
+fi
+
+
+dnl Catch sub-package flags
+
+AC_MSG_CHECKING(for simulator)
+AC_ARG_ENABLE(sim,
+ AS_HELP_STRING([--enable-sim], [Build simulator]),
+ [case "$enableval" in
+ y | yes) CONFIG_XENO_MVM=y ;;
+ *) unset CONFIG_XENO_MVM ;;
+ esac])
+
+unset XENO_MAYBE_SIMDIR
+if test \! -d $srcdir/sim; then
+ if test x$CONFIG_XENO_MVM = xy; then
+ AC_MSG_ERROR([simulator is missing.])
+ fi
+ AC_MSG_RESULT([not present])
+else
+ if test x$CONFIG_XENO_MVM = xy; then
+ export CONFIG_XENO_MVM_DEBUG
+ export CONFIG_XENO_MVM_GCC_TARBALL
+ export CONFIG_XENO_MVM_ATOMIC_CORE
+ export CONFIG_XENO_OPT_DEBUG
+ export CONFIG_XENO_OPT_STATS
+ else
+ XENO_MAYBE_SIMDIR=sim
+ fi
+ AC_MSG_RESULT(${CONFIG_XENO_MVM:-no})
+fi
+if test x$arch_have_sim = x -a x$CONFIG_XENO_MVM = xy; then
+ AC_MSG_ERROR([simulator is not available on this architecture.])
+fi
+AC_SUBST(XENO_MAYBE_SIMDIR)
+
dnl Documentation package.
if test \! -d $srcdir/doc; then
@@ -421,4 +595,8 @@ if test \! x$XENO_MAYBE_DOCDIR = x; then
])
fi
+if test x$CONFIG_XENO_MVM = xy; then
+ AC_CONFIG_SUBDIRS(sim)
+fi
+
AC_OUTPUT()
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-07 11:30 [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree Gilles Chanteperdrix
@ 2006-01-07 18:04 ` Gilles Chanteperdrix
2006-01-07 18:38 ` Jan Kiszka
2006-01-08 12:08 ` Philippe Gerum
1 sibling, 1 reply; 13+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-07 18:04 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 483 bytes --]
Gilles Chanteperdrix wrote:
> Known limitations are:
> (...)
> - for an unknown reason, xenomai modules are built every time
> prepare-kernel.sh is run ;
The reason for this limitation is that prepare-kernel.sh remove
directories before re-creating them and before creating symbolic links.
The previous patch was also incorrect when trying to cross-compile the
Linux kernel or building it for ppc. The attached patch fixes these
issues.
--
Gilles Chanteperdrix.
[-- Attachment #2: xeno-build-kernel.diff --]
[-- Type: application/octet-stream, Size: 10289 bytes --]
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/Makefile.am branches/build-kernel/Makefile.am
--- trunk/Makefile.am 2006-01-04 18:39:12.000000000 +0100
+++ branches/build-kernel/Makefile.am 2006-01-07 16:52:11.000000000 +0100
@@ -2,7 +2,9 @@ ACLOCAL_AMFLAGS=-I config
SUDO=sudo
-SUBDIRS = src include config @XENO_MAYBE_DOCDIR@ scripts
+# Do not include sim subdirectory in source tarball.
+DIST_SUBDIRS = src include config @XENO_MAYBE_DOCDIR@ scripts
+SUBDIRS = $(DIST_SUBDIRS) $(subdirs)
EXTRA_DIST = CREDITS README.INSTALL TROUBLESHOOTING ksrc
@@ -51,3 +53,46 @@ install-exec-local: devices
install-nodev:
$(MAKE) SUDO=false install
+
+if XENO_BUILD_LINUX
+linux/%: linux/.xenomai-prepared
+ $(top_srcdir)/scripts/prepare-kernel.sh \
+ --adeos="$(ADEOS_PATCH)" --linux=linux \
+ --arch=$(XENO_LINUX_ARCH) && \
+ cross=`expr $(CC) : '\(.*\)gcc' || :` && \
+ cd linux && $(MAKE) $* \
+ ARCH=$(XENO_LINUX_ARCH) \
+ CROSS_COMPILE=$$cross
+
+linux/.xenomai-prepared: config.status
+ ./config.status linux
+
+linux/install: linux/all
+ @sudo=; if test x`id -u` != x0 && test \! "x`type $(SUDO)`" = x; then \
+ sudo=$(SUDO); fi && \
+ cross=`expr $(CC) : '\(.*\)gcc' || :` && \
+ $$sudo $(mkinstalldirs) $(DESTDIR)/boot && \
+ cd linux && $$sudo $(MAKE) modules_install install \
+ ARCH=$(XENO_LINUX_ARCH) \
+ CROSS_COMPILE=$$cross \
+ INSTALL_PATH=$(DESTDIR)/boot \
+ INSTALL_MOD_PATH=$(DESTDIR)
+
+distclean-linux:
+ @test -e linux/.config && \
+ mv linux/.config linux/.config.saved.xenomai; \
+ $(MAKE) linux/distclean; \
+ test -e linux/.config.saved.xenomai && \
+ mv linux/.config.saved.xenomai linux/.config
+
+config oldconfig mconfig menuconfig gconfig xconfig:
+ $(MAKE) linux/$@
+
+all-recursive: linux/all
+
+clean-recursive: linux/clean
+
+distclean-recursive: distclean-linux
+
+install-recursive: linux/install
+endif
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/configure.in branches/build-kernel/configure.in
--- trunk/configure.in 2006-01-07 11:46:12.000000000 +0100
+++ branches/build-kernel/configure.in 2006-01-07 16:51:24.000000000 +0100
@@ -48,18 +48,27 @@ AC_MSG_CHECKING([for target architecture
case "$host" in
i*86*-*)
XENO_TARGET_ARCH=i386
+ XENO_LINUX_ARCH=i386
+ arch_have_sim=y
;;
powerpc-*|ppc-*)
XENO_TARGET_ARCH=powerpc
+ XENO_LINUX_ARCH=ppc
+ arch_have_sim=y
;;
powerpc64-*|ppc64-*)
XENO_TARGET_ARCH=powerpc
+ XENO_LINUX_ARCH=ppc64
+ arch_have_sim=y
;;
ia64-*)
XENO_TARGET_ARCH=ia64
+ XENO_LINUX_ARCH=ia64
+ arch_have_sim=y
;;
bfin-*|bfinnommu-*|blackfin-*)
XENO_TARGET_ARCH=blackfin
+ XENO_LINUX_ARCH=bfinnommu
if test x$enable_shared = xyes; then
AC_MSG_ERROR([Shared libraries unsupported -- reconfigure passing --disable-shared])
fi
@@ -150,6 +159,178 @@ if test $XENO_TARGET_ARCH = i386; then
AC_MSG_RESULT(${CONFIG_X86_TSC:-no})
fi
+dnl Flags for building Linux in Xenomai build tree.
+AC_MSG_CHECKING(whether building Linux in Xenomai build tree)
+AC_ARG_ENABLE(linux-build,
+ AS_HELP_STRING([--enable-linux-build], [Build Linux in Xenomai build tree]),
+ [case "$enableval" in
+ y | yes) XENO_BUILD_LINUX=y ;;
+ *) unset XENO_BUILD_LINUX ;;
+ esac])
+AC_MSG_RESULT(${XENO_BUILD_LINUX:-no})
+AM_CONDITIONAL(XENO_BUILD_LINUX, [test x"$XENO_BUILD_LINUX" = xy])
+
+if test x"$XENO_BUILD_LINUX" = xy; then
+ AC_MSG_CHECKING(for Linux sources)
+ unset XENO_LINUX_SRCDIR
+ AC_ARG_WITH(linux-srcdir,
+ AS_HELP_STRING([--with-linux-srcdir],[specify the path to Linux
+sources. Default is to use, if not cross-compiling, the sources of the running
+kernel or /usr/src/linux.]),
+ [XENO_LINUX_SRCDIR="`/bin/bash -c \"echo $withval\"`"])
+ if test x"$XENO_LINUX_SRCDIR" = x && test x"$cross_compiling" = xno; then
+ XENO_LINUX_SRCDIR=/lib/modules/`uname -r`/source
+ if test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ XENO_LINUX_SRCDIR=/usr/src/linux
+ fi
+ fi
+ if test x"$XENO_LINUX_SRCDIR" = x || test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset XENO_LINUX_SRCDIR
+ else
+ AC_MSG_ERROR([Unable to find Linux kernel sources tree, please use --with-linux-srcdir])
+ fi
+ fi
+
+ if test x"$XENO_LINUX_SRCDIR" != x; then
+ unset linux_EXTRAVERSION
+ unset linux_PATCHLEVEL
+ unset linux_SUBLEVEL
+ unset linux_VERSION
+
+ eval linux_`grep '^EXTRAVERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^PATCHLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^SUBLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^VERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+
+ linux_base_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL"
+ linux_full_version="$linux_base_version$linux_EXTRAVERSION"
+
+ if test x"$linux_PATCHLEVEL" = x -o x"$linux_SUBLEVEL" = x ||
+ test x"$linux_VERSION" = x; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(Unknown version)
+ unset linux_base_version
+ else
+ AC_MSG_ERROR([Unable to get version of $XENO_LINUX_SRCDIR, aborting.])
+ fi
+ else
+ AC_MSG_RESULT([$XENO_LINUX_SRCDIR (kernel ${linux_full_version})])
+ fi
+ fi
+
+ AC_MSG_CHECKING(for Adeos patch)
+ unset ADEOS_PATCH
+ AC_ARG_WITH(adeos-patch,
+ AS_HELP_STRING([--with-adeos-patch],[specify the path to the Adeos
+patch. Default is to infer the patch name from Linux kernel version.]),
+ [ADEOS_PATCH="`/bin/bash -c \"echo $withval\"`"])
+
+ if test x"$ADEOS_PATCH" = x && test x"$linux_base_version" != x; then
+ set -- $srcdir/ksrc/arch/$XENO_TARGET_ARCH/patches/adeos-*$linux_base_version*
+ ADEOS_PATCH=$1
+ fi
+ if test x"$ADEOS_PATCH" = x || test ! -e $ADEOS_PATCH; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset ADEOS_PATCH
+ else
+ AC_MSG_ERROR([Unable to find Adeos patch, please use --with-adeos-patch])
+ fi
+ else
+ AC_MSG_RESULT([$ADEOS_PATCH])
+ fi
+ AC_SUBST(ADEOS_PATCH)
+
+ AC_CONFIG_COMMANDS(linux, [
+ if test -e linux/.xenomai-prepared; then
+ . linux/.xenomai-prepared
+ if test x"$XENO_LINUX_SRCDIR" != x"$PREPARED_LINUX_SRCDIR" ||
+ test x"$ADEOS_PATCH" != x"$PREPARED_ADEOS_PATCH"; then
+ echo "*** Warning: built version of linux and requested versions are "
+ echo "*** different. If you want to build the requested version of "
+ echo "*** linux, remove the file: linux/.xenomai-prepared."
+ fi
+ touch linux/.xenomai-prepared
+ else
+ set -e
+ if test -e linux; then
+ test -e linux/.config && mv linux/.config .xenomai.config
+ rm -Rf linux
+ fi
+ mkdir linux
+ echo $ECHO_N "Making linux a shadow copy of $XENO_LINUX_SRCDIR... $ECHO_C"
+ targetdir=$PWD/linux
+ cd $XENO_LINUX_SRCDIR
+ find . -! -type d | while read f; do
+ d=$targetdir/`dirname $f`
+ mkdir -p $d && ln -sf $XENO_LINUX_SRCDIR/$f $d/`basename $f`
+ done
+ echo "${ECHO_T}done."
+ cd $targetdir
+
+ if test -e $XENO_LINUX_SRCDIR/.config; then
+ . $XENO_LINUX_SRCDIR/.config
+ test x"$CONFIG_X86" = xy && cfg_arch=i386 || :
+ test x"$CONFIG_PPC" = xy && cfg_arch=ppc || :
+ test x"$CONFIG_IA64" = xy && cfg_arch=ia64 || :
+ test x"$CONFIG_PPC64" = xy && cfg_arch=ppc64 || :
+ if test $cfg_arch = $XENO_TARGET_ARCH; then
+ cp $LINUX_SRCDIR/.config .config
+ cp $LINUX_SRCDIR/.config .xenomai.config
+ fi
+ make ARCH=$cfg_arch distclean
+ test -e .xenomai.config && mv .xenomai.config .config
+ fi
+ cd ..
+ $srcdir/scripts/prepare-kernel.sh \
+ --adeos="$ADEOS_PATCH" --linux=linux --arch=$XENO_LINUX_ARCH
+ test -e .xenomai.config && mv .xenomai.config linux/.config || :
+ echo "PREPARED_LINUX_SRCDIR=$XENO_LINUX_SRCDIR" > linux/.xenomai-prepared.tmp
+ echo "PREPARED_ADEOS_PATCH=$ADEOS_PATCH" >> linux/.xenomai-prepared.tmp
+ mv linux/.xenomai-prepared.tmp linux/.xenomai-prepared
+ fi
+ ],[XENO_LINUX_SRCDIR=$XENO_LINUX_SRCDIR
+ XENO_TARGET_ARCH=$XENO_TARGET_ARCH
+ XENO_LINUX_ARCH=$XENO_LINUX_ARCH
+ ADEOS_PATCH=$ADEOS_PATCH])
+fi
+
+
+dnl Catch sub-package flags
+
+AC_MSG_CHECKING(for simulator)
+AC_ARG_ENABLE(sim,
+ AS_HELP_STRING([--enable-sim], [Build simulator]),
+ [case "$enableval" in
+ y | yes) CONFIG_XENO_MVM=y ;;
+ *) unset CONFIG_XENO_MVM ;;
+ esac])
+
+unset XENO_MAYBE_SIMDIR
+if test \! -d $srcdir/sim; then
+ if test x$CONFIG_XENO_MVM = xy; then
+ AC_MSG_ERROR([simulator is missing.])
+ fi
+ AC_MSG_RESULT([not present])
+else
+ if test x$CONFIG_XENO_MVM = xy; then
+ export CONFIG_XENO_MVM_DEBUG
+ export CONFIG_XENO_MVM_GCC_TARBALL
+ export CONFIG_XENO_MVM_ATOMIC_CORE
+ export CONFIG_XENO_OPT_DEBUG
+ export CONFIG_XENO_OPT_STATS
+ else
+ XENO_MAYBE_SIMDIR=sim
+ fi
+ AC_MSG_RESULT(${CONFIG_XENO_MVM:-no})
+fi
+if test x$arch_have_sim = x -a x$CONFIG_XENO_MVM = xy; then
+ AC_MSG_ERROR([simulator is not available on this architecture.])
+fi
+AC_SUBST(XENO_MAYBE_SIMDIR)
+
dnl Documentation package.
if test \! -d $srcdir/doc; then
@@ -339,6 +520,7 @@ AC_SUBST(LATEX_BATCHMODE)
AC_SUBST(LATEX_MODE)
AC_SUBST(XENO_TARGET_ARCH)
+AC_SUBST(XENO_LINUX_ARCH)
AC_SUBST(XENO_BUILD_STRING)
AC_SUBST(XENO_HOST_STRING)
AC_SUBST(XENO_USER_CFLAGS)
@@ -421,4 +603,8 @@ if test \! x$XENO_MAYBE_DOCDIR = x; then
])
fi
+if test x$CONFIG_XENO_MVM = xy; then
+ AC_CONFIG_SUBDIRS(sim)
+fi
+
AC_OUTPUT()
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-07 18:04 ` Gilles Chanteperdrix
@ 2006-01-07 18:38 ` Jan Kiszka
2006-01-07 19:32 ` Gilles Chanteperdrix
0 siblings, 1 reply; 13+ messages in thread
From: Jan Kiszka @ 2006-01-07 18:38 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]
Gilles Chanteperdrix wrote:
> Gilles Chanteperdrix wrote:
> > Known limitations are:
> > (...)
> > - for an unknown reason, xenomai modules are built every time
> > prepare-kernel.sh is run ;
>
> The reason for this limitation is that prepare-kernel.sh remove
> directories before re-creating them and before creating symbolic links.
>
At this chance, something from my private whish list: :)
"unprepare-kernel.sh" or so, i.e. turning the kernel in its original
vanilla state again.
This is helpful when applying/reversing third-party kernel patches which
also touch the modified Makefiles. I think on some 2.4 kernel, even
reverting ipipe collides with the xeno-preparation.
> The previous patch was also incorrect when trying to cross-compile the
> Linux kernel or building it for ppc. The attached patch fixes these
> issues.
>
Regarding your general idea, I'm just trying to imagine the new build
process: you prepare and build the kernel + the userspace stuff again in
one step?. But you still have to configure both parts separately.
The question for me is now if this simplifies the situation expecially
for beginners. So far, the separation was clearly visible, now it /may/
become blurred (but I'm not a beginner...).
Can you provide a rough comparision of the workflows? Sorry, but I'm too
lazy, I mean busy to give it a try.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-07 18:38 ` Jan Kiszka
@ 2006-01-07 19:32 ` Gilles Chanteperdrix
2006-01-07 19:58 ` Jan Kiszka
0 siblings, 1 reply; 13+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-07 19:32 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
Jan Kiszka wrote:
> > The previous patch was also incorrect when trying to cross-compile the
> > Linux kernel or building it for ppc. The attached patch fixes these
> > issues.
> >
>
> Regarding your general idea, I'm just trying to imagine the new build
> process: you prepare and build the kernel + the userspace stuff again in
> one step?. But you still have to configure both parts separately.
>
> The question for me is now if this simplifies the situation expecially
> for beginners. So far, the separation was clearly visible, now it /may/
> become blurred (but I'm not a beginner...).
>
> Can you provide a rough comparision of the workflows? Sorry, but I'm too
> lazy, I mean busy to give it a try.
configure --enable-linux-build
make xconfig
make install
If you already have a .config file, the "make xconfig" step becomes
optional.
Note that the --enable-linux-build flag is optional too.
The simplification is mainly for developping xenomai itself, not for its
users. Because with the current scheme, after some modifications, you
have to recompile and reinstall both the kernel-space modules and
user-space libraries.
If you let configure select the proper adeos patch, you are warned when
the adeos patch changed in the source directory (after an svn update,
for example), and just have to type:
rm linux/.xenomai-prepared (Ok, this step is a bit awkward, we may find
something better)
make install
And a new kernel will be built and installed, using the new adeos patch
and the same .config.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-07 19:32 ` Gilles Chanteperdrix
@ 2006-01-07 19:58 ` Jan Kiszka
2006-01-07 21:24 ` Gilles Chanteperdrix
0 siblings, 1 reply; 13+ messages in thread
From: Jan Kiszka @ 2006-01-07 19:58 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]
Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
> > > The previous patch was also incorrect when trying to cross-compile the
> > > Linux kernel or building it for ppc. The attached patch fixes these
> > > issues.
> > >
> >
> > Regarding your general idea, I'm just trying to imagine the new build
> > process: you prepare and build the kernel + the userspace stuff again in
> > one step?. But you still have to configure both parts separately.
> >
> > The question for me is now if this simplifies the situation expecially
> > for beginners. So far, the separation was clearly visible, now it /may/
> > become blurred (but I'm not a beginner...).
> >
> > Can you provide a rough comparision of the workflows? Sorry, but I'm too
> > lazy, I mean busy to give it a try.
>
> configure --enable-linux-build
> make xconfig
> make install
>
I'm starting to like this!
> If you already have a .config file, the "make xconfig" step becomes
> optional.
>
> Note that the --enable-linux-build flag is optional too.
>
> The simplification is mainly for developping xenomai itself, not for its
> users. Because with the current scheme, after some modifications, you
> have to recompile and reinstall both the kernel-space modules and
> user-space libraries.
>
> If you let configure select the proper adeos patch, you are warned when
> the adeos patch changed in the source directory (after an svn update,
> for example), and just have to type:
> rm linux/.xenomai-prepared (Ok, this step is a bit awkward, we may find
> something better)
> make install
>
> And a new kernel will be built and installed, using the new adeos patch
> and the same .config.
>
Hmm, what about this: Instead of leaving some (probably empty)
xenomai-prepared in the kernel tree, better create an xenomai-uninstall
script in the same place. It a) can serve as an indication for a
prepared kernel and b) can be used to upgrade that tree by first running
it and then applying the usual steps on the kernel again.
I often forget to save my old adeos patch before updating the xenomai
tree, thus I will then have to download the old patch again,
reverse-apply it, and can finally run the prepare script for the update.
Automating this would be REALLY, REALLY GREAT!
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-07 19:58 ` Jan Kiszka
@ 2006-01-07 21:24 ` Gilles Chanteperdrix
0 siblings, 0 replies; 13+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-07 21:24 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
Jan Kiszka wrote:
> > If you let configure select the proper adeos patch, you are warned when
> > the adeos patch changed in the source directory (after an svn update,
> > for example), and just have to type:
> > rm linux/.xenomai-prepared (Ok, this step is a bit awkward, we may find
> > something better)
> > make install
> >
> > And a new kernel will be built and installed, using the new adeos patch
> > and the same .config.
> >
>
> Hmm, what about this: Instead of leaving some (probably empty)
> xenomai-prepared in the kernel tree, better create an xenomai-uninstall
> script in the same place. It a) can serve as an indication for a
> prepared kernel and b) can be used to upgrade that tree by first running
> it and then applying the usual steps on the kernel again.
>
> I often forget to save my old adeos patch before updating the xenomai
> tree, thus I will then have to download the old patch again,
> reverse-apply it, and can finally run the prepare script for the update.
> Automating this would be REALLY, REALLY GREAT!
The current approach try and achieve a similar goal by first copying (it
is not a real copy, only symbolic links to the source tree, a bit like
lndir would do) an unpatched kernel in Xenomai build tree, and preparing
it there. This way, when compilation with a new patch is needed, there
is no need to "unprepare" the kernel, only erase, copy again and prepare
the fresh copy, using the new patch. And that is what the current patch
automates.
unpreparing seems harder.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-07 11:30 [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree Gilles Chanteperdrix
2006-01-07 18:04 ` Gilles Chanteperdrix
@ 2006-01-08 12:08 ` Philippe Gerum
2006-01-08 13:08 ` Gilles Chanteperdrix
1 sibling, 1 reply; 13+ messages in thread
From: Philippe Gerum @ 2006-01-08 12:08 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
Gilles Chanteperdrix wrote:
> Hi,
>
> attached is a patch of Xenomai trunk build system to allow building
> Linux kernel as part of Xenomai build process. This way, typing make
> install builds and installs the Linux kernel, kernel modules and
> Xenomai.
>
> The patch is a bit young and still has a few drawbacks, but before
> spending to much time on it, I would like to know if anyone is opposed
> to the idea of building Linux in Xenomai build tree.
>
> To try this patch, apply and run the bootstrap script.
> 3 options are then added to configure :
> --enable-linux-build Build Linux in Xenomai build tree
> --with-linux-srcdir specify the path to Linux sources. Default is to
> use, if not cross-compiling, the source of the
> running kernel or /usr/src/linux.
--enable-linux-build=<linux-tree> ?
> --with-adeos-patch specify the path to the Adeos patch. Default is to
> infer the patch name from Linux kernel version.
>
> When using the --enable-linux-build option, configure creates a linux
> tree in Xenomai build tree, and run the prepare-kernel.sh script for
> this tree. Typing "make" re-runs prepare-kernel.sh (in case some changes
> occured in Xenomai sources) and run make in the kernel tree.
>
> Known limitations are:
> - it is not very well tested, so, maybe some error cases are not handled
> correctly ;
> - it is not tested with Linux 2.4 ;
> - for an unknown reason, xenomai modules are built every time
> prepare-kernel.sh is run ;
> - the cross-compilation prefix is inferred from the CC variable, it
> should work in most situations, but not all.
>
> Happy new year.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-08 12:08 ` Philippe Gerum
@ 2006-01-08 13:08 ` Gilles Chanteperdrix
2006-01-08 14:17 ` Philippe Gerum
0 siblings, 1 reply; 13+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-08 13:08 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
Philippe Gerum wrote:
> Gilles Chanteperdrix wrote:
> > Hi,
> >
> > attached is a patch of Xenomai trunk build system to allow building
> > Linux kernel as part of Xenomai build process. This way, typing make
> > install builds and installs the Linux kernel, kernel modules and
> > Xenomai.
> >
> > The patch is a bit young and still has a few drawbacks, but before
> > spending to much time on it, I would like to know if anyone is opposed
> > to the idea of building Linux in Xenomai build tree.
> >
> > To try this patch, apply and run the bootstrap script.
> > 3 options are then added to configure :
> > --enable-linux-build Build Linux in Xenomai build tree
> > --with-linux-srcdir specify the path to Linux sources. Default is to
> > use, if not cross-compiling, the source of the
> > running kernel or /usr/src/linux.
>
> --enable-linux-build=<linux-tree> ?
The current approach is to use the sources of the running kernel if the
only option specified is --enable-linux-build. Do you mean you find this
feature superfluous ?
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-08 13:08 ` Gilles Chanteperdrix
@ 2006-01-08 14:17 ` Philippe Gerum
2006-01-08 16:55 ` Gilles Chanteperdrix
0 siblings, 1 reply; 13+ messages in thread
From: Philippe Gerum @ 2006-01-08 14:17 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
Gilles Chanteperdrix wrote:
> Philippe Gerum wrote:
> > Gilles Chanteperdrix wrote:
> > > Hi,
> > >
> > > attached is a patch of Xenomai trunk build system to allow building
> > > Linux kernel as part of Xenomai build process. This way, typing make
> > > install builds and installs the Linux kernel, kernel modules and
> > > Xenomai.
> > >
> > > The patch is a bit young and still has a few drawbacks, but before
> > > spending to much time on it, I would like to know if anyone is opposed
> > > to the idea of building Linux in Xenomai build tree.
> > >
> > > To try this patch, apply and run the bootstrap script.
> > > 3 options are then added to configure :
> > > --enable-linux-build Build Linux in Xenomai build tree
> > > --with-linux-srcdir specify the path to Linux sources. Default is to
> > > use, if not cross-compiling, the source of the
> > > running kernel or /usr/src/linux.
> >
> > --enable-linux-build=<linux-tree> ?
>
> The current approach is to use the sources of the running kernel if the
> only option specified is --enable-linux-build. Do you mean you find this
> feature superfluous ?
>
If $enableval is "y", then no path has been specified, so you can
default to the running kernel in such a case.
--
Philippe.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-08 14:17 ` Philippe Gerum
@ 2006-01-08 16:55 ` Gilles Chanteperdrix
2006-01-08 19:23 ` Philippe Gerum
0 siblings, 1 reply; 13+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-08 16:55 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 673 bytes --]
Philippe Gerum wrote:
> Gilles Chanteperdrix wrote:
> > The current approach is to use the sources of the running kernel if the
> > only option specified is --enable-linux-build. Do you mean you find this
> > feature superfluous ?
> >
>
> If $enableval is "y", then no path has been specified, so you can
> default to the running kernel in such a case.
Here is a third version of the patch, where :
* the --enable-sim option is removed
* the --with-linux-srcdir option is removed
* the CC variable is passed to kernel build system
* prepare-kernel.sh no longer removes target directories before
creating symbolic links.
--
Gilles Chanteperdrix.
[-- Attachment #2: xeno-build-kernel.3.diff --]
[-- Type: application/octet-stream, Size: 10055 bytes --]
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/Makefile.am branches/build-kernel/Makefile.am
--- trunk/Makefile.am 2006-01-04 18:39:12.000000000 +0100
+++ branches/build-kernel/Makefile.am 2006-01-08 17:46:23.000000000 +0100
@@ -51,3 +51,44 @@ install-exec-local: devices
install-nodev:
$(MAKE) SUDO=false install
+
+if XENO_BUILD_LINUX
+linux/%: linux/.xenomai-prepared
+ $(top_srcdir)/scripts/prepare-kernel.sh \
+ --adeos="$(ADEOS_PATCH)" --linux=linux \
+ --arch=$(XENO_LINUX_ARCH) && \
+ cross=`expr $(CC) : '\(.*\)gcc' || :` && \
+ cd linux && $(MAKE) $* \
+ ARCH=$(XENO_LINUX_ARCH) CC=$(CC) CROSS_COMPILE=$$cross
+
+linux/.xenomai-prepared: config.status
+ ./config.status linux
+
+linux/install: linux/all
+ @sudo=; if test x`id -u` != x0 && test \! "x`type $(SUDO)`" = x; then \
+ sudo=$(SUDO); fi && \
+ cross=`expr $(CC) : '\(.*\)gcc' || :` && \
+ $$sudo $(mkinstalldirs) $(DESTDIR)/boot && \
+ cd linux && $$sudo $(MAKE) modules_install install \
+ ARCH=$(XENO_LINUX_ARCH) CC=$(CC) CROSS_COMPILE=$$cross \
+ INSTALL_PATH=$(DESTDIR)/boot \
+ INSTALL_MOD_PATH=$(DESTDIR)
+
+distclean-linux:
+ @test -e linux/.config && \
+ mv linux/.config linux/.config.saved.xenomai; \
+ $(MAKE) linux/distclean; \
+ test -e linux/.config.saved.xenomai && \
+ mv linux/.config.saved.xenomai linux/.config
+
+config oldconfig mconfig menuconfig gconfig xconfig:
+ $(MAKE) linux/$@
+
+all-recursive: linux/all
+
+clean-recursive: linux/clean
+
+distclean-recursive: distclean-linux
+
+install-recursive: linux/install
+endif
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/configure.in branches/build-kernel/configure.in
--- trunk/configure.in 2006-01-07 11:46:12.000000000 +0100
+++ branches/build-kernel/configure.in 2006-01-08 17:48:54.000000000 +0100
@@ -48,18 +48,27 @@ AC_MSG_CHECKING([for target architecture
case "$host" in
i*86*-*)
XENO_TARGET_ARCH=i386
+ XENO_LINUX_ARCH=i386
+ arch_have_sim=y
;;
powerpc-*|ppc-*)
XENO_TARGET_ARCH=powerpc
+ XENO_LINUX_ARCH=ppc
+ arch_have_sim=y
;;
powerpc64-*|ppc64-*)
XENO_TARGET_ARCH=powerpc
+ XENO_LINUX_ARCH=ppc64
+ arch_have_sim=y
;;
ia64-*)
XENO_TARGET_ARCH=ia64
+ XENO_LINUX_ARCH=ia64
+ arch_have_sim=y
;;
bfin-*|bfinnommu-*|blackfin-*)
XENO_TARGET_ARCH=blackfin
+ XENO_LINUX_ARCH=bfinnommu
if test x$enable_shared = xyes; then
AC_MSG_ERROR([Shared libraries unsupported -- reconfigure passing --disable-shared])
fi
@@ -150,6 +159,152 @@ if test $XENO_TARGET_ARCH = i386; then
AC_MSG_RESULT(${CONFIG_X86_TSC:-no})
fi
+dnl Flags for building Linux in Xenomai build tree.
+AC_MSG_CHECKING(whether building Linux in Xenomai build tree)
+AC_ARG_ENABLE(linux-build,
+ AS_HELP_STRING([--enable-linux-build=<linux-src-dir>], [Build Linux in
+Xenomai build tree, copying sources in <linux-src-dir>. If no source directory
+is passed, use, if not cross-compiling, the sources of the running kernel or
+/usr/src/linux.]),
+ [case "$enableval" in
+ y | yes) XENO_LINUX_SRCDIR=y ;;
+ n | no) unset XENO_LINUX_SRCDIR ;;
+ *) XENO_LINUX_SRCDIR="`/bin/bash -c \"echo $enableval\"`";;
+ esac])
+
+if test x"$XENO_LINUX_SRCDIR" = x; then
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING(for Linux sources)
+ if test x"$XENO_LINUX_SRCDIR" = xy && test x"$cross_compiling" = xno; then
+ XENO_LINUX_SRCDIR=/lib/modules/`uname -r`/source
+ if test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ XENO_LINUX_SRCDIR=/usr/src/linux
+ fi
+ fi
+ if test x"$XENO_LINUX_SRCDIR" = xy || test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset XENO_LINUX_SRCDIR
+ else
+ AC_MSG_ERROR([Unable to find Linux kernel sources tree, please pass a valid Linux sources directory to --enable-linux-build])
+ fi
+ fi
+
+ if test x"$XENO_LINUX_SRCDIR" != x; then
+ unset linux_EXTRAVERSION
+ unset linux_PATCHLEVEL
+ unset linux_SUBLEVEL
+ unset linux_VERSION
+
+ eval linux_`grep '^EXTRAVERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^PATCHLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^SUBLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^VERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+
+ linux_base_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL"
+ linux_full_version="$linux_base_version$linux_EXTRAVERSION"
+
+ if test x"$linux_PATCHLEVEL" = x -o x"$linux_SUBLEVEL" = x ||
+ test x"$linux_VERSION" = x; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(Unknown version)
+ unset linux_base_version
+ else
+ AC_MSG_ERROR([Unable to get version of $XENO_LINUX_SRCDIR, aborting.])
+ fi
+ else
+ AC_MSG_RESULT([$XENO_LINUX_SRCDIR (kernel ${linux_full_version})])
+ fi
+ fi
+
+ AC_MSG_CHECKING(for Adeos patch)
+ unset ADEOS_PATCH
+ AC_ARG_WITH(adeos-patch,
+ AS_HELP_STRING([--with-adeos-patch],[specify the path to the Adeos
+patch. Default is to infer the patch name from Linux kernel version.]),
+ [ADEOS_PATCH="`/bin/bash -c \"echo $withval\"`"])
+
+ if test x"$ADEOS_PATCH" = x && test x"$linux_base_version" != x; then
+ set -- $srcdir/ksrc/arch/$XENO_TARGET_ARCH/patches/adeos-*$linux_base_version-$XENO_LINUX_ARCH-*
+ ADEOS_PATCH=$1
+ fi
+ if test x"$ADEOS_PATCH" = x || test ! -e $ADEOS_PATCH; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset ADEOS_PATCH
+ else
+ AC_MSG_ERROR([Unable to find Adeos patch, please use --with-adeos-patch])
+ fi
+ else
+ AC_MSG_RESULT([$ADEOS_PATCH])
+ fi
+ AC_SUBST(ADEOS_PATCH)
+
+ AC_CONFIG_COMMANDS(linux, [
+ if test -e linux/.xenomai-prepared; then
+ . linux/.xenomai-prepared
+ if test x"$XENO_LINUX_VERSION" != x"$PREPARED_LINUX_VERSION" ||
+ test x"`basename $ADEOS_PATCH`" != x"$PREPARED_ADEOS_PATCH"; then
+ echo "*** Warning: built version of linux and requested versions are "
+ echo "*** different. If you want to build the requested version of "
+ echo "*** linux, remove the file: linux/.xenomai-prepared."
+ fi
+ touch linux/.xenomai-prepared
+ else
+ set -e
+ targetdir=$PWD/linux
+ if test \! -e linux || test \! $XENO_LINUX_SRCDIR -ef linux; then
+ if test -e linux; then
+ test -e linux/.config && mv linux/.config .xenomai.config
+ echo $ECHO_N "Removing existing linux directory... $ECHO_C"
+ rm -Rf linux
+ echo "${ECHO_T}done."
+ fi
+ mkdir linux
+ echo $ECHO_N "Making linux a shadow copy of $XENO_LINUX_SRCDIR... $ECHO_C"
+ cd $XENO_LINUX_SRCDIR
+ find . -! -type d | while read f; do
+ d=$targetdir/`dirname $f`
+ mkdir -p $d && ln -sf $XENO_LINUX_SRCDIR/$f $d/`basename $f`
+ done
+ echo "${ECHO_T}done."
+ fi
+ cd $targetdir
+
+ if test -e $XENO_LINUX_SRCDIR/.config; then
+ . $XENO_LINUX_SRCDIR/.config
+ test x"$CONFIG_X86" = xy && cfg_arch=i386 || :
+ test x"$CONFIG_PPC" = xy && cfg_arch=ppc || :
+ test x"$CONFIG_IA64" = xy && cfg_arch=ia64 || :
+ test x"$CONFIG_PPC64" = xy && cfg_arch=ppc64 || :
+ if test $cfg_arch = $XENO_TARGET_ARCH; then
+ cp $XENO_LINUX_SRCDIR/.config .xenomai.config
+ fi
+ echo "Cleaning linux directory..."
+ make ARCH=$cfg_arch distclean
+ test -e .xenomai.config && mv .xenomai.config .config
+ fi
+ cd ..
+ $srcdir/scripts/prepare-kernel.sh \
+ --adeos="$ADEOS_PATCH" --linux=linux --arch=$XENO_LINUX_ARCH
+ test -e .xenomai.config && mv .xenomai.config linux/.config || :
+ cat > linux/.xenomai-prepared.tmp <<EOF
+PREPARED_LINUX_VERSION=$XENO_LINUX_VERSION
+PREPARED_ADEOS_PATCH=`basename $ADEOS_PATCH`
+EOF
+ mv linux/.xenomai-prepared.tmp linux/.xenomai-prepared
+ fi
+ ],[XENO_LINUX_SRCDIR=$XENO_LINUX_SRCDIR
+ XENO_TARGET_ARCH=$XENO_TARGET_ARCH
+ XENO_LINUX_ARCH=$XENO_LINUX_ARCH
+ XENO_LINUX_VERSION=$linux_full_version
+ ADEOS_PATCH=$ADEOS_PATCH])
+fi
+AM_CONDITIONAL(XENO_BUILD_LINUX, [test \! x"$XENO_LINUX_SRCDIR" = x])
+
+
dnl Documentation package.
if test \! -d $srcdir/doc; then
@@ -339,6 +494,7 @@ AC_SUBST(LATEX_BATCHMODE)
AC_SUBST(LATEX_MODE)
AC_SUBST(XENO_TARGET_ARCH)
+AC_SUBST(XENO_LINUX_ARCH)
AC_SUBST(XENO_BUILD_STRING)
AC_SUBST(XENO_HOST_STRING)
AC_SUBST(XENO_USER_CFLAGS)
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/scripts/prepare-kernel.sh branches/build-kernel/scripts/prepare-kernel.sh
--- trunk/scripts/prepare-kernel.sh 2006-01-04 13:12:32.000000000 +0100
+++ branches/build-kernel/scripts/prepare-kernel.sh 2006-01-08 16:49:46.000000000 +0100
@@ -2,12 +2,16 @@
set -e
do_links() {
- rm -fr $2
- ( cd $1 &&
+ ( cd $2 &&
+ find . \( -name Makefile -o -name $config_file -o -name '*.[chS]' \) |
+ while read f; do
+ if test ! -e $1/$f; then rm -f $f; fi
+ done &&
+ cd $1 &&
find . \( -name Makefile -o -name $config_file -o -name '*.[chS]' \) |
while read f; do
d=`dirname $f`
- mkdir -p $2/$d && ln -s $1/$f $2/$f
+ mkdir -p $2/$d && ln -sf $1/$f $2/$f
done )
}
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-08 16:55 ` Gilles Chanteperdrix
@ 2006-01-08 19:23 ` Philippe Gerum
2006-01-08 20:22 ` Gilles Chanteperdrix
0 siblings, 1 reply; 13+ messages in thread
From: Philippe Gerum @ 2006-01-08 19:23 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
Gilles Chanteperdrix wrote:
> Philippe Gerum wrote:
> > Gilles Chanteperdrix wrote:
> > > The current approach is to use the sources of the running kernel if the
> > > only option specified is --enable-linux-build. Do you mean you find this
> > > feature superfluous ?
> > >
> >
> > If $enableval is "y", then no path has been specified, so you can
> > default to the running kernel in such a case.
>
> Here is a third version of the patch, where :
> * the --enable-sim option is removed
> * the --with-linux-srcdir option is removed
> * the CC variable is passed to kernel build system
> * prepare-kernel.sh no longer removes target directories before
> creating symbolic links.
>
>
This is needed for creating links in a new kernel for the fist time:
--- scripts/prepare-kernel.sh~ 2006-01-08 20:14:05.000000000 +0100
+++ scripts/prepare-kernel.sh 2006-01-08 20:19:41.000000000 +0100
@@ -2,11 +2,12 @@
set -e
do_links() {
- ( cd $2 &&
+ ( if test -x $2; then
+ cd $2 &&
find . \( -name Makefile -o -name $config_file -o -name '*.[chS]' \) |
while read f; do
if test ! -e $1/$f; then rm -f $f; fi
- done &&
+ done; else true; fi &&
cd $1 &&
find . \( -name Makefile -o -name $config_file -o -name '*.[chS]' \) |
while read f; do
--
Philippe.
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-08 19:23 ` Philippe Gerum
@ 2006-01-08 20:22 ` Gilles Chanteperdrix
2006-01-08 21:39 ` Philippe Gerum
0 siblings, 1 reply; 13+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-08 20:22 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 926 bytes --]
Philippe Gerum wrote:
> Gilles Chanteperdrix wrote:
> > Philippe Gerum wrote:
> > > Gilles Chanteperdrix wrote:
> > > > The current approach is to use the sources of the running kernel if the
> > > > only option specified is --enable-linux-build. Do you mean you find this
> > > > feature superfluous ?
> > > >
> > >
> > > If $enableval is "y", then no path has been specified, so you can
> > > default to the running kernel in such a case.
> >
> > Here is a third version of the patch, where :
> > * the --enable-sim option is removed
> > * the --with-linux-srcdir option is removed
> > * the CC variable is passed to kernel build system
> > * prepare-kernel.sh no longer removes target directories before
> > creating symbolic links.
> >
> >
>
> This is needed for creating links in a new kernel for the fist time:
Sorry... Here is the 4th patch.
--
Gilles Chanteperdrix.
[-- Attachment #2: xeno-build-kernel.4.diff --]
[-- Type: application/octet-stream, Size: 10097 bytes --]
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/Makefile.am branches/build-kernel/Makefile.am
--- trunk/Makefile.am 2006-01-04 18:39:12.000000000 +0100
+++ branches/build-kernel/Makefile.am 2006-01-08 17:46:23.000000000 +0100
@@ -51,3 +51,44 @@ install-exec-local: devices
install-nodev:
$(MAKE) SUDO=false install
+
+if XENO_BUILD_LINUX
+linux/%: linux/.xenomai-prepared
+ $(top_srcdir)/scripts/prepare-kernel.sh \
+ --adeos="$(ADEOS_PATCH)" --linux=linux \
+ --arch=$(XENO_LINUX_ARCH) && \
+ cross=`expr $(CC) : '\(.*\)gcc' || :` && \
+ cd linux && $(MAKE) $* \
+ ARCH=$(XENO_LINUX_ARCH) CC=$(CC) CROSS_COMPILE=$$cross
+
+linux/.xenomai-prepared: config.status
+ ./config.status linux
+
+linux/install: linux/all
+ @sudo=; if test x`id -u` != x0 && test \! "x`type $(SUDO)`" = x; then \
+ sudo=$(SUDO); fi && \
+ cross=`expr $(CC) : '\(.*\)gcc' || :` && \
+ $$sudo $(mkinstalldirs) $(DESTDIR)/boot && \
+ cd linux && $$sudo $(MAKE) modules_install install \
+ ARCH=$(XENO_LINUX_ARCH) CC=$(CC) CROSS_COMPILE=$$cross \
+ INSTALL_PATH=$(DESTDIR)/boot \
+ INSTALL_MOD_PATH=$(DESTDIR)
+
+distclean-linux:
+ @test -e linux/.config && \
+ mv linux/.config linux/.config.saved.xenomai; \
+ $(MAKE) linux/distclean; \
+ test -e linux/.config.saved.xenomai && \
+ mv linux/.config.saved.xenomai linux/.config
+
+config oldconfig mconfig menuconfig gconfig xconfig:
+ $(MAKE) linux/$@
+
+all-recursive: linux/all
+
+clean-recursive: linux/clean
+
+distclean-recursive: distclean-linux
+
+install-recursive: linux/install
+endif
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/configure.in branches/build-kernel/configure.in
--- trunk/configure.in 2006-01-07 11:46:12.000000000 +0100
+++ branches/build-kernel/configure.in 2006-01-08 17:48:54.000000000 +0100
@@ -48,18 +48,27 @@ AC_MSG_CHECKING([for target architecture
case "$host" in
i*86*-*)
XENO_TARGET_ARCH=i386
+ XENO_LINUX_ARCH=i386
+ arch_have_sim=y
;;
powerpc-*|ppc-*)
XENO_TARGET_ARCH=powerpc
+ XENO_LINUX_ARCH=ppc
+ arch_have_sim=y
;;
powerpc64-*|ppc64-*)
XENO_TARGET_ARCH=powerpc
+ XENO_LINUX_ARCH=ppc64
+ arch_have_sim=y
;;
ia64-*)
XENO_TARGET_ARCH=ia64
+ XENO_LINUX_ARCH=ia64
+ arch_have_sim=y
;;
bfin-*|bfinnommu-*|blackfin-*)
XENO_TARGET_ARCH=blackfin
+ XENO_LINUX_ARCH=bfinnommu
if test x$enable_shared = xyes; then
AC_MSG_ERROR([Shared libraries unsupported -- reconfigure passing --disable-shared])
fi
@@ -150,6 +159,152 @@ if test $XENO_TARGET_ARCH = i386; then
AC_MSG_RESULT(${CONFIG_X86_TSC:-no})
fi
+dnl Flags for building Linux in Xenomai build tree.
+AC_MSG_CHECKING(whether building Linux in Xenomai build tree)
+AC_ARG_ENABLE(linux-build,
+ AS_HELP_STRING([--enable-linux-build=<linux-src-dir>], [Build Linux in
+Xenomai build tree, copying sources in <linux-src-dir>. If no source directory
+is passed, use, if not cross-compiling, the sources of the running kernel or
+/usr/src/linux.]),
+ [case "$enableval" in
+ y | yes) XENO_LINUX_SRCDIR=y ;;
+ n | no) unset XENO_LINUX_SRCDIR ;;
+ *) XENO_LINUX_SRCDIR="`/bin/bash -c \"echo $enableval\"`";;
+ esac])
+
+if test x"$XENO_LINUX_SRCDIR" = x; then
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING(for Linux sources)
+ if test x"$XENO_LINUX_SRCDIR" = xy && test x"$cross_compiling" = xno; then
+ XENO_LINUX_SRCDIR=/lib/modules/`uname -r`/source
+ if test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ XENO_LINUX_SRCDIR=/usr/src/linux
+ fi
+ fi
+ if test x"$XENO_LINUX_SRCDIR" = xy || test ! -r $XENO_LINUX_SRCDIR/Makefile; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset XENO_LINUX_SRCDIR
+ else
+ AC_MSG_ERROR([Unable to find Linux kernel sources tree, please pass a valid Linux sources directory to --enable-linux-build])
+ fi
+ fi
+
+ if test x"$XENO_LINUX_SRCDIR" != x; then
+ unset linux_EXTRAVERSION
+ unset linux_PATCHLEVEL
+ unset linux_SUBLEVEL
+ unset linux_VERSION
+
+ eval linux_`grep '^EXTRAVERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^PATCHLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^SUBLEVEL =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+ eval linux_`grep '^VERSION =' $XENO_LINUX_SRCDIR/Makefile | sed -e 's, ,,g'`
+
+ linux_base_version="$linux_VERSION.$linux_PATCHLEVEL.$linux_SUBLEVEL"
+ linux_full_version="$linux_base_version$linux_EXTRAVERSION"
+
+ if test x"$linux_PATCHLEVEL" = x -o x"$linux_SUBLEVEL" = x ||
+ test x"$linux_VERSION" = x; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(Unknown version)
+ unset linux_base_version
+ else
+ AC_MSG_ERROR([Unable to get version of $XENO_LINUX_SRCDIR, aborting.])
+ fi
+ else
+ AC_MSG_RESULT([$XENO_LINUX_SRCDIR (kernel ${linux_full_version})])
+ fi
+ fi
+
+ AC_MSG_CHECKING(for Adeos patch)
+ unset ADEOS_PATCH
+ AC_ARG_WITH(adeos-patch,
+ AS_HELP_STRING([--with-adeos-patch],[specify the path to the Adeos
+patch. Default is to infer the patch name from Linux kernel version.]),
+ [ADEOS_PATCH="`/bin/bash -c \"echo $withval\"`"])
+
+ if test x"$ADEOS_PATCH" = x && test x"$linux_base_version" != x; then
+ set -- $srcdir/ksrc/arch/$XENO_TARGET_ARCH/patches/adeos-*$linux_base_version-$XENO_LINUX_ARCH-*
+ ADEOS_PATCH=$1
+ fi
+ if test x"$ADEOS_PATCH" = x || test ! -e $ADEOS_PATCH; then
+ if test -e linux/.xenomai-prepared; then
+ AC_MSG_RESULT(not found)
+ unset ADEOS_PATCH
+ else
+ AC_MSG_ERROR([Unable to find Adeos patch, please use --with-adeos-patch])
+ fi
+ else
+ AC_MSG_RESULT([$ADEOS_PATCH])
+ fi
+ AC_SUBST(ADEOS_PATCH)
+
+ AC_CONFIG_COMMANDS(linux, [
+ if test -e linux/.xenomai-prepared; then
+ . linux/.xenomai-prepared
+ if test x"$XENO_LINUX_VERSION" != x"$PREPARED_LINUX_VERSION" ||
+ test x"`basename $ADEOS_PATCH`" != x"$PREPARED_ADEOS_PATCH"; then
+ echo "*** Warning: built version of linux and requested versions are "
+ echo "*** different. If you want to build the requested version of "
+ echo "*** linux, remove the file: linux/.xenomai-prepared."
+ fi
+ touch linux/.xenomai-prepared
+ else
+ set -e
+ targetdir=$PWD/linux
+ if test \! -e linux || test \! $XENO_LINUX_SRCDIR -ef linux; then
+ if test -e linux; then
+ test -e linux/.config && mv linux/.config .xenomai.config
+ echo $ECHO_N "Removing existing linux directory... $ECHO_C"
+ rm -Rf linux
+ echo "${ECHO_T}done."
+ fi
+ mkdir linux
+ echo $ECHO_N "Making linux a shadow copy of $XENO_LINUX_SRCDIR... $ECHO_C"
+ cd $XENO_LINUX_SRCDIR
+ find . -! -type d | while read f; do
+ d=$targetdir/`dirname $f`
+ mkdir -p $d && ln -sf $XENO_LINUX_SRCDIR/$f $d/`basename $f`
+ done
+ echo "${ECHO_T}done."
+ fi
+ cd $targetdir
+
+ if test -e $XENO_LINUX_SRCDIR/.config; then
+ . $XENO_LINUX_SRCDIR/.config
+ test x"$CONFIG_X86" = xy && cfg_arch=i386 || :
+ test x"$CONFIG_PPC" = xy && cfg_arch=ppc || :
+ test x"$CONFIG_IA64" = xy && cfg_arch=ia64 || :
+ test x"$CONFIG_PPC64" = xy && cfg_arch=ppc64 || :
+ if test $cfg_arch = $XENO_TARGET_ARCH; then
+ cp $XENO_LINUX_SRCDIR/.config .xenomai.config
+ fi
+ echo "Cleaning linux directory..."
+ make ARCH=$cfg_arch distclean
+ test -e .xenomai.config && mv .xenomai.config .config
+ fi
+ cd ..
+ $srcdir/scripts/prepare-kernel.sh \
+ --adeos="$ADEOS_PATCH" --linux=linux --arch=$XENO_LINUX_ARCH
+ test -e .xenomai.config && mv .xenomai.config linux/.config || :
+ cat > linux/.xenomai-prepared.tmp <<EOF
+PREPARED_LINUX_VERSION=$XENO_LINUX_VERSION
+PREPARED_ADEOS_PATCH=`basename $ADEOS_PATCH`
+EOF
+ mv linux/.xenomai-prepared.tmp linux/.xenomai-prepared
+ fi
+ ],[XENO_LINUX_SRCDIR=$XENO_LINUX_SRCDIR
+ XENO_TARGET_ARCH=$XENO_TARGET_ARCH
+ XENO_LINUX_ARCH=$XENO_LINUX_ARCH
+ XENO_LINUX_VERSION=$linux_full_version
+ ADEOS_PATCH=$ADEOS_PATCH])
+fi
+AM_CONDITIONAL(XENO_BUILD_LINUX, [test \! x"$XENO_LINUX_SRCDIR" = x])
+
+
dnl Documentation package.
if test \! -d $srcdir/doc; then
@@ -339,6 +494,7 @@ AC_SUBST(LATEX_BATCHMODE)
AC_SUBST(LATEX_MODE)
AC_SUBST(XENO_TARGET_ARCH)
+AC_SUBST(XENO_LINUX_ARCH)
AC_SUBST(XENO_BUILD_STRING)
AC_SUBST(XENO_HOST_STRING)
AC_SUBST(XENO_USER_CFLAGS)
diff -Nurp --exclude .svn --exclude '*~' --exclude Makefile.in --exclude configure --exclude aclocal.m4 --exclude autom4te.cache trunk/scripts/prepare-kernel.sh branches/build-kernel/scripts/prepare-kernel.sh
--- trunk/scripts/prepare-kernel.sh 2006-01-04 13:12:32.000000000 +0100
+++ branches/build-kernel/scripts/prepare-kernel.sh 2006-01-08 21:16:15.000000000 +0100
@@ -2,12 +2,17 @@
set -e
do_links() {
- rm -fr $2
- ( cd $1 &&
+ ( if test -x $2; then
+ cd $2 &&
+ find . \( -name Makefile -o -name $config_file -o -name '*.[chS]' \) |
+ while read f; do
+ if test ! -e $1/$f; then rm -f $f; fi
+ done; else true; fi &&
+ cd $1 &&
find . \( -name Makefile -o -name $config_file -o -name '*.[chS]' \) |
while read f; do
d=`dirname $f`
- mkdir -p $2/$d && ln -s $1/$f $2/$f
+ mkdir -p $2/$d && ln -sf $1/$f $2/$f
done )
}
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree.
2006-01-08 20:22 ` Gilles Chanteperdrix
@ 2006-01-08 21:39 ` Philippe Gerum
0 siblings, 0 replies; 13+ messages in thread
From: Philippe Gerum @ 2006-01-08 21:39 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
Gilles Chanteperdrix wrote:
> Philippe Gerum wrote:
> > Gilles Chanteperdrix wrote:
> > > Philippe Gerum wrote:
> > > > Gilles Chanteperdrix wrote:
> > > > > The current approach is to use the sources of the running kernel if the
> > > > > only option specified is --enable-linux-build. Do you mean you find this
> > > > > feature superfluous ?
> > > > >
> > > >
> > > > If $enableval is "y", then no path has been specified, so you can
> > > > default to the running kernel in such a case.
> > >
> > > Here is a third version of the patch, where :
> > > * the --enable-sim option is removed
> > > * the --with-linux-srcdir option is removed
> > > * the CC variable is passed to kernel build system
> > > * prepare-kernel.sh no longer removes target directories before
> > > creating symbolic links.
> > >
> > >
> >
> > This is needed for creating links in a new kernel for the fist time:
>
> Sorry... Here is the 4th patch.
>
Ok, looks like fairly local and non-intrusive. I'm merged this patch into the main
trunk eventually, so that it gets more exposure and testing.
--
Philippe.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-01-08 21:39 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-07 11:30 [Xenomai-core] [rfc] Building Linux kernel in Xenomai tree Gilles Chanteperdrix
2006-01-07 18:04 ` Gilles Chanteperdrix
2006-01-07 18:38 ` Jan Kiszka
2006-01-07 19:32 ` Gilles Chanteperdrix
2006-01-07 19:58 ` Jan Kiszka
2006-01-07 21:24 ` Gilles Chanteperdrix
2006-01-08 12:08 ` Philippe Gerum
2006-01-08 13:08 ` Gilles Chanteperdrix
2006-01-08 14:17 ` Philippe Gerum
2006-01-08 16:55 ` Gilles Chanteperdrix
2006-01-08 19:23 ` Philippe Gerum
2006-01-08 20:22 ` Gilles Chanteperdrix
2006-01-08 21:39 ` Philippe Gerum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.