* [Xenomai-core] prepare-kernel options
@ 2007-02-28 12:17 Paul
2007-02-28 13:02 ` Jan Kiszka
2007-02-28 13:19 ` Gilles Chanteperdrix
0 siblings, 2 replies; 5+ messages in thread
From: Paul @ 2007-02-28 12:17 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
A little background - On Debian installations, a set of tools have been
provided to allow kernel packages to be quickly & simply generated. It is
something I do quite regularly with the following steps:
* Extract kernel sources in /tmp
* Apply patches
* Copy an existing .config over - Run `make oldconfig`
* make-kpkg binary-arch (produces kernel-image and kernel-header packages)
* Install/reboot
It may sound a long winded method, but it does allow me to use the generated
packages to install on any number of other machines.
The problem - prepare-kernel.sh creates symlinks to assorted files in the
Xenomai source tree. Not a problem if the same tree exists in the same
location on the target machine. As yet, there is no xenomai Debian package,
and the build location may not be the same as the install location - This
results in a large number of dangling symlinks which thwarts attempts to
compile out of tree modules using the kernel-headers package. I suspect the
same issues would exist for RPM packages and NFS mounted targets.
A solution - Instead of creating symlinks, the files need to be copied in to
the kernel source tree. Most people will use symlinks as it simplifies the
`svn up`/make process and avoids having to run prepare-kernel each time. I
propose a trivial patch that retains the original behaviour and provides an
option to turn off symlinks (patch attached).
Regards, Paul.
[-- Attachment #2: symlink_opt.patch --]
[-- Type: text/x-diff, Size: 1653 bytes --]
Index: scripts/prepare-kernel.sh
===================================================================
--- scripts/prepare-kernel.sh (revision 2265)
+++ scripts/prepare-kernel.sh (working copy)
@@ -95,6 +95,11 @@ patch_link() {
if test x$link_makefiles = xm; then
link_makefiles_opt="-name Makefile -o"
fi
+ if test x$no_symlinks = x1; then
+ link_command="cp -f"
+ else
+ link_command="cp -sf"
+ fi
if test "x$output_patch" = "x" -a -e $linux_tree/$link_dir; then
cd $linux_tree/$link_dir &&
@@ -116,7 +121,7 @@ patch_link() {
if test x$forcelink = x1 -o \
! $xenomai_root/$target_dir/$f -ef $linux_tree/$link_dir/$f;
then
- ln -sf $xenomai_root/$target_dir/$f $linux_tree/$link_dir/$f
+ $link_command $xenomai_root/$target_dir/$f $linux_tree/$link_dir/$f
fi
else
if test `check_filter $link_dir/$f` = "ok"; then
@@ -168,7 +173,7 @@ generate_patch() {
}
-usage='usage: prepare-kernel --linux=<linux-tree> --adeos=<adeos-patch> [--arch=<arch>] [--outpatch=<file> <tempdir> [--filterkvers=y|n] [--filterarch=y|n]] [--forcelink]'
+usage='usage: prepare-kernel --linux=<linux-tree> --adeos=<adeos-patch> [--arch=<arch>] [--outpatch=<file> <tempdir> [--filterkvers=y|n] [--filterarch=y|n]] [--forcelink] [--nosymlink]'
me=`basename $0`
while test $# -gt 0; do
@@ -198,6 +203,9 @@ while test $# -gt 0; do
--forcelink)
forcelink=1
;;
+ --nosymlink)
+ no_symlinks=1
+ ;;
--verbose)
verbose=1
;;
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-core] prepare-kernel options
2007-02-28 12:17 [Xenomai-core] prepare-kernel options Paul
@ 2007-02-28 13:02 ` Jan Kiszka
2007-02-28 13:51 ` Paul
2007-02-28 13:19 ` Gilles Chanteperdrix
1 sibling, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2007-02-28 13:02 UTC (permalink / raw)
To: Paul; +Cc: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]
Paul wrote:
> A little background - On Debian installations, a set of tools have been
> provided to allow kernel packages to be quickly & simply generated. It is
> something I do quite regularly with the following steps:
> * Extract kernel sources in /tmp
> * Apply patches
> * Copy an existing .config over - Run `make oldconfig`
> * make-kpkg binary-arch (produces kernel-image and kernel-header packages)
> * Install/reboot
>
> It may sound a long winded method, but it does allow me to use the generated
> packages to install on any number of other machines.
[Related question from my side:]
Would you be willing to provide debian package generation rules for
Xenomai? Something that would spit out .deb files when calling, say,
"make deb KERNEL=linux-2.6.x.tar.bz2 CONFIG=my-kernel-config" in a
configured userland build directory? That way we could automatise binary
package generation for kernel, user libs, development headers, and
documentation. And that would allow us to finally distribute them for
generic targets like x86 and x86_64 along with the usual tar files.
I think such a feature (maybe later enhanceable by RPM) would both be
interesting for replicable custom installations as well as for a
reference kernel distribution to provide a Xenomai quick-start.
>
> The problem - prepare-kernel.sh creates symlinks to assorted files in the
> Xenomai source tree. Not a problem if the same tree exists in the same
> location on the target machine. As yet, there is no xenomai Debian package,
> and the build location may not be the same as the install location - This
> results in a large number of dangling symlinks which thwarts attempts to
> compile out of tree modules using the kernel-headers package. I suspect the
> same issues would exist for RPM packages and NFS mounted targets.
>
> A solution - Instead of creating symlinks, the files need to be copied in to
> the kernel source tree. Most people will use symlinks as it simplifies the
> `svn up`/make process and avoids having to run prepare-kernel each time. I
> propose a trivial patch that retains the original behaviour and provides an
> option to turn off symlinks (patch attached).
>
Would this build procedure already help you?
http://www.rts.uni-hannover.de/xenomai/lxr/source/README.INSTALL?a=i386#203
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] prepare-kernel options
2007-02-28 13:02 ` Jan Kiszka
@ 2007-02-28 13:51 ` Paul
2007-02-28 14:00 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Paul @ 2007-02-28 13:51 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
On Wednesday 28 February 2007 13:02, Jan Kiszka wrote:
<snip>
> [Related question from my side:]
>
> Would you be willing to provide debian package generation rules for
> Xenomai? Something that would spit out .deb files when calling, say,
> "make deb KERNEL=linux-2.6.x.tar.bz2 CONFIG=my-kernel-config" in a
> configured userland build directory? That way we could automatise binary
> package generation for kernel, user libs, development headers, and
> documentation. And that would allow us to finally distribute them for
> generic targets like x86 and x86_64 along with the usual tar files.
To have a Debian rule set is indeed my ultimate goal (but I wouldn't want t
tread on anyone's toes if it is already in hand). - I suspect a number of
potential users would like to try Xenomai but are put off by kernel
compilation... But rather than a `make deb` rule, a small script would be
better - Debian's packaging system generates (amongst other things) a source
tarball, and to include auto-generated files doesn't feel right.. Calling the
`make dist` rule may solve that issue.
> I think such a feature (maybe later enhanceable by RPM) would both be
> interesting for replicable custom installations as well as for a
> reference kernel distribution to provide a Xenomai quick-start.
Indeed - Point a potential user to a repository, let them experiment with a
(hopefully) working kernel, and when they need/want specific vmlinuz options,
they have a reference point to work from. The "Debian way" also greatly
simplifies the task of building packages.
<snip>
> Would this build procedure already help you?
> http://www.rts.uni-hannover.de/xenomai/lxr/source/README.INSTALL?a=i386#203
Ah, yes.. It's the same doc in the top level Xenomai tree ;)
As Gilles has pointed out, there are already a couple of options in
prepare-kernel.sh to aid package generation - If nobody else is working on
that area, I'll put a patch together over the next few days and submit it for
review.
Regards, Paul.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] prepare-kernel options
2007-02-28 13:51 ` Paul
@ 2007-02-28 14:00 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2007-02-28 14:00 UTC (permalink / raw)
To: Paul; +Cc: xenomai-core, rlenglet
[-- Attachment #1: Type: text/plain, Size: 2258 bytes --]
Paul wrote:
> On Wednesday 28 February 2007 13:02, Jan Kiszka wrote:
> <snip>
>> [Related question from my side:]
>>
>> Would you be willing to provide debian package generation rules for
>> Xenomai? Something that would spit out .deb files when calling, say,
>> "make deb KERNEL=linux-2.6.x.tar.bz2 CONFIG=my-kernel-config" in a
>> configured userland build directory? That way we could automatise binary
>> package generation for kernel, user libs, development headers, and
>> documentation. And that would allow us to finally distribute them for
>> generic targets like x86 and x86_64 along with the usual tar files.
>
> To have a Debian rule set is indeed my ultimate goal (but I wouldn't want t
> tread on anyone's toes if it is already in hand). - I suspect a number of
Romain once worked on this. Don't know what happened to his effort, if
something might be reusable or so. I CC'ed him.
> potential users would like to try Xenomai but are put off by kernel
> compilation... But rather than a `make deb` rule, a small script would be
> better - Debian's packaging system generates (amongst other things) a source
> tarball, and to include auto-generated files doesn't feel right.. Calling the
> `make dist` rule may solve that issue.
>
>> I think such a feature (maybe later enhanceable by RPM) would both be
>> interesting for replicable custom installations as well as for a
>> reference kernel distribution to provide a Xenomai quick-start.
>
> Indeed - Point a potential user to a repository, let them experiment with a
> (hopefully) working kernel, and when they need/want specific vmlinuz options,
> they have a reference point to work from. The "Debian way" also greatly
> simplifies the task of building packages.
>
> <snip>
>> Would this build procedure already help you?
>> http://www.rts.uni-hannover.de/xenomai/lxr/source/README.INSTALL?a=i386#203
>
> Ah, yes.. It's the same doc in the top level Xenomai tree ;)
>
> As Gilles has pointed out, there are already a couple of options in
> prepare-kernel.sh to aid package generation - If nobody else is working on
> that area, I'll put a patch together over the next few days and submit it for
> review.
>
Great!
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] prepare-kernel options
2007-02-28 12:17 [Xenomai-core] prepare-kernel options Paul
2007-02-28 13:02 ` Jan Kiszka
@ 2007-02-28 13:19 ` Gilles Chanteperdrix
1 sibling, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2007-02-28 13:19 UTC (permalink / raw)
To: Paul; +Cc: xenomai-core
Paul wrote:
> A little background - On Debian installations, a set of tools have been
> provided to allow kernel packages to be quickly & simply generated. It is
> something I do quite regularly with the following steps:
> * Extract kernel sources in /tmp
> * Apply patches
> * Copy an existing .config over - Run `make oldconfig`
> * make-kpkg binary-arch (produces kernel-image and kernel-header packages)
> * Install/reboot
>
> It may sound a long winded method, but it does allow me to use the generated
> packages to install on any number of other machines.
>
> The problem - prepare-kernel.sh creates symlinks to assorted files in the
> Xenomai source tree. Not a problem if the same tree exists in the same
> location on the target machine. As yet, there is no xenomai Debian package,
> and the build location may not be the same as the install location - This
> results in a large number of dangling symlinks which thwarts attempts to
> compile out of tree modules using the kernel-headers package. I suspect the
> same issues would exist for RPM packages and NFS mounted targets.
>
> A solution - Instead of creating symlinks, the files need to be copied in to
> the kernel source tree. Most people will use symlinks as it simplifies the
> `svn up`/make process and avoids having to run prepare-kernel each time. I
> propose a trivial patch that retains the original behaviour and provides an
> option to turn off symlinks (patch attached).
In order to prepare for the Debianization, the options --outpatch,
--filterarch and --filterkvers were already added. That said, I see no
problem with your patch.
--
Gilles Chanteperdrix
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-02-28 14:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-28 12:17 [Xenomai-core] prepare-kernel options Paul
2007-02-28 13:02 ` Jan Kiszka
2007-02-28 13:51 ` Paul
2007-02-28 14:00 ` Jan Kiszka
2007-02-28 13:19 ` Gilles Chanteperdrix
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.